Skip to content

Commit 410d64f

Browse files
authored
Rollup merge of #90927 - terrarier2111:fix-float-ice, r=jackh726
Fix float ICE This fixes #90728
2 parents 09d9c09 + 5f6059d commit 410d64f

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

compiler/rustc_parse/src/parser/expr.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,8 @@ impl<'a> Parser<'a> {
10321032
[IdentLike(_), Punct('+' | '-')] |
10331033
// 1e+2 | 1e-2
10341034
[IdentLike(_), Punct('+' | '-'), IdentLike(_)] |
1035+
// 1.2e+ | 1.2e-
1036+
[IdentLike(_), Punct('.'), IdentLike(_), Punct('+' | '-')] |
10351037
// 1.2e+3 | 1.2e-3
10361038
[IdentLike(_), Punct('.'), IdentLike(_), Punct('+' | '-'), IdentLike(_)] => {
10371039
// See the FIXME about `TokenCursor` above.

src/test/ui/parser/issue-90728.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn main() {
2+
a.5.2E+
3+
//~^ ERROR: unexpected token: `5.2E+`
4+
//~| ERROR: expected one of `.`, `;`, `?`, `}`, or an operator, found `5.2E+`
5+
//~| ERROR: expected at least one digit in exponent
6+
}

src/test/ui/parser/issue-90728.stderr

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error: expected at least one digit in exponent
2+
--> $DIR/issue-90728.rs:2:7
3+
|
4+
LL | a.5.2E+
5+
| ^^^^^
6+
7+
error: unexpected token: `5.2E+`
8+
--> $DIR/issue-90728.rs:2:7
9+
|
10+
LL | a.5.2E+
11+
| ^^^^^
12+
13+
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `5.2E+`
14+
--> $DIR/issue-90728.rs:2:7
15+
|
16+
LL | a.5.2E+
17+
| ^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
18+
19+
error: aborting due to 3 previous errors
20+

src/tools/tidy/src/ui_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const ENTRY_LIMIT: usize = 1000;
99
// FIXME: The following limits should be reduced eventually.
1010
const ROOT_ENTRY_LIMIT: usize = 983;
1111
const ISSUES_ENTRY_LIMIT: usize = 2310;
12-
const PARSER_LIMIT: usize = 1010;
12+
const PARSER_LIMIT: usize = 1012;
1313

1414
fn check_entries(path: &Path, bad: &mut bool) {
1515
let dirs = walkdir::WalkDir::new(&path.join("test/ui"))

0 commit comments

Comments
 (0)