File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,11 @@ fn main() {
3434 mem:: discriminant ( rro) ;
3535 mem:: discriminant ( & rro) ;
3636
37+ macro_rules! mem_discriminant_but_in_a_macro {
38+ ( $param: expr) => ( mem:: discriminant( $param) )
39+ }
40+
41+ mem_discriminant_but_in_a_macro ! ( & rro) ;
3742
3843 // ok
3944 mem:: discriminant ( & Some ( 2 ) ) ;
Original file line number Diff line number Diff line change @@ -72,5 +72,17 @@ error: calling `mem::discriminant` on non-enum type `&&std::option::Option<i32>`
7272 | |
7373 | help: try dereferencing: `*rro`
7474
75- error: aborting due to 9 previous errors
75+ error: calling `mem::discriminant` on non-enum type `&&std::option::Option<i32>`
76+ --> $DIR/mem_discriminant.rs:38:27
77+ |
78+ 38 | ($param:expr) => (mem::discriminant($param))
79+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
80+ ...
81+ 41 | mem_discriminant_but_in_a_macro!(&rro);
82+ | ---------------------------------------
83+ | | |
84+ | | help: try dereferencing: `*rro`
85+ | in this macro invocation
86+
87+ error: aborting due to 10 previous errors
7688
You can’t perform that action at this time.
0 commit comments