mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-18 10:48:36 +00:00
17 lines
217 B
Rust
17 lines
217 B
Rust
|
#![deny(clippy::mem_discriminant_non_enum)]
|
||
|
|
||
|
use std::mem;
|
||
|
|
||
|
enum Foo {
|
||
|
One(usize),
|
||
|
Two(u8),
|
||
|
}
|
||
|
|
||
|
struct A(Foo);
|
||
|
|
||
|
fn main() {
|
||
|
// bad
|
||
|
mem::discriminant(&"hello");
|
||
|
mem::discriminant(&A(Foo::One(0)));
|
||
|
}
|