Skip to content

Commit

Permalink
Remove Token::LArrow
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed May 18, 2019
1 parent 650c1c3 commit b842b34
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 14 deletions.
1 change: 0 additions & 1 deletion src/librustc/ich/impls_syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/highlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
4 changes: 0 additions & 4 deletions src/libsyntax/parse/lexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1032,10 +1032,6 @@ impl<'a> StringReader<'a> {
'<' => {
Ok(self.binop(token::Shl))
}
'-' => {
self.bump();
Ok(token::LArrow)
}
_ => {
Ok(token::Lt)
}
Expand Down
3 changes: 1 addition & 2 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down
5 changes: 1 addition & 4 deletions src/libsyntax/parse/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ pub enum Token {
Colon,
ModSep,
RArrow,
LArrow,
FatArrow,
Pound,
Dollar,
Expand Down Expand Up @@ -455,7 +454,6 @@ impl Token {
Eq => Le,
Lt => BinOp(Shl),
Le => BinOpEq(Shl),
BinOp(Minus) => LArrow,
_ => return None,
},
Gt => match joint {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -546,7 +544,6 @@ impl Token {
(&Colon, &Colon) |
(&ModSep, &ModSep) |
(&RArrow, &RArrow) |
(&LArrow, &LArrow) |
(&FatArrow, &FatArrow) |
(&Pound, &Pound) |
(&Dollar, &Dollar) |
Expand Down
1 change: 0 additions & 1 deletion src/libsyntax/print/pprust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
1 change: 0 additions & 1 deletion src/libsyntax_ext/proc_macro_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ impl FromInternal<(TreeAndJoint, &'_ ParseSess, &'_ mut Vec<Self>)>
Colon => op!(':'),
ModSep => op!(':', ':'),
RArrow => op!('-', '>'),
LArrow => op!('<', '-'),
FatArrow => op!('=', '>'),
Pound => op!('#'),
Dollar => op!('$'),
Expand Down

0 comments on commit b842b34

Please sign in to comment.