summaryrefslogtreecommitdiffstats
path: root/tests/ui/cenum_impl_drop_cast.rs
blob: 96e3d967e2c61cf8bbdabc2311d469524288ebe0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![deny(cenum_impl_drop_cast)]

enum E {
    A = 0,
}

impl Drop for E {
    fn drop(&mut self) {
        println!("Drop");
    }
}

fn main() {
    let e = E::A;
    let i = e as u32;
    //~^ ERROR cannot cast enum `E` into integer `u32` because it implements `Drop`
    //~| WARN this was previously accepted
}