2022-03-24 14:50:04 +01:00
|
|
|
#![warn(clippy::cast_enum_constructor)]
|
|
|
|
#![allow(clippy::fn_to_numeric_cast)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
enum Foo {
|
|
|
|
Y(u32),
|
|
|
|
}
|
|
|
|
|
|
|
|
enum Bar {
|
|
|
|
X,
|
|
|
|
}
|
|
|
|
|
|
|
|
let _ = Foo::Y as usize;
|
2023-08-24 21:32:12 +02:00
|
|
|
//~^ ERROR: cast of an enum tuple constructor to an integer
|
|
|
|
//~| NOTE: `-D clippy::cast-enum-constructor` implied by `-D warnings`
|
2022-03-24 14:50:04 +01:00
|
|
|
let _ = Foo::Y as isize;
|
2023-08-24 21:32:12 +02:00
|
|
|
//~^ ERROR: cast of an enum tuple constructor to an integer
|
2022-03-24 14:50:04 +01:00
|
|
|
let _ = Foo::Y as fn(u32) -> Foo;
|
|
|
|
let _ = Bar::X as usize;
|
|
|
|
}
|