rust/tests/ui/nll/issue-48623-coroutine.rs

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

19 lines
347 B
Rust
Raw Normal View History

//@ run-pass
#![allow(path_statements)]
#![allow(dead_code)]
2023-10-19 21:46:28 +00:00
#![feature(coroutines, coroutine_trait)]
struct WithDrop;
impl Drop for WithDrop {
fn drop(&mut self) {}
}
2023-10-19 21:46:28 +00:00
fn reborrow_from_coroutine(r: &mut ()) {
let d = WithDrop;
#[coroutine] move || { d; yield; &mut *r }; //~ WARN unused coroutine that must be used
}
fn main() {}