mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-11 07:34:18 +00:00
Add test case for mem::discriminant
inside a macro
This commit is contained in:
parent
5dbca1f6b1
commit
1a6bfecf38
2 changed files with 18 additions and 1 deletions
|
@ -34,6 +34,11 @@ fn main() {
|
|||
mem::discriminant(rro);
|
||||
mem::discriminant(&rro);
|
||||
|
||||
macro_rules! mem_discriminant_but_in_a_macro {
|
||||
($param:expr) => (mem::discriminant($param))
|
||||
}
|
||||
|
||||
mem_discriminant_but_in_a_macro!(&rro);
|
||||
|
||||
// ok
|
||||
mem::discriminant(&Some(2));
|
||||
|
|
|
@ -72,5 +72,17 @@ error: calling `mem::discriminant` on non-enum type `&&std::option::Option<i32>`
|
|||
| |
|
||||
| help: try dereferencing: `*rro`
|
||||
|
||||
error: aborting due to 9 previous errors
|
||||
error: calling `mem::discriminant` on non-enum type `&&std::option::Option<i32>`
|
||||
--> $DIR/mem_discriminant.rs:38:27
|
||||
|
|
||||
38 | ($param:expr) => (mem::discriminant($param))
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
...
|
||||
41 | mem_discriminant_but_in_a_macro!(&rro);
|
||||
| ---------------------------------------
|
||||
| | |
|
||||
| | help: try dereferencing: `*rro`
|
||||
| in this macro invocation
|
||||
|
||||
error: aborting due to 10 previous errors
|
||||
|
||||
|
|
Loading…
Reference in a new issue