File tree 3 files changed +24
-2
lines changed
compiler/rustc_parse/src/parser
3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -423,11 +423,11 @@ impl<'a> Parser<'a> {
423
423
if let token:: Literal ( Lit {
424
424
kind : token:: LitKind :: Integer | token:: LitKind :: Float ,
425
425
symbol,
426
- suffix,
426
+ suffix : Some ( suffix ) , // no suffix makes it a valid literal
427
427
} ) = self . token . kind
428
428
&& rustc_ast:: MetaItemLit :: from_token ( & self . token ) . is_none ( )
429
429
{
430
- Some ( ( symbol. as_str ( ) . len ( ) , suffix. unwrap ( ) ) )
430
+ Some ( ( symbol. as_str ( ) . len ( ) , suffix) )
431
431
} else {
432
432
None
433
433
}
Original file line number Diff line number Diff line change
1
+ fn `2222222222222222222222222222222222222222 ( ) { }
2
+ //~^ ERROR unknown start of token: `
3
+ //~^^ ERROR expected identifier, found `2222222222222222222222222222222222222222`
Original file line number Diff line number Diff line change
1
+ error: unknown start of token: `
2
+ --> $DIR/issue-110014.rs:1:3
3
+ |
4
+ LL | fn`2222222222222222222222222222222222222222() {}
5
+ | ^
6
+ |
7
+ help: Unicode character '`' (Grave Accent) looks like ''' (Single Quote), but it is not
8
+ |
9
+ LL | fn'2222222222222222222222222222222222222222() {}
10
+ | ~
11
+
12
+ error: expected identifier, found `2222222222222222222222222222222222222222`
13
+ --> $DIR/issue-110014.rs:1:4
14
+ |
15
+ LL | fn`2222222222222222222222222222222222222222() {}
16
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected identifier
17
+
18
+ error: aborting due to 2 previous errors
19
+
You can’t perform that action at this time.
0 commit comments