diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-04-11 13:15:34 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-04-24 08:05:29 +0000 |
| commit | aef0f4024aec24fd7e53dbc51883457e44fe17ce (patch) | |
| tree | 25a26930a8cc3441951ba159f1a632092df41655 /compiler/rustc_ast_lowering/messages.ftl | |
| parent | a589632dad58c2669b7984019efb59917a16ac67 (diff) | |
| download | rust-aef0f4024aec24fd7e53dbc51883457e44fe17ce.tar.gz rust-aef0f4024aec24fd7e53dbc51883457e44fe17ce.zip | |
Error on using `yield` without also using `#[coroutine]` on the closure
And suggest adding the `#[coroutine]` to the closure
Diffstat (limited to 'compiler/rustc_ast_lowering/messages.ftl')
| -rw-r--r-- | compiler/rustc_ast_lowering/messages.ftl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_ast_lowering/messages.ftl b/compiler/rustc_ast_lowering/messages.ftl index a23e714ef01..73001c9990c 100644 --- a/compiler/rustc_ast_lowering/messages.ftl +++ b/compiler/rustc_ast_lowering/messages.ftl @@ -163,3 +163,6 @@ ast_lowering_underscore_expr_lhs_assign = .label = `_` not allowed here ast_lowering_use_angle_brackets = use angle brackets instead +ast_lowering_yield_in_closure = + `yield` can only be used in `#[coroutine]` closures, or `gen` blocks + .suggestion = use `#[coroutine]` to make this closure a coroutine |
