From b842b341922c8ebcbe1cd42e8a5e27a16234af72 Mon Sep 17 00:00:00 2001 From: varkor Date: Mon, 13 May 2019 22:18:41 +0100 Subject: [PATCH] Remove `Token::LArrow` --- src/librustc/ich/impls_syntax.rs | 1 - src/librustdoc/html/highlight.rs | 2 +- src/libsyntax/parse/lexer/mod.rs | 4 ---- src/libsyntax/parse/parser.rs | 3 +-- src/libsyntax/parse/token.rs | 5 +---- src/libsyntax/print/pprust.rs | 1 - src/libsyntax_ext/proc_macro_server.rs | 1 - 7 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/librustc/ich/impls_syntax.rs b/src/librustc/ich/impls_syntax.rs index 4e5718cc5ef2a..c3637a95fbfd7 100644 --- a/src/librustc/ich/impls_syntax.rs +++ b/src/librustc/ich/impls_syntax.rs @@ -329,7 +329,6 @@ fn hash_token<'a, 'gcx, W: StableHasherResult>( token::Token::Colon | token::Token::ModSep | token::Token::RArrow | - token::Token::LArrow | token::Token::FatArrow | token::Token::Pound | token::Token::Dollar | diff --git a/src/librustdoc/html/highlight.rs b/src/librustdoc/html/highlight.rs index 5bb06516ac49e..05abddf1a734f 100644 --- a/src/librustdoc/html/highlight.rs +++ b/src/librustdoc/html/highlight.rs @@ -249,7 +249,7 @@ impl<'a> Classifier<'a> { // Miscellaneous, no highlighting. token::Dot | token::DotDot | token::DotDotDot | token::DotDotEq | token::Comma | - token::Semi | token::Colon | token::ModSep | token::LArrow | token::OpenDelim(_) | + token::Semi | token::Colon | token::ModSep | token::OpenDelim(_) | token::CloseDelim(token::Brace) | token::CloseDelim(token::Paren) | token::CloseDelim(token::NoDelim) => Class::None, diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 47da3ee6a6c78..19c3aeb994375 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -1032,10 +1032,6 @@ impl<'a> StringReader<'a> { '<' => { Ok(self.binop(token::Shl)) } - '-' => { - self.bump(); - Ok(token::LArrow) - } _ => { Ok(token::Lt) } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 198aee300301e..1f09911f86d4c 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2140,8 +2140,7 @@ impl<'a> Parser<'a> { let ident = self.parse_path_segment_ident()?; let is_args_start = |token: &token::Token| match *token { - token::Lt | token::BinOp(token::Shl) | token::OpenDelim(token::Paren) - | token::LArrow => true, + token::Lt | token::BinOp(token::Shl) | token::OpenDelim(token::Paren) => true, _ => false, }; let check_args_start = |this: &mut Self| { diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 049fb6cb78b84..d45cb5bd99fa9 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -180,7 +180,6 @@ pub enum Token { Colon, ModSep, RArrow, - LArrow, FatArrow, Pound, Dollar, @@ -455,7 +454,6 @@ impl Token { Eq => Le, Lt => BinOp(Shl), Le => BinOpEq(Shl), - BinOp(Minus) => LArrow, _ => return None, }, Gt => match joint { @@ -501,7 +499,7 @@ impl Token { }, Le | EqEq | Ne | Ge | AndAnd | OrOr | Tilde | BinOpEq(..) | At | DotDotDot | - DotDotEq | Comma | Semi | ModSep | RArrow | LArrow | FatArrow | Pound | Dollar | + DotDotEq | Comma | Semi | ModSep | RArrow | FatArrow | Pound | Dollar | Question | OpenDelim(..) | CloseDelim(..) | Literal(..) | Ident(..) | Lifetime(..) | Interpolated(..) | DocComment(..) | Whitespace | Comment | Shebang(..) | Eof => return None, @@ -546,7 +544,6 @@ impl Token { (&Colon, &Colon) | (&ModSep, &ModSep) | (&RArrow, &RArrow) | - (&LArrow, &LArrow) | (&FatArrow, &FatArrow) | (&Pound, &Pound) | (&Dollar, &Dollar) | diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 4f4f31aba715e..3d435971a212f 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -215,7 +215,6 @@ pub fn token_to_string(tok: &Token) -> String { token::Colon => ":".to_string(), token::ModSep => "::".to_string(), token::RArrow => "->".to_string(), - token::LArrow => "<-".to_string(), token::FatArrow => "=>".to_string(), token::OpenDelim(token::Paren) => "(".to_string(), token::CloseDelim(token::Paren) => ")".to_string(), diff --git a/src/libsyntax_ext/proc_macro_server.rs b/src/libsyntax_ext/proc_macro_server.rs index 09dce77579001..58c5110a4bde9 100644 --- a/src/libsyntax_ext/proc_macro_server.rs +++ b/src/libsyntax_ext/proc_macro_server.rs @@ -135,7 +135,6 @@ impl FromInternal<(TreeAndJoint, &'_ ParseSess, &'_ mut Vec)> Colon => op!(':'), ModSep => op!(':', ':'), RArrow => op!('-', '>'), - LArrow => op!('<', '-'), FatArrow => op!('=', '>'), Pound => op!('#'), Dollar => op!('$'),