about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-05-18 22:46:27 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-05-23 12:44:05 +0300
commit558559e70f648ff518da5ada726da2f04b617197 (patch)
treee339664c45198178427082e627a9873d320c7ee6 /src/libsyntax/parse
parent9450e7d142f53fc9daad87866cdc7af144013264 (diff)
downloadrust-558559e70f648ff518da5ada726da2f04b617197.tar.gz
rust-558559e70f648ff518da5ada726da2f04b617197.zip
syntax: Remove an obsolete hack from literal comparisons
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/token.rs10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index f089fc024fe..fbc27d1999d 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -110,12 +110,6 @@ impl Lit {
             _ => false,
         }
     }
-
-    // See comments in `Nonterminal::to_tokenstream` for why we care about
-    // *probably* equal here rather than actual equality
-    fn probably_equal_for_proc_macro(&self, other: &Lit) -> bool {
-        mem::discriminant(self) == mem::discriminant(other)
-    }
 }
 
 pub(crate) fn ident_can_begin_expr(ident: ast::Ident, is_raw: bool) -> bool {
@@ -590,9 +584,7 @@ impl Token {
                                                        a.name == kw::DollarCrate ||
                                                        c.name == kw::DollarCrate),
 
-            (&Literal(ref a, b), &Literal(ref c, d)) => {
-                b == d && a.probably_equal_for_proc_macro(c)
-            }
+            (&Literal(a, b), &Literal(c, d)) => b == d && a == c,
 
             (&Interpolated(_), &Interpolated(_)) => false,