Skip to content

Commit

Permalink
Rollup merge of #56438 - yui-knk:remove_not_used_DotEq_token, r=petro…
Browse files Browse the repository at this point in the history
…chenkov

Remove not used `DotEq` token

Currently libproc_macro does not use `DotEq` token.
#49545 changed libproc_macro
to not generate `DotEq` token.
  • Loading branch information
kennytm authored Dec 3, 2018
2 parents 21433f2 + 96bf06b commit ac363d8
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 9 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 @@ -314,7 +314,6 @@ fn hash_token<'a, 'gcx, W: StableHasherResult>(
token::Token::DotDot |
token::Token::DotDotDot |
token::Token::DotDotEq |
token::Token::DotEq |
token::Token::Comma |
token::Token::Semi |
token::Token::Colon |
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 @@ -346,7 +346,7 @@ impl<'a> Classifier<'a> {
token::Lifetime(..) => Class::Lifetime,

token::Eof | token::Interpolated(..) |
token::Tilde | token::At | token::DotEq | token::SingleQuote => Class::None,
token::Tilde | token::At| token::SingleQuote => Class::None,
};

// Anything that didn't return above is the simple case where we the
Expand Down
1 change: 0 additions & 1 deletion src/libsyntax/ext/quote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,6 @@ fn expr_mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> P<ast::Expr> {
token::At => "At",
token::Dot => "Dot",
token::DotDot => "DotDot",
token::DotEq => "DotEq",
token::DotDotDot => "DotDotDot",
token::DotDotEq => "DotDotEq",
token::Comma => "Comma",
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 @@ -163,7 +163,6 @@ pub enum Token {
DotDot,
DotDotDot,
DotDotEq,
DotEq, // HACK(durka42) never produced by the parser, only used for libproc_macro
Comma,
Semi,
Colon,
Expand Down Expand Up @@ -454,7 +453,6 @@ impl Token {
Dot => match joint {
Dot => DotDot,
DotDot => DotDotDot,
DotEq => DotDotEq,
_ => return None,
},
DotDot => match joint {
Expand All @@ -477,7 +475,7 @@ impl Token {
_ => return None,
},

Le | EqEq | Ne | Ge | AndAnd | OrOr | Tilde | BinOpEq(..) | At | DotDotDot | DotEq |
Le | EqEq | Ne | Ge | AndAnd | OrOr | Tilde | BinOpEq(..) | At | DotDotDot |
DotDotEq | Comma | Semi | ModSep | RArrow | LArrow | FatArrow | Pound | Dollar |
Question | OpenDelim(..) | CloseDelim(..) => return None,

Expand Down Expand Up @@ -606,7 +604,6 @@ impl Token {
(&DotDot, &DotDot) |
(&DotDotDot, &DotDotDot) |
(&DotDotEq, &DotDotEq) |
(&DotEq, &DotEq) |
(&Comma, &Comma) |
(&Semi, &Semi) |
(&Colon, &Colon) |
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 @@ -210,7 +210,6 @@ pub fn token_to_string(tok: &Token) -> String {
token::DotDot => "..".to_string(),
token::DotDotDot => "...".to_string(),
token::DotDotEq => "..=".to_string(),
token::DotEq => ".=".to_string(),
token::Comma => ",".to_string(),
token::Semi => ";".to_string(),
token::Colon => ":".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 @@ -213,7 +213,6 @@ impl FromInternal<(TokenStream, &'_ ParseSess, &'_ mut Vec<Self>)>
})
}

DotEq => op!('.', '='),
OpenDelim(..) | CloseDelim(..) => unreachable!(),
Whitespace | Comment | Shebang(..) | Eof => unreachable!(),
}
Expand Down

0 comments on commit ac363d8

Please sign in to comment.