Skip to content

Commit 83e2848

Browse files
committed
Error on using yield without also using #[coroutine] on the closure
And suggest adding the `#[coroutine]` to the closure
1 parent ea91be2 commit 83e2848

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/ide-db/src/generated/lints.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3869,7 +3869,7 @@ use std::ops::{Coroutine, CoroutineState};
38693869
use std::pin::Pin;
38703870
38713871
fn main() {
3872-
let mut coroutine = || {
3872+
let mut coroutine = #[coroutine] || {
38733873
yield 1;
38743874
return "foo"
38753875
};
@@ -3901,7 +3901,7 @@ use std::ops::Coroutine;
39013901
use std::pin::Pin;
39023902
39033903
fn main() {
3904-
let mut coroutine = || {
3904+
let mut coroutine = #[coroutine] || {
39053905
println!("2");
39063906
yield;
39073907
println!("4");
@@ -4007,7 +4007,7 @@ use std::pin::Pin;
40074007
40084008
fn main() {
40094009
let ret = "foo";
4010-
let mut coroutine = move || {
4010+
let mut coroutine = #[coroutine] move || {
40114011
yield 1;
40124012
return ret
40134013
};

0 commit comments

Comments
 (0)