2020-06-14 17:49:20 -05:00
|
|
|
#![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;
|
2020-06-15 23:28:50 -05:00
|
|
|
//~^ ERROR cannot cast enum `E` into integer `u32` because it implements `Drop`
|
2020-06-14 17:49:20 -05:00
|
|
|
//~| WARN this was previously accepted
|
|
|
|
}
|