Unnamed repository; edit this file 'description' to name the repository.
Auto merge of #123792 - oli-obk:coroutine_closures, r=compiler-errors
Require explicitly marking closures as coroutines instead of relying on patching up the closure to be a coroutine if it happens to contain a `yield` expression. I only do this in the 2024 edition, as the `gen` keyword is only available there.
bors 2024-04-24
parent b1ec083 · parent 83e2848 · commit dea73b7
-rw-r--r--crates/ide-db/src/generated/lints.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ide-db/src/generated/lints.rs b/crates/ide-db/src/generated/lints.rs
index d50088e6cf..c92d4e78ff 100644
--- a/crates/ide-db/src/generated/lints.rs
+++ b/crates/ide-db/src/generated/lints.rs
@@ -3869,7 +3869,7 @@ use std::ops::{Coroutine, CoroutineState};
use std::pin::Pin;
fn main() {
- let mut coroutine = || {
+ let mut coroutine = #[coroutine] || {
yield 1;
return "foo"
};
@@ -3901,7 +3901,7 @@ use std::ops::Coroutine;
use std::pin::Pin;
fn main() {
- let mut coroutine = || {
+ let mut coroutine = #[coroutine] || {
println!("2");
yield;
println!("4");
@@ -4007,7 +4007,7 @@ use std::pin::Pin;
fn main() {
let ret = "foo";
- let mut coroutine = move || {
+ let mut coroutine = #[coroutine] move || {
yield 1;
return ret
};