about summary refs log tree commit diff
path: root/src/librustc_span
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2020-01-20 22:22:36 +0200
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2020-01-26 17:18:54 +0200
commit787c458eeb20e447989124e2900e02e8e03b1c51 (patch)
treef1da3ae15f2fcdd0ed5052c1ff66989e01c87997 /src/librustc_span
parent698fcd38fa9548e64a2092ff48c9d15ceb57d40c (diff)
Don't use ExpnKind::descr to get the name of a bang macro.
Diffstat (limited to 'src/librustc_span')
-rw-r--r--src/librustc_span/hygiene.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/librustc_span/hygiene.rs b/src/librustc_span/hygiene.rs
index fd1f07c743b..366201d66c4 100644
--- a/src/librustc_span/hygiene.rs
+++ b/src/librustc_span/hygiene.rs
@@ -140,7 +140,9 @@ impl ExpnId {
         loop {
             let expn_data = self.expn_data();
             // Stop going up the backtrace once include! is encountered
-            if expn_data.is_root() || expn_data.kind.descr() == sym::include {
+            if expn_data.is_root()
+                || expn_data.kind == ExpnKind::Macro(MacroKind::Bang, sym::include)
+            {
                 break;
             }
             self = expn_data.call_site.ctxt().outer_expn();
@@ -717,7 +719,7 @@ impl ExpnData {
 }
 
 /// Expansion kind.
-#[derive(Clone, Debug, RustcEncodable, RustcDecodable, HashStable_Generic)]
+#[derive(Clone, Debug, PartialEq, RustcEncodable, RustcDecodable, HashStable_Generic)]
 pub enum ExpnKind {
     /// No expansion, aka root expansion. Only `ExpnId::root()` has this kind.
     Root,