Ignore non-semantic tokens for 'probably_eq' streams.

This commit is contained in:
Sergio Benitez 2018-11-16 23:37:23 -08:00
parent 4ec0ba9545
commit 78eb516dda
5 changed files with 141 additions and 6 deletions

View file

@ -570,8 +570,9 @@ impl Token {
//
// Instead the "probably equal" check here is "does each token
// recursively have the same discriminant?" We basically don't look at
// the token values here and assume that such fine grained modifications
// of token streams doesn't happen.
// the token values here and assume that such fine grained token stream
// modifications, including adding/removing typically non-semantic
// tokens such as extra braces and commas, don't happen.
if let Some(tokens) = tokens {
if tokens.probably_equal_for_proc_macro(&tokens_for_real) {
return tokens