rust/tests/ui/closures
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
..
2229_closure_analysis turn pointer_structural_match into a hard error 2024-05-03 15:56:59 +02:00
binder [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
closure-expected-type
deduce-signature hir typeck: look into nested goals 2024-04-25 19:44:00 +00:00
print [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
add_semicolon_non_block_closure.rs
add_semicolon_non_block_closure.stderr
cannot-call-unsized-via-ptr-2.rs
cannot-call-unsized-via-ptr-2.stderr
cannot-call-unsized-via-ptr.rs
cannot-call-unsized-via-ptr.stderr
capture-unsized-by-move.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
capture-unsized-by-move.stderr
capture-unsized-by-ref.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
closure_cap_coerce_many_fail.rs
closure_cap_coerce_many_fail.stderr
closure_no_cap_coerce_many_check_pass.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
closure_no_cap_coerce_many_run_pass.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
closure_no_cap_coerce_many_unsafe_0.rs
closure_no_cap_coerce_many_unsafe_0.stderr
closure_no_cap_coerce_many_unsafe_1.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
closure_promotion.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
closure-array-break-length.rs
closure-array-break-length.stderr
closure-bounds-cant-promote-superkind-in-struct.rs
closure-bounds-cant-promote-superkind-in-struct.stderr
closure-bounds-static-cant-capture-borrowed.rs
closure-bounds-static-cant-capture-borrowed.stderr
closure-bounds-subtype.rs
closure-bounds-subtype.stderr
closure-expected.rs
closure-expected.stderr Use parenthetical notation for Fn traits 2024-05-29 22:26:54 +00:00
closure-immutable-outer-variable.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
closure-immutable-outer-variable.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
closure-immutable-outer-variable.rs.fixed
closure-immutable-outer-variable.stderr
closure-move-sync.rs
closure-move-sync.stderr
closure-no-fn-1.rs
closure-no-fn-1.stderr
closure-no-fn-2.rs
closure-no-fn-2.stderr
closure-no-fn-3.rs
closure-no-fn-3.stderr
closure-no-fn-4.rs
closure-no-fn-4.stderr
closure-no-fn-5.rs
closure-no-fn-5.stderr
closure-referencing-itself-issue-25954.rs
closure-referencing-itself-issue-25954.stderr
closure-reform-bad.rs
closure-reform-bad.stderr
closure-return-type-mismatch.rs
closure-return-type-mismatch.stderr Inline get_node_fn_decl into get_fn_decl, simplify/explain logic in report_return_mismatched_types 2024-05-20 20:16:29 -04:00
closure-return-type-must-be-sized.rs
closure-return-type-must-be-sized.stderr
closure-wrong-kind.rs
closure-wrong-kind.stderr
coerce-unsafe-closure-to-unsafe-fn-ptr.rs
coerce-unsafe-closure-to-unsafe-fn-ptr.stderr
coerce-unsafe-to-closure.rs
coerce-unsafe-to-closure.stderr Use parenthetical notation for Fn traits 2024-05-29 22:26:54 +00:00
deeply-nested_closures.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
diverging-closure.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-868.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-1460.rs Move some tests 2024-03-31 14:58:17 -03:00
issue-1460.stderr Move some tests 2024-03-31 14:58:17 -03:00
issue-5239-1.rs Move some tests 2024-04-21 15:43:43 -03:00
issue-5239-1.stderr Move some tests 2024-04-21 15:43:43 -03:00
issue-5239-2.rs Move some tests 2024-04-21 15:43:43 -03:00
issue-6801.rs
issue-6801.stderr
issue-10398.rs
issue-10398.stderr
issue-10682.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-11873.rs
issue-11873.stderr
issue-22864-1.rs Move some tests 2024-04-21 15:43:43 -03:00
issue-22864-2.rs Move some tests 2024-04-21 15:43:43 -03:00
issue-25439.rs
issue-25439.stderr
issue-41366.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-42463.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-46742.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-48109.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-52437.rs
issue-52437.stderr
issue-67123.rs
issue-67123.stderr
issue-68025.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-72408-nested-closures-exponential.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-78720.rs Fail candidate assembly for erroneous types 2024-04-16 12:42:48 +05:30
issue-78720.stderr Fail candidate assembly for erroneous types 2024-04-16 12:42:48 +05:30
issue-80313-mutable-borrow-in-closure.rs
issue-80313-mutable-borrow-in-closure.stderr
issue-80313-mutable-borrow-in-move-closure.rs
issue-80313-mutable-borrow-in-move-closure.stderr
issue-80313-mutation-in-closure.rs
issue-80313-mutation-in-closure.stderr
issue-80313-mutation-in-move-closure.rs
issue-80313-mutation-in-move-closure.stderr
issue-81700-mut-borrow.rs
issue-81700-mut-borrow.stderr
issue-82438-mut-without-upvar.rs
issue-82438-mut-without-upvar.stderr
issue-84044-drop-non-mut.rs
issue-84044-drop-non-mut.stderr
issue-84128.rs
issue-84128.stderr
issue-87461.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-87461.stderr
issue-87814-1.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-87814-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-90871.rs
issue-90871.stderr
issue-97607.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-99565.rs
issue-99565.stderr
issue-101696.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-102089-multiple-opaque-cast.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-109188.rs
issue-109188.stderr
issue-111932.rs
issue-111932.stderr
issue-113087.rs
issue-113087.stderr
local-type-mix.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
local-type-mix.stderr
multiple-fn-bounds.rs
multiple-fn-bounds.stderr eagerly instantiate binders to avoid relying on sub 2024-03-14 17:19:40 +01:00
old-closure-arg-call-as.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
old-closure-arg.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
old-closure-explicit-types.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
old-closure-expr-precedence.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
old-closure-expr-precedence.stderr
old-closure-expression-remove-semicolon.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
old-closure-expression-remove-semicolon.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
old-closure-expression-remove-semicolon.stderr
old-closure-fn-coerce.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
old-closure-iter-1.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
old-closure-iter-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
once-move-out-on-heap.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
return-value-lifetime-error.fixed Provide suggestion to dereference closure tail if appropriate 2024-04-05 19:42:55 +00:00
return-value-lifetime-error.rs Provide suggestion to dereference closure tail if appropriate 2024-04-05 19:42:55 +00:00
return-value-lifetime-error.stderr Provide suggestion to dereference closure tail if appropriate 2024-04-05 19:42:55 +00:00
self-supertrait-bounds.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
semistatement-in-lambda.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
static-closures-with-nonstatic-return.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
supertrait-hint-cycle-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
supertrait-hint-cycle-3.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
supertrait-hint-cycle.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
supertrait-hint-references-assoc-ty.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
thir-unsafeck-issue-85871.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00