Manishearth / humpty_dumpty

Implicit Drop/move protection for Rust (linear types)
12 stars 1 forks source link

Introducing a protected value inside a loop does not always warn #21

Closed Munksgaard closed 9 years ago

Munksgaard commented 9 years ago
#[drop_protect]
struct Foo;

#[allow_drop="Foo"]
fn close(_: Foo) { }

fn main() {
    loop {
        let y = Foo;
    }
}

Should warn that y is dropped at the end of the loop.