Skip to content

Commit 26872f7

Browse files
committed
fix: 🐛 inclusive/exclusive range bound error
1 parent 608e12b commit 26872f7

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

compiler/rustc_lexer/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ impl Cursor<'_> {
687687
suffix_start = self.pos_within_token();
688688
}
689689
}
690-
('e' | 'E', '0'..'9' | '+' | '-') => {
690+
('e' | 'E', '0'..='9' | '+' | '-') => {
691691
// definitely an exponent
692692
self.bump();
693693
empty_exponent = !self.eat_float_exponent();

tests/ui/consts/custom-suffixes.rs

+11-9
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ fn main() {
77
const _B: f64 = 1f64;
88
const _C: f64 = 1.0f64;
99
const _D: f64 = 1e6;
10-
const _E: f64 = 1e-6;
11-
const _F: f64 = 1.0e-6;
12-
const _G: f64 = 1.0e06;
13-
const _H: f64 = 1.0e+6;
14-
const _I: f64 = 1.0e-6;
10+
const _E: f64 = 1.0e9;
11+
const _F: f64 = 1e-6;
12+
const _G: f64 = 1.0e-6;
13+
const _H: f64 = 1.0e06;
14+
const _I: f64 = 1.0e+6;
15+
const _J: f64 = 1.0e-6;
1516
// these ones are perhaps more suprising.
16-
const _J: f64 = 1.0e0________________________6;
17-
const _K: f64 = 1.0e________________________6;
18-
const _L: f64 = 1.0e+________________________6;
19-
const _M: f64 = 1.0e-________________________6;
17+
const _K: f64 = 1.0e0________________________6;
18+
const _L: f64 = 1.0e________________________6;
19+
const _M: f64 = 1.0e+________________________6;
20+
const _N: f64 = 1.0e-________________________6;
21+
const _O: f64 = 1.0e-________________________9;
2022
}

0 commit comments

Comments
 (0)