rust/tests/ui/unsafe
Esteban Küber e6bd6c2044 Use parenthetical notation for Fn traits
Always use the `Fn(T) -> R` format when printing closure traits instead of `Fn<(T,), Output = R>`.

Fix #67100:

```
error[E0277]: expected a `Fn()` closure, found `F`
 --> file.rs:6:13
  |
6 |     call_fn(f)
  |     ------- ^ expected an `Fn()` closure, found `F`
  |     |
  |     required by a bound introduced by this call
  |
  = note: wrap the `F` in a closure with no arguments: `|| { /* code */ }`
note: required by a bound in `call_fn`
 --> file.rs:1:15
  |
1 | fn call_fn<F: Fn() -> ()>(f: &F) {
  |               ^^^^^^^^^^ required by this bound in `call_fn`
help: consider further restricting this bound
  |
5 | fn call_any<F: std::any::Any + Fn()>(f: &F) {
  |                              ++++++
```
2024-05-29 22:26:54 +00:00
..
auxiliary make unsafe_op_in_unsafe_fn MachineApplicable and add it to 2024 compatibility 2024-01-15 23:06:39 +00:00
unsafe_op_in_unsafe_fn Cleanup: Fix up some diagnostics 2024-05-22 22:40:34 +02:00
access_union_field.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
access_union_field.stderr Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
const_pat_in_layout_restricted.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
edition-2024-unsafe_op_in_unsafe_fn.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
edition-2024-unsafe_op_in_unsafe_fn.stderr Cleanup: Fix up some diagnostics 2024-05-22 22:40:34 +02:00
foreign-unsafe-fn-called.rs Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
foreign-unsafe-fn-called.stderr Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
initializing-ranged-via-ctor.rs rustc_layout_scalar_valid_range makes ctors unsafe 2023-08-30 15:01:58 -07:00
initializing-ranged-via-ctor.stderr Use parenthetical notation for Fn traits 2024-05-29 22:26:54 +00:00
inline_asm.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
inline_asm.stderr Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
issue-3080.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
issue-3080.stderr Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
issue-45087-unreachable-unsafe.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
issue-45087-unreachable-unsafe.stderr Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
issue-45107-unnecessary-unsafe-in-closure.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
issue-45107-unnecessary-unsafe-in-closure.stderr Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
issue-47412.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
issue-47412.stderr Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
issue-85435-unsafe-op-in-let-under-unsafe-under-closure.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-87414-query-cycle.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-106126-good-path-bug.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-115348-false-positive-warning-of-unnecessary-unsafe.rs add a regression test 2023-09-06 17:46:46 +08:00
issue-115348-false-positive-warning-of-unnecessary-unsafe.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
new-unsafe-pointers.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
ranged_ints2_const.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
ranged_ints2_const.stderr Bless tests 2024-01-13 12:46:58 -05:00
ranged_ints2.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
ranged_ints2.stderr Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
ranged_ints3_const.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
ranged_ints3_const.stderr Bless tests 2024-01-13 12:46:58 -05:00
ranged_ints3_match.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
ranged_ints3_match.stderr Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
ranged_ints3.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
ranged_ints3.stderr Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
ranged_ints4_const.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
ranged_ints4_const.stderr Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
ranged_ints4.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
ranged_ints4.stderr Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
ranged_ints_const.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
ranged_ints_const.stderr Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
ranged_ints_macro.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
ranged_ints.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
ranged_ints.stderr Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
ranged-ctor-as-fn-ptr.rs Test and note unsafe ctor to fn ptr coercion 2023-08-30 15:09:40 -07:00
ranged-ctor-as-fn-ptr.stderr Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00
union_access_through_block.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
union_destructure.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
union_wild_or_wild.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
union-assignop.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
union-assignop.stderr Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
union-modification.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
union.rs Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
union.stderr Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
unsafe-around-compiler-generated-unsafe.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unsafe-around-compiler-generated-unsafe.stderr Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
unsafe-assign.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
unsafe-assign.stderr Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
unsafe-block-without-braces.rs
unsafe-block-without-braces.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
unsafe-borrow.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
unsafe-borrow.stderr Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
unsafe-const-fn.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
unsafe-const-fn.stderr Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
unsafe-fn-assign-deref-ptr.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
unsafe-fn-assign-deref-ptr.stderr Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
unsafe-fn-autoderef.rs
unsafe-fn-autoderef.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
unsafe-fn-called-from-safe.rs Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
unsafe-fn-called-from-safe.stderr Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
unsafe-fn-called-from-unsafe-blk.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unsafe-fn-called-from-unsafe-fn.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unsafe-fn-deref-ptr.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
unsafe-fn-deref-ptr.stderr Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
unsafe-fn-used-as-value.rs Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
unsafe-fn-used-as-value.stderr Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
unsafe-not-inherited.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
unsafe-not-inherited.stderr Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
unsafe-pointer-assignability.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unsafe-subtyping.rs
unsafe-subtyping.stderr Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00
unsafe-trait-impl.rs recurse into refs when comparing tys for diagnostics 2023-12-07 23:00:46 -05:00
unsafe-trait-impl.stderr Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00
unsafe-unstable-const-fn.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
unsafe-unstable-const-fn.stderr Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00