diff options
| author | bors <bors@rust-lang.org> | 2016-09-19 08:32:05 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-19 08:32:05 -0700 |
| commit | 412a6377046ac17cdb63d03860aec7bca85e7846 (patch) | |
| tree | 6a8c4bf4d252ab98ab0d3025363ef24b7d31c2fd | |
| parent | 5f6f8384484382aeec5e1f647e18d37992966425 (diff) | |
| parent | 4715985b07184c3027456bdea74e9fde639b9bcc (diff) | |
| download | rust-412a6377046ac17cdb63d03860aec7bca85e7846.tar.gz rust-412a6377046ac17cdb63d03860aec7bca85e7846.zip | |
Auto merge of #36471 - nnethercote:rm-to_binop, r=sanxiyn
Remove unused Token::to_binop function Just some dead code removal.
| -rw-r--r-- | src/libsyntax/parse/token.rs | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index ff01d375815..09bc5607946 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -14,7 +14,7 @@ pub use self::DelimToken::*; pub use self::Lit::*; pub use self::Token::*; -use ast::{self, BinOpKind}; +use ast::{self}; use ptr::P; use util::interner::Interner; use tokenstream; @@ -258,31 +258,6 @@ impl Token { self.is_path_segment_keyword() || self.is_ident() && !self.is_any_keyword() } - /// Maps a token to its corresponding binary operator. - pub fn to_binop(&self) -> Option<BinOpKind> { - match *self { - BinOp(Star) => Some(BinOpKind::Mul), - BinOp(Slash) => Some(BinOpKind::Div), - BinOp(Percent) => Some(BinOpKind::Rem), - BinOp(Plus) => Some(BinOpKind::Add), - BinOp(Minus) => Some(BinOpKind::Sub), - BinOp(Shl) => Some(BinOpKind::Shl), - BinOp(Shr) => Some(BinOpKind::Shr), - BinOp(And) => Some(BinOpKind::BitAnd), - BinOp(Caret) => Some(BinOpKind::BitXor), - BinOp(Or) => Some(BinOpKind::BitOr), - Lt => Some(BinOpKind::Lt), - Le => Some(BinOpKind::Le), - Ge => Some(BinOpKind::Ge), - Gt => Some(BinOpKind::Gt), - EqEq => Some(BinOpKind::Eq), - Ne => Some(BinOpKind::Ne), - AndAnd => Some(BinOpKind::And), - OrOr => Some(BinOpKind::Or), - _ => None, - } - } - /// Returns `true` if the token is a given keyword, `kw`. pub fn is_keyword(&self, kw: keywords::Keyword) -> bool { match *self { |
