rust/tests/ui/coroutine/reborrow-mut-upvar.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
228 B
Rust
Raw Normal View History

//@ run-pass
2023-10-19 21:46:28 +00:00
#![feature(coroutines)]
fn _run(bar: &mut i32) {
2023-10-19 21:46:28 +00:00
|| { //~ WARN unused coroutine that must be used
{
let _baz = &*bar;
yield;
}
*bar = 2;
};
}
fn main() {}