Skip to content

Commit 558559e

Browse files
committed
syntax: Remove an obsolete hack from literal comparisons
1 parent 9450e7d commit 558559e

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/libsyntax/parse/token.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,6 @@ impl Lit {
110110
_ => false,
111111
}
112112
}
113-
114-
// See comments in `Nonterminal::to_tokenstream` for why we care about
115-
// *probably* equal here rather than actual equality
116-
fn probably_equal_for_proc_macro(&self, other: &Lit) -> bool {
117-
mem::discriminant(self) == mem::discriminant(other)
118-
}
119113
}
120114

121115
pub(crate) fn ident_can_begin_expr(ident: ast::Ident, is_raw: bool) -> bool {
@@ -590,9 +584,7 @@ impl Token {
590584
a.name == kw::DollarCrate ||
591585
c.name == kw::DollarCrate),
592586

593-
(&Literal(ref a, b), &Literal(ref c, d)) => {
594-
b == d && a.probably_equal_for_proc_macro(c)
595-
}
587+
(&Literal(a, b), &Literal(c, d)) => b == d && a == c,
596588

597589
(&Interpolated(_), &Interpolated(_)) => false,
598590

0 commit comments

Comments
 (0)