File tree 2 files changed +19
-1
lines changed
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -2,4 +2,8 @@ fn f<F: Fn(i32)>(f: F) { f(0); }
2
2
fn main ( ) {
3
3
f ( |x| dbg ! ( x) ) ; //~ERROR
4
4
f ( |x| match x { tmp => { tmp } } ) ; //~ERROR
5
+ macro_rules! d {
6
+ ( $e: expr) => { match $e { x => { x } } }
7
+ }
8
+ f ( |x| d ! ( x) ) ; //~ERROR
5
9
}
Original file line number Diff line number Diff line change @@ -15,6 +15,20 @@ LL | f(|x| match x { tmp => { tmp } });
15
15
| | expected `()`, found `i32`
16
16
| expected this to be `()`
17
17
18
- error: aborting due to 2 previous errors
18
+ error[E0308]: mismatched types
19
+ --> $DIR/issue-81943.rs:6:38
20
+ |
21
+ LL | ($e:expr) => { match $e { x => { x } } }
22
+ | ------------------^----- help: consider using a semicolon here
23
+ | | |
24
+ | | expected `()`, found `i32`
25
+ | expected this to be `()`
26
+ LL | }
27
+ LL | f(|x| d!(x));
28
+ | ----- in this macro invocation
29
+ |
30
+ = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
31
+
32
+ error: aborting due to 3 previous errors
19
33
20
34
For more information about this error, try `rustc --explain E0308`.
You can’t perform that action at this time.
0 commit comments