diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-12-11 02:26:31 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-12-19 23:17:54 +0300 |
| commit | f756257fb7a5a6ff9fedd83ef03ed09a34bfef13 (patch) | |
| tree | 337ab0a2892788d508537d4d81d24bb9e5cd12a2 /src/libsyntax/parse/token.rs | |
| parent | 69c66286a9a3240309cc5474478ad0a2186e2bce (diff) | |
| download | rust-f756257fb7a5a6ff9fedd83ef03ed09a34bfef13.tar.gz rust-f756257fb7a5a6ff9fedd83ef03ed09a34bfef13.zip | |
Do not interpret mismatches from pretty-printed `$crate` as token stream invalidation
Diffstat (limited to 'src/libsyntax/parse/token.rs')
| -rw-r--r-- | src/libsyntax/parse/token.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index ed746657459..badcc4ed876 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -633,7 +633,9 @@ impl Token { (&Shebang(a), &Shebang(b)) => a == b, (&Lifetime(a), &Lifetime(b)) => a.name == b.name, - (&Ident(a, b), &Ident(c, d)) => a.name == c.name && b == d, + (&Ident(a, b), &Ident(c, d)) => b == d && (a.name == c.name || + a.name == keywords::DollarCrate.name() || + c.name == keywords::DollarCrate.name()), (&Literal(ref a, b), &Literal(ref c, d)) => { b == d && a.probably_equal_for_proc_macro(c) |
