This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed
compiler/rustc_parse/src/parser Expand file tree Collapse file tree 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> {
423423 if let token:: Literal ( Lit {
424424 kind : token:: LitKind :: Integer | token:: LitKind :: Float ,
425425 symbol,
426- suffix,
426+ suffix : Some ( suffix ) , // no suffix makes it a valid literal
427427 } ) = self . token . kind
428428 && rustc_ast:: MetaItemLit :: from_token ( & self . token ) . is_none ( )
429429 {
430- Some ( ( symbol. as_str ( ) . len ( ) , suffix. unwrap ( ) ) )
430+ Some ( ( symbol. as_str ( ) . len ( ) , suffix) )
431431 } else {
432432 None
433433 }
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