Rollup merge of #127601 - trevyn:issue-127600, r=compiler-errors · rust-lang/rust@d433f17 (original) (raw)
File tree
3 files changed
lines changed
- compiler/rustc_parse/src/parser
3 files changed
lines changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| @@ -387,8 +387,8 @@ impl<'a> Parser<'a> { | |||
| 387 | 387 | let span = if is_pub { self.prev_token.span.to(ident_span) } else { ident_span }; | |
| 388 | 388 | let insert_span = ident_span.shrink_to_lo(); | |
| 389 | 389 | ||
| 390 | -let ident = if (!is_const | ||
| 391 | - | | self.look_ahead(1, | |
| 390 | +let ident = if self.token.is_ident() | ||
| 391 | +&& (!is_const | | self.look_ahead(1, | |
| 392 | 392 | && self.look_ahead(1, |t | { |
| 393 | 393 | [ | |
| 394 | 394 | token::Lt, |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| 1 | +const!(&raw mut a); | |
| 2 | +//~^ ERROR expected identifier, found `!` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| 1 | +error: expected identifier, found `!` | |
| 2 | + --> $DIR/ice-issue-127600.rs:1:6 | |
| 3 | + | | |
| 4 | +LL | const!(&raw mut a); | |
| 5 | + | ^ expected identifier | |
| 6 | + | |
| 7 | +error: aborting due to 1 previous error | |
| 8 | + |