blob: 5c6c8062322dac951cdce3d1e09b2e665984c195 [file] [log] [blame]
// compile-flags: --edition 2024 -Zunstable-options
// run-rustfix
#![feature(gen_blocks)]
fn moved() -> impl Iterator<Item = u32> {
let mut x = "foo".to_string();
gen move { //~ ERROR: gen block may outlive the current function
yield 42;
if x == "foo" { return }
x.clear();
for x in 3..6 { yield x }
}
}
fn main() {
for _ in moved() {}
}