mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
19 lines
314 B
Rust
19 lines
314 B
Rust
#![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
|
|
}
|