diff --git a/compiler/rustc_ast/src/token.rs b/compiler/rustc_ast/src/token.rs index 5247007fdce98..5b6cf30fa96e3 100644 --- a/compiler/rustc_ast/src/token.rs +++ b/compiler/rustc_ast/src/token.rs @@ -379,7 +379,7 @@ impl Token { } } - pub fn is_range_seperator(&self) -> bool { + pub fn is_range_separator(&self) -> bool { [DotDot, DotDotDot, DotDotEq].contains(&self.kind) } diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 7235b15a46be6..40100363c5037 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -180,7 +180,7 @@ impl<'a> Parser<'a> { LhsExpr::AttributesParsed(attrs) => Some(attrs), _ => None, }; - if self.token.is_range_seperator() { + if self.token.is_range_separator() { return self.parse_prefix_range_expr(attrs); } else { self.parse_prefix_expr(attrs)? @@ -512,7 +512,7 @@ impl<'a> Parser<'a> { } debug_assert!( - self.token.is_range_seperator(), + self.token.is_range_separator(), "parse_prefix_range_expr: token {:?} is not DotDot/DotDotEq", self.token ); @@ -896,7 +896,7 @@ impl<'a> Parser<'a> { let has_lifetime = self.token.is_lifetime() && self.look_ahead(1, |t| t != &token::Colon); let lifetime = has_lifetime.then(|| self.expect_lifetime()); // For recovery, see below. let (borrow_kind, mutbl) = self.parse_borrow_modifiers(lo); - let expr = if self.token.is_range_seperator() { + let expr = if self.token.is_range_separator() { self.parse_prefix_range_expr(None) } else { self.parse_prefix_expr(None) diff --git a/src/test/ui/parser/issue-105634.rs b/src/test/ui/parser/issue-105634.rs index 7a094d8e4b4b4..579aa6e5bfb1b 100644 --- a/src/test/ui/parser/issue-105634.rs +++ b/src/test/ui/parser/issue-105634.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass fn main() { let _a = ..;