Skip to content

Commit f6e9fd0

Browse files
committed
Add ICE regression tests
1 parent b93ef68 commit f6e9fd0

4 files changed

+44
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
macro_rules! x {
2+
($($c:tt)*) => {
3+
$($c)ö* {} //~ ERROR missing condition for `if` expression
4+
}; //~| ERROR mismatched types
5+
}
6+
7+
fn main() {
8+
x!(if);
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
error: missing condition for `if` expression
2+
--> $DIR/issue-68091-unicode-ident-after-if.rs:3:14
3+
|
4+
LL | $($c)ö* {}
5+
| ^ expected if condition here
6+
7+
error[E0308]: mismatched types
8+
--> $DIR/issue-68091-unicode-ident-after-if.rs:3:17
9+
|
10+
LL | $($c)ö* {}
11+
| ^^ expected `bool`, found `()`
12+
...
13+
LL | x!(if);
14+
| ------- in this macro invocation
15+
16+
error: aborting due to 2 previous errors
17+
18+
For more information about this error, try `rustc --explain E0308`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
macro_rules! x {
2+
($($c:tt)*) => {
3+
$($c)ö* //~ ERROR macro expansion ends with an incomplete expression: expected expression
4+
};
5+
}
6+
7+
fn main() {
8+
x!(!);
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: macro expansion ends with an incomplete expression: expected expression
2+
--> $DIR/issue-68092-unicode-ident-after-incomplete-expr.rs:3:14
3+
|
4+
LL | $($c)ö*
5+
| ^ expected expression
6+
7+
error: aborting due to previous error
8+

0 commit comments

Comments
 (0)