mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
19 lines
333 B
Rust
19 lines
333 B
Rust
// run-pass
|
|
#![allow(path_statements)]
|
|
#![allow(dead_code)]
|
|
|
|
#![feature(generators, generator_trait)]
|
|
|
|
struct WithDrop;
|
|
|
|
impl Drop for WithDrop {
|
|
fn drop(&mut self) {}
|
|
}
|
|
|
|
fn reborrow_from_generator(r: &mut ()) {
|
|
let d = WithDrop;
|
|
move || { d; yield; &mut *r }; //~ WARN unused generator that must be used
|
|
}
|
|
|
|
fn main() {}
|