Skip to content

Commit d13c474

Browse files
merge recommended changes
Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
1 parent db78fcf commit d13c474

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

compiler/rustc_lexer/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ impl Cursor<'_> {
688688
}
689689
}
690690
('e' | 'E', '0'..='9' | '+' | '-') => {
691-
// definitely an exponent
691+
// Definitely an exponent (which still can be empty).
692692
self.bump();
693693
empty_exponent = !self.eat_float_exponent();
694694
suffix_start = self.pos_within_token();
@@ -700,7 +700,7 @@ impl Cursor<'_> {
700700
(Float { base, empty_exponent }, suffix_start)
701701
}
702702
('e' | 'E', '_') => {
703-
// see above bock for similar apporach
703+
// See above block for similar approach.
704704
let non_exponent_suffix_start = self.pos_within_token();
705705
self.bump();
706706
while matches!(self.first(), '_') {
@@ -718,7 +718,7 @@ impl Cursor<'_> {
718718
}
719719
}
720720
('e' | 'E', '0'..='9' | '+' | '-') => {
721-
// definitely an exponent
721+
// // Definitely an exponent (which still can be empty).
722722
self.bump();
723723
let empty_exponent = !self.eat_float_exponent();
724724
let suffix_start = self.pos_within_token();
@@ -978,7 +978,7 @@ impl Cursor<'_> {
978978
}
979979
}
980980

981-
/// Returns `true` if a digit was consumed (rather than just '_')
981+
/// Returns `true` if a digit was consumed (rather than just '_'s).
982982
fn eat_decimal_digits(&mut self) -> bool {
983983
let mut has_digits = false;
984984
loop {

compiler/rustc_session/src/errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ pub fn report_lit_error(
377377
s.len() > 1 && s.starts_with(first_chars) && s[1..].chars().all(|c| c.is_ascii_digit())
378378
}
379379

380-
fn looks_like_exponent(s: &str) -> bool {
380+
fn looks_like_empty_exponent(s: &str) -> bool {
381381
s.len() == 1 && matches!(s.chars().next(), Some('e' | 'E'))
382382
}
383383

0 commit comments

Comments
 (0)