]> git.lizzy.rs Git - rust.git/commitdiff
syntax: Remove an obsolete hack from literal comparisons
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Sat, 18 May 2019 19:46:27 +0000 (22:46 +0300)
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Thu, 23 May 2019 09:44:05 +0000 (12:44 +0300)
src/libsyntax/parse/token.rs

index f089fc024fecfded6ee51f9fc2b74b40e8565f2c..fbc27d1999d860a7625649c747aa1840f560689f 100644 (file)
@@ -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 @@ pub fn is_reserved_ident(&self) -> bool {
                                                        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,