From e9348738fca8c88dca6e343702eaa12ffc8df34c Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 18 Apr 2018 19:36:48 -0700 Subject: proc_macro: Stay on the "use the cache" path more Discovered in #50061 we're falling off the "happy path" of using a stringified token stream more often than we should. This was due to the fact that a user-written token like `0xf` is equality-different from the stringified token of `15` (despite being semantically equivalent). This patch updates the call to `eq_unspanned` with an even more awful solution, `probably_equal_for_proc_macro`, which ignores the value of each token and basically only compares the structure of the token stream, assuming that the AST doesn't change just one token at a time. While this is a step towards fixing #50061 there is still one regression from #49154 which needs to be fixed. --- src/test/compile-fail-fulldeps/proc-macro/attribute-with-error.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/test') diff --git a/src/test/compile-fail-fulldeps/proc-macro/attribute-with-error.rs b/src/test/compile-fail-fulldeps/proc-macro/attribute-with-error.rs index 00a27818327..edfedebf870 100644 --- a/src/test/compile-fail-fulldeps/proc-macro/attribute-with-error.rs +++ b/src/test/compile-fail-fulldeps/proc-macro/attribute-with-error.rs @@ -21,6 +21,8 @@ use attribute_with_error::foo; fn test1() { let a: i32 = "foo"; //~^ ERROR: mismatched types + let b: i32 = "f'oo"; + //~^ ERROR: mismatched types } fn test2() { -- cgit 1.4.1-3-g733a5