rust/tests/ui/generator/reborrow-mut-upvar.rs
2023-01-11 09:32:08 +00:00

17 lines
227 B
Rust

// run-pass
#![feature(generators)]
fn _run(bar: &mut i32) {
|| { //~ WARN unused generator that must be used
{
let _baz = &*bar;
yield;
}
*bar = 2;
};
}
fn main() {}