You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of rust-lang#121119 - compiler-errors:async-fn-kind-errs, r=oli-obk
Make `async Fn` trait kind errors better
1. Make it so that async closures with the wrong closurekind actually report a useful error
2. Explain why async closures can sometimes not implement `Fn`/`FnMut` (because they capture things)
r? oli-obk
Copy file name to clipboardexpand all lines: compiler/rustc_trait_selection/messages.ftl
+7-5
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,16 @@ trait_selection_adjust_signature_remove_borrow = consider adjusting the signatur
8
8
*[other] arguments
9
9
}
10
10
11
-
trait_selection_closure_fn_mut_label = closure is `FnMut` because it mutates the variable `{$place}` here
11
+
trait_selection_async_closure_not_fn = async closure does not implement `{$kind}` because it captures state from its environment
12
12
13
-
trait_selection_closure_fn_once_label = closure is `FnOnce` because it moves the variable `{$place}` out of its environment
13
+
trait_selection_closure_fn_mut_label = closure is `{$trait_prefix}FnMut` because it mutates the variable `{$place}` here
14
14
15
-
trait_selection_closure_kind_mismatch = expected a closure that implements the `{$expected}` trait, but this closure only implements `{$found}`
16
-
.label = this closure implements `{$found}`, not `{$expected}`
15
+
trait_selection_closure_fn_once_label = closure is `{$trait_prefix}FnOnce` because it moves the variable `{$place}` out of its environment
17
16
18
-
trait_selection_closure_kind_requirement = the requirement to implement `{$expected}` derives from here
17
+
trait_selection_closure_kind_mismatch = expected a closure that implements the `{$trait_prefix}{$expected}` trait, but this closure only implements `{$trait_prefix}{$found}`
18
+
.label = this closure implements `{$trait_prefix}{$found}`, not `{$trait_prefix}{$expected}`
19
+
20
+
trait_selection_closure_kind_requirement = the requirement to implement `{$trait_prefix}{$expected}` derives from here
19
21
20
22
trait_selection_dump_vtable_entries = vtable entries for `{$trait_ref}`: {$entries}
0 commit comments