|
1 |
| -error: arbitrary expressions aren't allowed in patterns |
2 |
| - --> $DIR/issue-92074-macro-ice.rs:18:25 |
| 1 | +error: expected pattern, found expression `Vec :: new()` |
| 2 | + --> $DIR/issue-92074-macro-ice.rs:10:20 |
3 | 3 | |
|
| 4 | +LL | ($e:expr) => { $e } |
| 5 | + | ^^ expected pattern |
| 6 | +... |
4 | 7 | LL | () => { force_expr!(Vec::new()) }
|
5 |
| - | ^^^^^^^^^^ |
| 8 | + | ----------------------- this macro call doesn't expand to a pattern |
6 | 9 | ...
|
7 | 10 | LL | assert!(matches!(x, En::A(make_vec!())));
|
8 | 11 | | ----------- in this macro invocation
|
9 | 12 | |
|
10 |
| - = note: the `expr` fragment specifier forces the metavariable's content to be an expression |
11 |
| - = note: this error originates in the macro `make_vec` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 13 | + = note: this error originates in the macro `force_expr` which comes from the expansion of the macro `make_vec` (in Nightly builds, run with -Z macro-backtrace for more info) |
12 | 14 |
|
13 |
| -error: arbitrary expressions aren't allowed in patterns |
14 |
| - --> $DIR/issue-92074-macro-ice.rs:22:24 |
| 15 | +error: expected pattern, found expression `get_usize()` |
| 16 | + --> $DIR/issue-92074-macro-ice.rs:14:29 |
15 | 17 | |
|
16 |
| -LL | () => { force_pat!(get_usize(), get_usize()) } |
17 |
| - | ^^^^^^^^^^^ |
| 18 | +LL | ($a:expr, $b:expr) => { $a..=$b } |
| 19 | + | ^^ expected pattern |
18 | 20 | ...
|
19 |
| -LL | assert!(matches!(5, make_pat!())); |
20 |
| - | ----------- in this macro invocation |
21 |
| - | |
22 |
| - = note: the `expr` fragment specifier forces the metavariable's content to be an expression |
23 |
| - = note: this error originates in the macro `make_pat` (in Nightly builds, run with -Z macro-backtrace for more info) |
24 |
| - |
25 |
| -error: arbitrary expressions aren't allowed in patterns |
26 |
| - --> $DIR/issue-92074-macro-ice.rs:22:37 |
27 |
| - | |
28 | 21 | LL | () => { force_pat!(get_usize(), get_usize()) }
|
29 |
| - | ^^^^^^^^^^^ |
| 22 | + | ------------------------------------ this macro call doesn't expand to a pattern |
30 | 23 | ...
|
31 | 24 | LL | assert!(matches!(5, make_pat!()));
|
32 | 25 | | ----------- in this macro invocation
|
33 | 26 | |
|
34 |
| - = note: the `expr` fragment specifier forces the metavariable's content to be an expression |
35 |
| - = note: this error originates in the macro `make_pat` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 27 | + = note: this error originates in the macro `force_pat` which comes from the expansion of the macro `make_pat` (in Nightly builds, run with -Z macro-backtrace for more info) |
36 | 28 |
|
37 |
| -error: aborting due to 3 previous errors |
| 29 | +error: aborting due to 2 previous errors |
38 | 30 |
|
0 commit comments