File tree 3 files changed +12
-2
lines changed
compiler/rustc_parse/src/parser
3 files changed +12
-2
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 , |t| * t == token:: OpenDelim ( Delimiter :: Parenthesis ) ) )
390
+ let ident = if self . token . is_ident ( )
391
+ && ( !is_const || self . look_ahead ( 1 , |t| * t == token:: OpenDelim ( Delimiter :: Parenthesis ) ) )
392
392
&& self . look_ahead ( 1 , |t| {
393
393
[
394
394
token:: Lt ,
Original file line number Diff line number Diff line change
1
+ const !( & raw mut a) ;
2
+ //~^ ERROR expected identifier, found `!`
Original file line number Diff line number Diff line change
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
+
You can’t perform that action at this time.
0 commit comments