
This changes the `cenum_impl_drop_cast` lint to be a hard error. This lint has been deny-by-default and warning in dependencies since https://github.com/rust-lang/rust/pull/97652 about 2.5 years ago. Closes https://github.com/rust-lang/rust/issues/73333
15 lines
239 B
Rust
15 lines
239 B
Rust
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`
|
|
}
|