summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/issue-48623-generator.rs
blob: 08d2584ee5efd1a0efe029a493f49741c5a22236 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// 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() {}