mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-15 01:17:16 +00:00
77 lines
2.5 KiB
Text
77 lines
2.5 KiB
Text
|
error: calling `mem::discriminant` on non-enum type `&str`
|
||
|
--> $DIR/mem_discriminant.rs:24:5
|
||
|
|
|
||
|
24 | mem::discriminant(&"hello");
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||
|
|
|
||
|
note: lint level defined here
|
||
|
--> $DIR/mem_discriminant.rs:11:9
|
||
|
|
|
||
|
11 | #![deny(clippy::mem_discriminant_non_enum)]
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||
|
|
||
|
error: calling `mem::discriminant` on non-enum type `&std::option::Option<i32>`
|
||
|
--> $DIR/mem_discriminant.rs:25:5
|
||
|
|
|
||
|
25 | mem::discriminant(&&Some(2));
|
||
|
| ^^^^^^^^^^^^^^^^^^---------^
|
||
|
| |
|
||
|
| help: try dereferencing: `&Some(2)`
|
||
|
|
||
|
error: calling `mem::discriminant` on non-enum type `&std::option::Option<u8>`
|
||
|
--> $DIR/mem_discriminant.rs:26:5
|
||
|
|
|
||
|
26 | mem::discriminant(&&None::<u8>);
|
||
|
| ^^^^^^^^^^^^^^^^^^------------^
|
||
|
| |
|
||
|
| help: try dereferencing: `&None::<u8>`
|
||
|
|
||
|
error: calling `mem::discriminant` on non-enum type `&Foo`
|
||
|
--> $DIR/mem_discriminant.rs:27:5
|
||
|
|
|
||
|
27 | mem::discriminant(&&Foo::One(5));
|
||
|
| ^^^^^^^^^^^^^^^^^^-------------^
|
||
|
| |
|
||
|
| help: try dereferencing: `&Foo::One(5)`
|
||
|
|
||
|
error: calling `mem::discriminant` on non-enum type `&Foo`
|
||
|
--> $DIR/mem_discriminant.rs:28:5
|
||
|
|
|
||
|
28 | mem::discriminant(&&Foo::Two(5));
|
||
|
| ^^^^^^^^^^^^^^^^^^-------------^
|
||
|
| |
|
||
|
| help: try dereferencing: `&Foo::Two(5)`
|
||
|
|
||
|
error: calling `mem::discriminant` on non-enum type `A`
|
||
|
--> $DIR/mem_discriminant.rs:29:5
|
||
|
|
|
||
|
29 | mem::discriminant(&A(Foo::One(0)));
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||
|
|
||
|
error: calling `mem::discriminant` on non-enum type `&std::option::Option<i32>`
|
||
|
--> $DIR/mem_discriminant.rs:33:5
|
||
|
|
|
||
|
33 | mem::discriminant(&ro);
|
||
|
| ^^^^^^^^^^^^^^^^^^---^
|
||
|
| |
|
||
|
| help: try dereferencing: `ro`
|
||
|
|
||
|
error: calling `mem::discriminant` on non-enum type `&std::option::Option<i32>`
|
||
|
--> $DIR/mem_discriminant.rs:34:5
|
||
|
|
|
||
|
34 | mem::discriminant(rro);
|
||
|
| ^^^^^^^^^^^^^^^^^^---^
|
||
|
| |
|
||
|
| help: try dereferencing: `*rro`
|
||
|
|
||
|
error: calling `mem::discriminant` on non-enum type `&&std::option::Option<i32>`
|
||
|
--> $DIR/mem_discriminant.rs:35:5
|
||
|
|
|
||
|
35 | mem::discriminant(&rro);
|
||
|
| ^^^^^^^^^^^^^^^^^^----^
|
||
|
| |
|
||
|
| help: try dereferencing: `*rro`
|
||
|
|
||
|
error: aborting due to 9 previous errors
|
||
|
|