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-21 01:27:14 +0200
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2020-01-26 17:18:55 +0200
commit75284f8cbdfa17046156528dc3aa5303f8752f97 (patch)
tree1e48804b616c0c6143bc49a7a80d7afb9be08705 /src/librustc_span
parenta7b0aa0675f6e81bdb62e614c020a6862381c98a (diff)
rustc_span: replace MacroBacktrace with ExpnData.
Diffstat (limited to 'src/librustc_span')
-rw-r--r--src/librustc_span/lib.rs20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/librustc_span/lib.rs b/src/librustc_span/lib.rs
index 764312021ef..3f23eb15829 100644
--- a/src/librustc_span/lib.rs
+++ b/src/librustc_span/lib.rs
@@ -445,7 +445,7 @@ impl Span {
         self.ctxt().outer_expn_data().allow_internal_unsafe
     }
 
-    pub fn macro_backtrace(mut self) -> Vec<MacroBacktrace> {
+    pub fn macro_backtrace(mut self) -> Vec<ExpnData> {
         let mut prev_span = DUMMY_SP;
         let mut result = vec![];
         loop {
@@ -455,11 +455,7 @@ impl Span {
             }
             // Don't print recursive invocations.
             if !expn_data.call_site.source_equal(&prev_span) {
-                result.push(MacroBacktrace {
-                    call_site: expn_data.call_site,
-                    macro_decl_name: expn_data.kind.descr(),
-                    def_site_span: expn_data.def_site,
-                });
+                result.push(expn_data.clone());
             }
 
             prev_span = self;
@@ -1501,18 +1497,6 @@ pub struct FileLines {
 pub static SPAN_DEBUG: AtomicRef<fn(Span, &mut fmt::Formatter<'_>) -> fmt::Result> =
     AtomicRef::new(&(default_span_debug as fn(_, &mut fmt::Formatter<'_>) -> _));
 
-#[derive(Debug)]
-pub struct MacroBacktrace {
-    /// span where macro was applied to generate this code
-    pub call_site: Span,
-
-    /// name of macro that was applied (e.g., "foo!" or "#[derive(Eq)]")
-    pub macro_decl_name: String,
-
-    /// span where macro was defined (possibly dummy)
-    pub def_site_span: Span,
-}
-
 // _____________________________________________________________________________
 // SpanLinesError, SpanSnippetError, DistinctSources, MalformedSourceMapPositions
 //