]> git.lizzy.rs Git - rust.git/commitdiff
hygiene: `ExpnInfo` -> `ExpnData`
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Tue, 13 Aug 2019 20:56:42 +0000 (23:56 +0300)
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Thu, 15 Aug 2019 17:41:45 +0000 (20:41 +0300)
For naming consistency with everything else in this area

25 files changed:
src/librustc/hir/lowering.rs
src/librustc/ich/hcx.rs
src/librustc/ich/impls_syntax.rs
src/librustc/lint/internal.rs
src/librustc/lint/mod.rs
src/librustc/traits/error_reporting.rs
src/librustc/ty/query/on_disk_cache.rs
src/librustc_codegen_ssa/back/write.rs
src/librustc_lint/unused.rs
src/librustc_resolve/macros.rs
src/libsyntax/ext/base.rs
src/libsyntax/ext/expand.rs
src/libsyntax/ext/proc_macro_server.rs
src/libsyntax/parse/mod.rs
src/libsyntax/source_map.rs
src/libsyntax_ext/deriving/clone.rs
src/libsyntax_ext/deriving/cmp/eq.rs
src/libsyntax_ext/deriving/cmp/partial_eq.rs
src/libsyntax_ext/deriving/generic/mod.rs
src/libsyntax_ext/plugin_macro_defs.rs
src/libsyntax_ext/proc_macro_harness.rs
src/libsyntax_ext/standard_library_imports.rs
src/libsyntax_ext/test_harness.rs
src/libsyntax_pos/hygiene.rs
src/libsyntax_pos/lib.rs

index 8c1ce5983b8c5eb77f8a80352ffff4f2d9ad510c..0f6e834ca26df730518044e7c615e0ed91808b86 100644 (file)
@@ -67,7 +67,7 @@
 use syntax::ext::base::SpecialDerives;
 use syntax::ext::hygiene::ExpnId;
 use syntax::print::pprust;
-use syntax::source_map::{respan, ExpnInfo, ExpnKind, DesugaringKind, Spanned};
+use syntax::source_map::{respan, ExpnData, ExpnKind, DesugaringKind, Spanned};
 use syntax::symbol::{kw, sym, Symbol};
 use syntax::tokenstream::{TokenStream, TokenTree};
 use syntax::parse::token::{self, Token};
@@ -704,9 +704,9 @@ fn mark_span_with_reason(
         span: Span,
         allow_internal_unstable: Option<Lrc<[Symbol]>>,
     ) -> Span {
-        span.fresh_expansion(ExpnInfo {
+        span.fresh_expansion(ExpnData {
             allow_internal_unstable,
-            ..ExpnInfo::default(ExpnKind::Desugaring(reason), span, self.sess.edition())
+            ..ExpnData::default(ExpnKind::Desugaring(reason), span, self.sess.edition())
         })
     }
 
index 39f6b0d434440abfa7429406bd8f9bad07108979..e77faea1e4c5855989ae6bf152c21b0af25510a3 100644 (file)
@@ -370,7 +370,7 @@ fn hash_stable<W: StableHasherResult>(&self,
                 }
 
                 let mut hasher = StableHasher::new();
-                expn_id.expn_info().hash_stable(hcx, &mut hasher);
+                expn_id.expn_data().hash_stable(hcx, &mut hasher);
                 let sub_hash: Fingerprint = hasher.finish();
                 let sub_hash = sub_hash.to_smaller_hash();
                 cache.borrow_mut().insert(expn_id, sub_hash);
index 22e2cff359520f8828fe3d47d993107c4c7a8b18..7003f71c8baa06ae1e02e8f3946b9d4d141d6e80 100644 (file)
@@ -397,7 +397,7 @@ fn hash_stable<W: StableHasherResult>(&self,
     Opaque,
 });
 
-impl_stable_hash_for!(struct ::syntax_pos::hygiene::ExpnInfo {
+impl_stable_hash_for!(struct ::syntax_pos::hygiene::ExpnData {
     kind,
     parent -> _,
     call_site,
index 29106fe000bb62986a3e4258fd662338d0b16f56..be73b305e2c50bd56d68f1c8b2cf9a1143e0556c 100644 (file)
@@ -227,10 +227,10 @@ fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
         if let ItemKind::Impl(_, _, _, _, Some(lint_pass), _, _) = &item.node {
             if let Some(last) = lint_pass.path.segments.last() {
                 if last.ident.name == sym::LintPass {
-                    let expn_info = lint_pass.path.span.ctxt().outer_expn_info();
-                    let call_site = expn_info.call_site;
-                    if expn_info.kind.descr() != sym::impl_lint_pass &&
-                       call_site.ctxt().outer_expn_info().kind.descr() != sym::declare_lint_pass {
+                    let expn_data = lint_pass.path.span.ctxt().outer_expn_data();
+                    let call_site = expn_data.call_site;
+                    if expn_data.kind.descr() != sym::impl_lint_pass &&
+                       call_site.ctxt().outer_expn_data().kind.descr() != sym::declare_lint_pass {
                         cx.struct_span_lint(
                             LINT_PASS_IMPL_WITHOUT_MACRO,
                             lint_pass.path.span,
index 3729ee81f5c6524103e5ea32d6f894a62c70e948..2b58627cdea563544c5d24a958ea88dd74a0aa28 100644 (file)
@@ -885,16 +885,16 @@ pub fn provide(providers: &mut Providers<'_>) {
 /// This is used to test whether a lint should not even begin to figure out whether it should
 /// be reported on the current node.
 pub fn in_external_macro(sess: &Session, span: Span) -> bool {
-    let expn_info = span.ctxt().outer_expn_info();
-    match expn_info.kind {
+    let expn_data = span.ctxt().outer_expn_data();
+    match expn_data.kind {
         ExpnKind::Root | ExpnKind::Desugaring(DesugaringKind::ForLoop) => false,
         ExpnKind::Desugaring(_) => true, // well, it's "external"
         ExpnKind::Macro(MacroKind::Bang, _) => {
-            if expn_info.def_site.is_dummy() {
+            if expn_data.def_site.is_dummy() {
                 // dummy span for the def_site means it's an external macro
                 return true;
             }
-            match sess.source_map().span_to_snippet(expn_info.def_site) {
+            match sess.source_map().span_to_snippet(expn_data.def_site) {
                 Ok(code) => !code.starts_with("macro_rules"),
                 // no snippet = external macro or compiler-builtin expansion
                 Err(_) => true,
@@ -906,7 +906,7 @@ pub fn in_external_macro(sess: &Session, span: Span) -> bool {
 
 /// Returns whether `span` originates in a derive macro's expansion
 pub fn in_derive_expansion(span: Span) -> bool {
-    if let ExpnKind::Macro(MacroKind::Derive, _) = span.ctxt().outer_expn_info().kind {
+    if let ExpnKind::Macro(MacroKind::Derive, _) = span.ctxt().outer_expn_data().kind {
         return true;
     }
     false
index 20568d4709b64b2e6faf726b1cc80284058c93a9..ba92e851141a655cd929964c0a9d8b29096f39b8 100644 (file)
@@ -61,9 +61,9 @@ struct ErrorDescriptor<'tcx> {
             // We want to ignore desugarings here: spans are equivalent even
             // if one is the result of a desugaring and the other is not.
             let mut span = error.obligation.cause.span;
-            let expn_info = span.ctxt().outer_expn_info();
-            if let ExpnKind::Desugaring(_) = expn_info.kind {
-                span = expn_info.call_site;
+            let expn_data = span.ctxt().outer_expn_data();
+            if let ExpnKind::Desugaring(_) = expn_data.kind {
+                span = expn_data.call_site;
             }
 
             error_map.entry(span).or_default().push(
index 351b9988bb25c3603cda821213c921e0a9703eac..8bf01970eb592f13464fd43efc6a3f8c6e788ee1 100644 (file)
 use syntax::ast::NodeId;
 use syntax::source_map::{SourceMap, StableSourceFileId};
 use syntax_pos::{BytePos, Span, DUMMY_SP, SourceFile};
-use syntax_pos::hygiene::{ExpnId, SyntaxContext, ExpnInfo};
+use syntax_pos::hygiene::{ExpnId, SyntaxContext, ExpnData};
 
 const TAG_FILE_FOOTER: u128 = 0xC0FFEE_C0FFEE_C0FFEE_C0FFEE_C0FFEE;
 
 const TAG_CLEAR_CROSS_CRATE_CLEAR: u8 = 0;
 const TAG_CLEAR_CROSS_CRATE_SET: u8 = 1;
 
-const TAG_NO_EXPANSION_INFO: u8 = 0;
-const TAG_EXPANSION_INFO_SHORTHAND: u8 = 1;
-const TAG_EXPANSION_INFO_INLINE: u8 = 2;
+const TAG_NO_EXPN_DATA: u8 = 0;
+const TAG_EXPN_DATA_SHORTHAND: u8 = 1;
+const TAG_EXPN_DATA_INLINE: u8 = 2;
 
 const TAG_VALID_SPAN: u8 = 0;
 const TAG_INVALID_SPAN: u8 = 1;
@@ -58,7 +58,7 @@ pub struct OnDiskCache<'sess> {
 
     // These two fields caches that are populated lazily during decoding.
     file_index_to_file: Lock<FxHashMap<SourceFileIndex, Lrc<SourceFile>>>,
-    synthetic_expansion_infos: Lock<FxHashMap<AbsoluteBytePos, SyntaxContext>>,
+    synthetic_syntax_contexts: Lock<FxHashMap<AbsoluteBytePos, SyntaxContext>>,
 
     // A map from dep-node to the position of the cached query result in
     // `serialized_data`.
@@ -135,7 +135,7 @@ pub fn new(sess: &'sess Session, data: Vec<u8>, start_pos: usize) -> OnDiskCache
             current_diagnostics: Default::default(),
             query_result_index: footer.query_result_index.into_iter().collect(),
             prev_diagnostics_index: footer.diagnostics_index.into_iter().collect(),
-            synthetic_expansion_infos: Default::default(),
+            synthetic_syntax_contexts: Default::default(),
             alloc_decoding_state: AllocDecodingState::new(footer.interpret_alloc_index),
         }
     }
@@ -151,7 +151,7 @@ pub fn new_empty(source_map: &'sess SourceMap) -> OnDiskCache<'sess> {
             current_diagnostics: Default::default(),
             query_result_index: Default::default(),
             prev_diagnostics_index: Default::default(),
-            synthetic_expansion_infos: Default::default(),
+            synthetic_syntax_contexts: Default::default(),
             alloc_decoding_state: AllocDecodingState::new(Vec::new()),
         }
     }
@@ -185,7 +185,7 @@ pub fn serialize<'tcx, E>(&self, tcx: TyCtxt<'tcx>, encoder: &mut E) -> Result<(
                 encoder,
                 type_shorthands: Default::default(),
                 predicate_shorthands: Default::default(),
-                expn_info_shorthands: Default::default(),
+                expn_data_shorthands: Default::default(),
                 interpret_allocs: Default::default(),
                 interpret_allocs_inverse: Vec::new(),
                 source_map: CachingSourceMapView::new(tcx.sess.source_map()),
@@ -383,7 +383,7 @@ fn load_indexed<'tcx, T>(
             cnum_map: self.cnum_map.get(),
             file_index_to_file: &self.file_index_to_file,
             file_index_to_stable_id: &self.file_index_to_stable_id,
-            synthetic_expansion_infos: &self.synthetic_expansion_infos,
+            synthetic_syntax_contexts: &self.synthetic_syntax_contexts,
             alloc_decoding_session: self.alloc_decoding_state.new_decoding_session(),
         };
 
@@ -440,7 +440,7 @@ struct CacheDecoder<'a, 'tcx> {
     opaque: opaque::Decoder<'a>,
     source_map: &'a SourceMap,
     cnum_map: &'a IndexVec<CrateNum, Option<CrateNum>>,
-    synthetic_expansion_infos: &'a Lock<FxHashMap<AbsoluteBytePos, SyntaxContext>>,
+    synthetic_syntax_contexts: &'a Lock<FxHashMap<AbsoluteBytePos, SyntaxContext>>,
     file_index_to_file: &'a Lock<FxHashMap<SourceFileIndex, Lrc<SourceFile>>>,
     file_index_to_stable_id: &'a FxHashMap<SourceFileIndex, StableSourceFileId>,
     alloc_decoding_session: AllocDecodingSession<'a>,
@@ -586,37 +586,37 @@ fn specialized_decode(&mut self) -> Result<Span, Self::Error> {
         let lo = file_lo.lines[line_lo - 1] + col_lo;
         let hi = lo + len;
 
-        let expn_info_tag = u8::decode(self)?;
+        let expn_data_tag = u8::decode(self)?;
 
-        // FIXME(mw): This method does not restore `ExpnInfo::parent` or
+        // FIXME(mw): This method does not restore `ExpnData::parent` or
         // `SyntaxContextData::prev_ctxt` or `SyntaxContextData::opaque`. These things
         // don't seem to be used after HIR lowering, so everything should be fine
         // as long as incremental compilation does not kick in before that.
         let location = || Span::with_root_ctxt(lo, hi);
-        let recover_from_expn_info = |this: &Self, expn_info, pos| {
-            let span = location().fresh_expansion(expn_info);
-            this.synthetic_expansion_infos.borrow_mut().insert(pos, span.ctxt());
+        let recover_from_expn_data = |this: &Self, expn_data, pos| {
+            let span = location().fresh_expansion(expn_data);
+            this.synthetic_syntax_contexts.borrow_mut().insert(pos, span.ctxt());
             span
         };
-        Ok(match expn_info_tag {
-            TAG_NO_EXPANSION_INFO => {
+        Ok(match expn_data_tag {
+            TAG_NO_EXPN_DATA => {
                 location()
             }
-            TAG_EXPANSION_INFO_INLINE => {
-                let expn_info = Decodable::decode(self)?;
-                recover_from_expn_info(
-                    self, expn_info, AbsoluteBytePos::new(self.opaque.position())
+            TAG_EXPN_DATA_INLINE => {
+                let expn_data = Decodable::decode(self)?;
+                recover_from_expn_data(
+                    self, expn_data, AbsoluteBytePos::new(self.opaque.position())
                 )
             }
-            TAG_EXPANSION_INFO_SHORTHAND => {
+            TAG_EXPN_DATA_SHORTHAND => {
                 let pos = AbsoluteBytePos::decode(self)?;
-                let cached_ctxt = self.synthetic_expansion_infos.borrow().get(&pos).cloned();
+                let cached_ctxt = self.synthetic_syntax_contexts.borrow().get(&pos).cloned();
                 if let Some(ctxt) = cached_ctxt {
                     Span::new(lo, hi, ctxt)
                 } else {
-                    let expn_info =
-                        self.with_position(pos.to_usize(), |this| ExpnInfo::decode(this))?;
-                    recover_from_expn_info(self, expn_info, pos)
+                    let expn_data =
+                        self.with_position(pos.to_usize(), |this| ExpnData::decode(this))?;
+                    recover_from_expn_data(self, expn_data, pos)
                 }
             }
             _ => {
@@ -725,7 +725,7 @@ struct CacheEncoder<'a, 'tcx, E: ty_codec::TyEncoder> {
     encoder: &'a mut E,
     type_shorthands: FxHashMap<Ty<'tcx>, usize>,
     predicate_shorthands: FxHashMap<ty::Predicate<'tcx>, usize>,
-    expn_info_shorthands: FxHashMap<ExpnId, AbsoluteBytePos>,
+    expn_data_shorthands: FxHashMap<ExpnId, AbsoluteBytePos>,
     interpret_allocs: FxHashMap<interpret::AllocId, usize>,
     interpret_allocs_inverse: Vec<interpret::AllocId>,
     source_map: CachingSourceMapView<'tcx>,
@@ -817,17 +817,17 @@ fn specialized_encode(&mut self, span: &Span) -> Result<(), Self::Error> {
         len.encode(self)?;
 
         if span_data.ctxt == SyntaxContext::root() {
-            TAG_NO_EXPANSION_INFO.encode(self)
+            TAG_NO_EXPN_DATA.encode(self)
         } else {
-            let (expn_id, expn_info) = span_data.ctxt.outer_expn_with_info();
-            if let Some(pos) = self.expn_info_shorthands.get(&expn_id).cloned() {
-                TAG_EXPANSION_INFO_SHORTHAND.encode(self)?;
+            let (expn_id, expn_data) = span_data.ctxt.outer_expn_with_data();
+            if let Some(pos) = self.expn_data_shorthands.get(&expn_id).cloned() {
+                TAG_EXPN_DATA_SHORTHAND.encode(self)?;
                 pos.encode(self)
             } else {
-                TAG_EXPANSION_INFO_INLINE.encode(self)?;
+                TAG_EXPN_DATA_INLINE.encode(self)?;
                 let pos = AbsoluteBytePos::new(self.position());
-                self.expn_info_shorthands.insert(expn_id, pos);
-                expn_info.encode(self)
+                self.expn_data_shorthands.insert(expn_id, pos);
+                expn_data.encode(self)
             }
         }
     }
index 240264a98220d85e267e1a1db26e3fd19fab990a..eec098426239c4550301a065bc5e3ad0d41aac7b 100644 (file)
@@ -1775,7 +1775,7 @@ pub fn check(&self, sess: &Session, blocking: bool) {
                     }
                 }
                 Ok(SharedEmitterMessage::InlineAsmError(cookie, msg)) => {
-                    sess.span_err(ExpnId::from_u32(cookie).expn_info().call_site, &msg)
+                    sess.span_err(ExpnId::from_u32(cookie).expn_data().call_site, &msg)
                 }
                 Ok(SharedEmitterMessage::AbortIfErrors) => {
                     sess.abort_if_errors();
index 1bb05bda69f5b09f3d75265f5fad7da05af710fb..90e467713968bd07fdfc31f47ec2239453deebaa 100644 (file)
@@ -517,7 +517,7 @@ fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &ast::Expr) {
                 // trigger in situations that macro authors shouldn't have to care about, e.g.,
                 // when a parenthesized token tree matched in one macro expansion is matched as
                 // an expression in another and used as a fn/method argument (Issue #47775)
-                if e.span.ctxt().outer_expn_info().call_site.from_expansion() {
+                if e.span.ctxt().outer_expn_data().call_site.from_expansion() {
                     return;
                 }
                 let msg = format!("{} argument", call_kind);
index 58e785ab8c25327d9522fae60ba7ccfa851e13b7..2ca8771cda6a1049e2e855b6366de6097813e203 100644 (file)
@@ -17,7 +17,7 @@
 use syntax::ext::base::{self, Indeterminate, SpecialDerives};
 use syntax::ext::base::{MacroKind, SyntaxExtension};
 use syntax::ext::expand::{AstFragment, Invocation, InvocationKind};
-use syntax::ext::hygiene::{self, ExpnId, ExpnInfo, ExpnKind};
+use syntax::ext::hygiene::{self, ExpnId, ExpnData, ExpnKind};
 use syntax::ext::tt::macro_rules;
 use syntax::feature_gate::{emit_feature_err, is_builtin_attr_name};
 use syntax::feature_gate::GateIssue;
@@ -97,7 +97,7 @@ fn next_node_id(&mut self) -> ast::NodeId {
     }
 
     fn get_module_scope(&mut self, id: ast::NodeId) -> ExpnId {
-        let expn_id = ExpnId::fresh(Some(ExpnInfo::default(
+        let expn_id = ExpnId::fresh(Some(ExpnData::default(
             ExpnKind::Macro(MacroKind::Attr, sym::test_case), DUMMY_SP, self.session.edition()
         )));
         let module = self.module_map[&self.definitions.local_def_id(id)];
@@ -185,8 +185,8 @@ fn resolve_macro_invocation(&mut self, invoc: &Invocation, invoc_id: ExpnId, for
         let (ext, res) = self.smart_resolve_macro_path(path, kind, parent_scope, force)?;
 
         let span = invoc.span();
-        invoc.expansion_data.id.set_expn_info(
-            ext.expn_info(parent_scope.expansion, span, fast_print_path(path))
+        invoc.expansion_data.id.set_expn_data(
+            ext.expn_data(parent_scope.expansion, span, fast_print_path(path))
         );
 
         if let Res::Def(_, def_id) = res {
@@ -302,7 +302,7 @@ pub fn resolve_macro_path(
 
         // Possibly apply the macro helper hack
         if kind == Some(MacroKind::Bang) && path.len() == 1 &&
-           path[0].ident.span.ctxt().outer_expn_info().local_inner_macros {
+           path[0].ident.span.ctxt().outer_expn_data().local_inner_macros {
             let root = Ident::new(kw::DollarCrate, path[0].ident.span);
             path.insert(0, Segment::from_ident(root));
         }
index 734b566b3ad1d5bd820aacc6aabd5612800d8393..fb1bf4d7160e7e2ed7e576fa808a3d8699ee1e69 100644 (file)
@@ -15,7 +15,7 @@
 use errors::{DiagnosticBuilder, DiagnosticId};
 use smallvec::{smallvec, SmallVec};
 use syntax_pos::{FileName, Span, MultiSpan, DUMMY_SP};
-use syntax_pos::hygiene::{ExpnInfo, ExpnKind};
+use syntax_pos::hygiene::{ExpnData, ExpnKind};
 
 use rustc_data_structures::fx::FxHashMap;
 use rustc_data_structures::sync::{self, Lrc};
@@ -640,8 +640,8 @@ pub fn non_macro_attr(mark_used: bool, edition: Edition) -> SyntaxExtension {
         SyntaxExtension::default(SyntaxExtensionKind::NonMacroAttr { mark_used }, edition)
     }
 
-    pub fn expn_info(&self, parent: ExpnId, call_site: Span, descr: Symbol) -> ExpnInfo {
-        ExpnInfo {
+    pub fn expn_data(&self, parent: ExpnId, call_site: Span, descr: Symbol) -> ExpnData {
+        ExpnData {
             kind: ExpnKind::Macro(self.macro_kind(), descr),
             parent,
             call_site,
@@ -708,7 +708,7 @@ pub struct ExpansionData {
 
 /// One of these is made during expansion and incrementally updated as we go;
 /// when a macro expansion occurs, the resulting nodes have the `backtrace()
-/// -> expn_info` of their expansion context stored into their span.
+/// -> expn_data` of their expansion context stored into their span.
 pub struct ExtCtxt<'a> {
     pub parse_sess: &'a parse::ParseSess,
     pub ecfg: expand::ExpansionConfig<'a>,
@@ -757,7 +757,7 @@ pub fn source_map(&self) -> &'a SourceMap { self.parse_sess.source_map() }
     pub fn parse_sess(&self) -> &'a parse::ParseSess { self.parse_sess }
     pub fn cfg(&self) -> &ast::CrateConfig { &self.parse_sess.config }
     pub fn call_site(&self) -> Span {
-        self.current_expansion.id.expn_info().call_site
+        self.current_expansion.id.expn_data().call_site
     }
     pub fn backtrace(&self) -> SyntaxContext {
         SyntaxContext::root().apply_mark(self.current_expansion.id)
@@ -770,13 +770,13 @@ pub fn expansion_cause(&self) -> Option<Span> {
         let mut ctxt = self.backtrace();
         let mut last_macro = None;
         loop {
-            let expn_info = ctxt.outer_expn_info();
+            let expn_data = ctxt.outer_expn_data();
             // Stop going up the backtrace once include! is encountered
-            if expn_info.is_root() || expn_info.kind.descr() == sym::include {
+            if expn_data.is_root() || expn_data.kind.descr() == sym::include {
                 break;
             }
-            ctxt = expn_info.call_site.ctxt();
-            last_macro = Some(expn_info.call_site);
+            ctxt = expn_data.call_site.ctxt();
+            last_macro = Some(expn_data.call_site);
         }
         last_macro
     }
index 4233d5c0a222efcafb6a5ee64bce52362832235e..e7deadbc9a043d0d9c5ee652efe1b8a035872f2e 100644 (file)
@@ -5,7 +5,7 @@
 use crate::config::StripUnconfigured;
 use crate::ext::base::*;
 use crate::ext::proc_macro::collect_derives;
-use crate::ext::hygiene::{ExpnId, SyntaxContext, ExpnInfo, ExpnKind};
+use crate::ext::hygiene::{ExpnId, SyntaxContext, ExpnData, ExpnKind};
 use crate::ext::tt::macro_rules::annotate_err_with_kind;
 use crate::ext::placeholders::{placeholder, PlaceholderExpander};
 use crate::feature_gate::{self, Features, GateIssue, is_builtin_attr, emit_feature_err};
@@ -475,11 +475,11 @@ fn expand_invoc(&mut self, invoc: Invocation, ext: &SyntaxExtensionKind) -> AstF
         }
 
         if self.cx.current_expansion.depth > self.cx.ecfg.recursion_limit {
-            let info = self.cx.current_expansion.id.expn_info();
+            let expn_data = self.cx.current_expansion.id.expn_data();
             let suggested_limit = self.cx.ecfg.recursion_limit * 2;
-            let mut err = self.cx.struct_span_err(info.call_site,
+            let mut err = self.cx.struct_span_err(expn_data.call_site,
                 &format!("recursion limit reached while expanding the macro `{}`",
-                         info.kind.descr()));
+                         expn_data.kind.descr()));
             err.help(&format!(
                 "consider adding a `#![recursion_limit=\"{}\"]` attribute to your crate",
                 suggested_limit));
@@ -796,20 +796,20 @@ struct InvocationCollector<'a, 'b> {
 
 impl<'a, 'b> InvocationCollector<'a, 'b> {
     fn collect(&mut self, fragment_kind: AstFragmentKind, kind: InvocationKind) -> AstFragment {
-        // Expansion info for all the collected invocations is set upon their resolution,
+        // Expansion data for all the collected invocations is set upon their resolution,
         // with exception of the derive container case which is not resolved and can get
-        // its expansion info immediately.
-        let expn_info = match &kind {
-            InvocationKind::DeriveContainer { item, .. } => Some(ExpnInfo {
+        // its expansion data immediately.
+        let expn_data = match &kind {
+            InvocationKind::DeriveContainer { item, .. } => Some(ExpnData {
                 parent: self.cx.current_expansion.id,
-                ..ExpnInfo::default(
+                ..ExpnData::default(
                     ExpnKind::Macro(MacroKind::Attr, sym::derive),
                     item.span(), self.cx.parse_sess.edition,
                 )
             }),
             _ => None,
         };
-        let expn_id = ExpnId::fresh(expn_info);
+        let expn_id = ExpnId::fresh(expn_data);
         self.invocations.push(Invocation {
             kind,
             fragment_kind,
index d370431a5daef2f86d98af9e64134c6966d7ddf7..1619fa6994198efb139dcd6d3c9981b3ce7be439 100644 (file)
@@ -362,7 +362,7 @@ pub(crate) struct Rustc<'a> {
 impl<'a> Rustc<'a> {
     pub fn new(cx: &'a ExtCtxt<'_>) -> Self {
         // No way to determine def location for a proc macro right now, so use call location.
-        let location = cx.current_expansion.id.expn_info().call_site;
+        let location = cx.current_expansion.id.expn_data().call_site;
         let to_span = |transparency| {
             location.with_ctxt(
                 SyntaxContext::root()
index a1bcc455eb4cff2899d98d4e9b4aa22da825ecab..26f78b9c5c78441b9089b2942fe1e8a34196120e 100644 (file)
@@ -87,7 +87,7 @@ pub fn with_span_handler(handler: Handler, source_map: Lrc<SourceMap>) -> ParseS
             included_mod_stack: Lock::new(vec![]),
             source_map,
             buffered_lints: Lock::new(vec![]),
-            edition: ExpnId::root().expn_info().edition,
+            edition: ExpnId::root().expn_data().edition,
             ambiguous_block_expr_parse: Lock::new(FxHashMap::default()),
             param_attr_spans: Lock::new(Vec::new()),
             let_chains_spans: Lock::new(Vec::new()),
index da7eb6add41a9927f5a77f06946434045492a1ad..940687cb5d4e447b6f7d3e4ce75092b02424f2e2 100644 (file)
@@ -8,7 +8,7 @@
 //! information, source code snippets, etc.
 
 pub use syntax_pos::*;
-pub use syntax_pos::hygiene::{ExpnKind, ExpnInfo};
+pub use syntax_pos::hygiene::{ExpnKind, ExpnData};
 
 use rustc_data_structures::fx::FxHashMap;
 use rustc_data_structures::stable_hasher::StableHasher;
 
 /// Returns the span itself if it doesn't come from a macro expansion,
 /// otherwise return the call site span up to the `enclosing_sp` by
-/// following the `expn_info` chain.
+/// following the `expn_data` chain.
 pub fn original_sp(sp: Span, enclosing_sp: Span) -> Span {
-    let expn_info1 = sp.ctxt().outer_expn_info();
-    let expn_info2 = enclosing_sp.ctxt().outer_expn_info();
-    if expn_info1.is_root() ||
-       !expn_info2.is_root() && expn_info1.call_site == expn_info2.call_site {
+    let expn_data1 = sp.ctxt().outer_expn_data();
+    let expn_data2 = enclosing_sp.ctxt().outer_expn_data();
+    if expn_data1.is_root() ||
+       !expn_data2.is_root() && expn_data1.call_site == expn_data2.call_site {
         sp
     } else {
-        original_sp(expn_info1.call_site, enclosing_sp)
+        original_sp(expn_data1.call_site, enclosing_sp)
     }
 }
 
index 73df625d5ee60eb2f99ed220a203d2512be06558..d030ea4a56ebb8b49ca4657a9a5fd6b0029db336 100644 (file)
@@ -35,7 +35,7 @@ pub fn expand_deriving_clone(cx: &mut ExtCtxt<'_>,
             match annitem.node {
                 ItemKind::Struct(_, Generics { ref params, .. }) |
                 ItemKind::Enum(_, Generics { ref params, .. }) => {
-                    let container_id = cx.current_expansion.id.expn_info().parent;
+                    let container_id = cx.current_expansion.id.expn_data().parent;
                     if cx.resolver.has_derives(container_id, SpecialDerives::COPY) &&
                         !params.iter().any(|param| match param.kind {
                             ast::GenericParamKind::Type { .. } => true,
index 1ef34a680041415e101b17f1035968500c62cd2a..54027c600b4cd714202ff9a6e39b5e1b6d07bf0b 100644 (file)
@@ -13,7 +13,7 @@ pub fn expand_deriving_eq(cx: &mut ExtCtxt<'_>,
                           mitem: &MetaItem,
                           item: &Annotatable,
                           push: &mut dyn FnMut(Annotatable)) {
-    cx.resolver.add_derives(cx.current_expansion.id.expn_info().parent, SpecialDerives::EQ);
+    cx.resolver.add_derives(cx.current_expansion.id.expn_data().parent, SpecialDerives::EQ);
 
     let inline = cx.meta_word(span, sym::inline);
     let hidden = cx.meta_list_item_word(span, sym::hidden);
index 76befc98591ef4bea4f25b0eb73f7022f3db324e..91e1e80e4fbfa1347da4ee6a009eefbd76f66f18 100644 (file)
@@ -13,7 +13,7 @@ pub fn expand_deriving_partial_eq(cx: &mut ExtCtxt<'_>,
                                   mitem: &MetaItem,
                                   item: &Annotatable,
                                   push: &mut dyn FnMut(Annotatable)) {
-    cx.resolver.add_derives(cx.current_expansion.id.expn_info().parent, SpecialDerives::PARTIAL_EQ);
+    cx.resolver.add_derives(cx.current_expansion.id.expn_data().parent, SpecialDerives::PARTIAL_EQ);
 
     // structures are equal if all fields are equal, and non equal, if
     // any fields are not equal or if the enum variants are different
index 6b739e27eee8992c93ce2d7048880bdf16bd3cc3..55fb7677038ba6223b38d05e71dc1d0f38384a5c 100644 (file)
@@ -425,7 +425,7 @@ pub fn expand_ext(self,
                         return;
                     }
                 };
-                let container_id = cx.current_expansion.id.expn_info().parent;
+                let container_id = cx.current_expansion.id.expn_data().parent;
                 let is_always_copy =
                     cx.resolver.has_derives(container_id, SpecialDerives::COPY) &&
                     has_no_type_params;
index b34a250881a314938eed3ead5a394ed2b8dec304..dbfd8fe98f38999c582f1d935de57a54fcc85cd0 100644 (file)
@@ -11,7 +11,7 @@
 use syntax::symbol::sym;
 use syntax::tokenstream::*;
 use syntax_pos::{Span, DUMMY_SP};
-use syntax_pos::hygiene::{ExpnInfo, ExpnKind, MacroKind};
+use syntax_pos::hygiene::{ExpnData, ExpnKind, MacroKind};
 
 use std::mem;
 
@@ -43,7 +43,7 @@ pub fn inject(
 ) {
     if !named_exts.is_empty() {
         let mut extra_items = Vec::new();
-        let span = DUMMY_SP.fresh_expansion(ExpnInfo::allow_unstable(
+        let span = DUMMY_SP.fresh_expansion(ExpnData::allow_unstable(
             ExpnKind::Macro(MacroKind::Attr, sym::plugin), DUMMY_SP, edition,
             [sym::rustc_attrs][..].into(),
         ));
index 9d8a8c17ba2d8ccefd638d06a923b799d8cc1eec..e772eaf834964359b8870fb081390517c48cf262 100644 (file)
@@ -3,7 +3,7 @@
 use smallvec::smallvec;
 use syntax::ast::{self, Ident};
 use syntax::attr;
-use syntax::source_map::{ExpnInfo, ExpnKind, respan};
+use syntax::source_map::{ExpnData, ExpnKind, respan};
 use syntax::ext::base::{ExtCtxt, MacroKind};
 use syntax::ext::expand::{AstFragment, ExpansionConfig};
 use syntax::ext::proc_macro::is_proc_macro_attr;
@@ -327,7 +327,7 @@ fn mk_decls(
     custom_attrs: &[ProcMacroDef],
     custom_macros: &[ProcMacroDef],
 ) -> P<ast::Item> {
-    let span = DUMMY_SP.fresh_expansion(ExpnInfo::allow_unstable(
+    let span = DUMMY_SP.fresh_expansion(ExpnData::allow_unstable(
         ExpnKind::Macro(MacroKind::Attr, sym::proc_macro), DUMMY_SP, cx.parse_sess.edition,
         [sym::rustc_attrs, sym::proc_macro_internals][..].into(),
     ));
index c004124865223df761c3d78511e377fcd0122fa8..8ca376341fcdb7b72f6016c6ddbfa93bfe101f83 100644 (file)
@@ -2,7 +2,7 @@
 use syntax::edition::Edition;
 use syntax::ext::hygiene::MacroKind;
 use syntax::ptr::P;
-use syntax::source_map::{ExpnInfo, ExpnKind, dummy_spanned, respan};
+use syntax::source_map::{ExpnData, ExpnKind, dummy_spanned, respan};
 use syntax::symbol::{Ident, Symbol, kw, sym};
 use syntax_pos::DUMMY_SP;
 
@@ -55,7 +55,7 @@ pub fn inject(
     // the prelude.
     let name = names[0];
 
-    let span = DUMMY_SP.fresh_expansion(ExpnInfo::allow_unstable(
+    let span = DUMMY_SP.fresh_expansion(ExpnData::allow_unstable(
         ExpnKind::Macro(MacroKind::Attr, sym::std_inject), DUMMY_SP, edition,
         [sym::prelude_import][..].into(),
     ));
index 3fb1c1bd02240833f1f5b04ab1e673186da91229..4a6ea0ebf85e5b6fc5c0f215c754ee16a06b2419 100644 (file)
@@ -11,7 +11,7 @@
 use syntax::mut_visit::{*, ExpectOne};
 use syntax::parse::ParseSess;
 use syntax::ptr::P;
-use syntax::source_map::{ExpnInfo, ExpnKind, dummy_spanned};
+use syntax::source_map::{ExpnData, ExpnKind, dummy_spanned};
 use syntax::symbol::{kw, sym, Symbol};
 use syntax_pos::{Span, DUMMY_SP};
 
@@ -268,7 +268,7 @@ fn mk_main(cx: &mut TestCtxt<'_>) -> P<ast::Item> {
     //            #![main]
     //            test::test_main_static(&[..tests]);
     //        }
-    let sp = DUMMY_SP.fresh_expansion(ExpnInfo::allow_unstable(
+    let sp = DUMMY_SP.fresh_expansion(ExpnData::allow_unstable(
         ExpnKind::Macro(MacroKind::Attr, sym::test_case), DUMMY_SP, cx.ext_cx.parse_sess.edition,
         [sym::main, sym::test, sym::rustc_attrs][..].into(),
     ));
index 4d9496f94fbde3cf72d63bcd3febbe831b4993d6..87d930f897afc45d817c03c478887b308ddf0980 100644 (file)
@@ -13,8 +13,8 @@
 //
 // This explains why `HygieneData`, `SyntaxContext` and `ExpnId` have interfaces
 // with a certain amount of redundancy in them. For example,
-// `SyntaxContext::outer_expn_info` combines `SyntaxContext::outer` and
-// `ExpnId::expn_info` so that two `HygieneData` accesses can be performed within
+// `SyntaxContext::outer_expn_data` combines `SyntaxContext::outer` and
+// `ExpnId::expn_data` so that two `HygieneData` accesses can be performed within
 // a single `HygieneData::with` call.
 //
 // It also explains why many functions appear in `HygieneData` and again in
@@ -76,8 +76,8 @@ pub enum Transparency {
 }
 
 impl ExpnId {
-    pub fn fresh(expn_info: Option<ExpnInfo>) -> Self {
-        HygieneData::with(|data| data.fresh_expn(expn_info))
+    pub fn fresh(expn_data: Option<ExpnData>) -> Self {
+        HygieneData::with(|data| data.fresh_expn(expn_data))
     }
 
     /// The ID of the theoretical expansion that generates freshly parsed, unexpanded AST.
@@ -97,16 +97,16 @@ pub fn from_u32(raw: u32) -> ExpnId {
     }
 
     #[inline]
-    pub fn expn_info(self) -> ExpnInfo {
-        HygieneData::with(|data| data.expn_info(self).clone())
+    pub fn expn_data(self) -> ExpnData {
+        HygieneData::with(|data| data.expn_data(self).clone())
     }
 
     #[inline]
-    pub fn set_expn_info(self, info: ExpnInfo) {
+    pub fn set_expn_data(self, expn_data: ExpnData) {
         HygieneData::with(|data| {
-            let old_info = &mut data.expn_data[self.0 as usize];
-            assert!(old_info.is_none(), "expansion info is reset for an expansion ID");
-            *old_info = Some(info);
+            let old_expn_data = &mut data.expn_data[self.0 as usize];
+            assert!(old_expn_data.is_none(), "expansion data is reset for an expansion ID");
+            *old_expn_data = Some(expn_data);
         })
     }
 
@@ -124,9 +124,9 @@ pub fn outer_expn_is_descendant_of(self, ctxt: SyntaxContext) -> bool {
     #[inline]
     pub fn looks_like_proc_macro_derive(self) -> bool {
         HygieneData::with(|data| {
-            let expn_info = data.expn_info(self);
-            if let ExpnKind::Macro(MacroKind::Derive, _) = expn_info.kind {
-                return expn_info.default_transparency == Transparency::Opaque;
+            let expn_data = data.expn_data(self);
+            if let ExpnKind::Macro(MacroKind::Derive, _) = expn_data.kind {
+                return expn_data.default_transparency == Transparency::Opaque;
             }
             false
         })
@@ -135,10 +135,10 @@ pub fn looks_like_proc_macro_derive(self) -> bool {
 
 #[derive(Debug)]
 crate struct HygieneData {
-    /// Each expansion should have an associated expansion info, but sometimes there's a delay
-    /// between creation of an expansion ID and obtaining its info (e.g. macros are collected
+    /// Each expansion should have an associated expansion data, but sometimes there's a delay
+    /// between creation of an expansion ID and obtaining its data (e.g. macros are collected
     /// first and then resolved later), so we use an `Option` here.
-    expn_data: Vec<Option<ExpnInfo>>,
+    expn_data: Vec<Option<ExpnData>>,
     syntax_context_data: Vec<SyntaxContextData>,
     syntax_context_map: FxHashMap<(SyntaxContext, ExpnId, Transparency), SyntaxContext>,
 }
@@ -146,7 +146,7 @@ pub fn looks_like_proc_macro_derive(self) -> bool {
 impl HygieneData {
     crate fn new(edition: Edition) -> Self {
         HygieneData {
-            expn_data: vec![Some(ExpnInfo::default(ExpnKind::Root, DUMMY_SP, edition))],
+            expn_data: vec![Some(ExpnData::default(ExpnKind::Root, DUMMY_SP, edition))],
             syntax_context_data: vec![SyntaxContextData {
                 outer_expn: ExpnId::root(),
                 outer_transparency: Transparency::Opaque,
@@ -163,14 +163,14 @@ fn with<T, F: FnOnce(&mut HygieneData) -> T>(f: F) -> T {
         GLOBALS.with(|globals| f(&mut *globals.hygiene_data.borrow_mut()))
     }
 
-    fn fresh_expn(&mut self, expn_info: Option<ExpnInfo>) -> ExpnId {
-        self.expn_data.push(expn_info);
+    fn fresh_expn(&mut self, expn_data: Option<ExpnData>) -> ExpnId {
+        self.expn_data.push(expn_data);
         ExpnId(self.expn_data.len() as u32 - 1)
     }
 
-    fn expn_info(&self, expn_id: ExpnId) -> &ExpnInfo {
+    fn expn_data(&self, expn_id: ExpnId) -> &ExpnData {
         self.expn_data[expn_id.0 as usize].as_ref()
-            .expect("no expansion info for an expansion ID")
+            .expect("no expansion data for an expansion ID")
     }
 
     fn is_descendant_of(&self, mut expn_id: ExpnId, ancestor: ExpnId) -> bool {
@@ -178,7 +178,7 @@ fn is_descendant_of(&self, mut expn_id: ExpnId, ancestor: ExpnId) -> bool {
             if expn_id == ExpnId::root() {
                 return false;
             }
-            expn_id = self.expn_info(expn_id).parent;
+            expn_id = self.expn_data(expn_id).parent;
         }
         true
     }
@@ -221,7 +221,7 @@ fn marks(&self, mut ctxt: SyntaxContext) -> Vec<(ExpnId, Transparency)> {
 
     fn walk_chain(&self, mut span: Span, to: SyntaxContext) -> Span {
         while span.from_expansion() && span.ctxt() != to {
-            span = self.expn_info(self.outer_expn(span.ctxt())).call_site;
+            span = self.expn_data(self.outer_expn(span.ctxt())).call_site;
         }
         span
     }
@@ -237,7 +237,7 @@ fn adjust(&self, ctxt: &mut SyntaxContext, expn_id: ExpnId) -> Option<ExpnId> {
     fn apply_mark(&mut self, ctxt: SyntaxContext, expn_id: ExpnId) -> SyntaxContext {
         assert_ne!(expn_id, ExpnId::root());
         self.apply_mark_with_transparency(
-            ctxt, expn_id, self.expn_info(expn_id).default_transparency
+            ctxt, expn_id, self.expn_data(expn_id).default_transparency
         )
     }
 
@@ -248,7 +248,7 @@ fn apply_mark_with_transparency(&mut self, ctxt: SyntaxContext, expn_id: ExpnId,
             return self.apply_mark_internal(ctxt, expn_id, transparency);
         }
 
-        let call_site_ctxt = self.expn_info(expn_id).call_site.ctxt();
+        let call_site_ctxt = self.expn_data(expn_id).call_site.ctxt();
         let mut call_site_ctxt = if transparency == Transparency::SemiTransparent {
             self.modern(call_site_ctxt)
         } else {
@@ -540,20 +540,20 @@ pub fn outer_expn(self) -> ExpnId {
         HygieneData::with(|data| data.outer_expn(self))
     }
 
-    /// `ctxt.outer_expn_info()` is equivalent to but faster than
-    /// `ctxt.outer_expn().expn_info()`.
+    /// `ctxt.outer_expn_data()` is equivalent to but faster than
+    /// `ctxt.outer_expn().expn_data()`.
     #[inline]
-    pub fn outer_expn_info(self) -> ExpnInfo {
-        HygieneData::with(|data| data.expn_info(data.outer_expn(self)).clone())
+    pub fn outer_expn_data(self) -> ExpnData {
+        HygieneData::with(|data| data.expn_data(data.outer_expn(self)).clone())
     }
 
-    /// `ctxt.outer_expn_with_info()` is equivalent to but faster than
-    /// `{ let outer = ctxt.outer_expn(); (outer, outer.expn_info()) }`.
+    /// `ctxt.outer_expn_with_data()` is equivalent to but faster than
+    /// `{ let outer = ctxt.outer_expn(); (outer, outer.expn_data()) }`.
     #[inline]
-    pub fn outer_expn_with_info(self) -> (ExpnId, ExpnInfo) {
+    pub fn outer_expn_with_data(self) -> (ExpnId, ExpnData) {
         HygieneData::with(|data| {
             let outer = data.outer_expn(self);
-            (outer, data.expn_info(outer).clone())
+            (outer, data.expn_data(outer).clone())
         })
     }
 
@@ -574,9 +574,9 @@ impl Span {
     /// other compiler-generated code to set per-span properties like allowed unstable features.
     /// The returned span belongs to the created expansion and has the new properties,
     /// but its location is inherited from the current span.
-    pub fn fresh_expansion(self, expn_info: ExpnInfo) -> Span {
+    pub fn fresh_expansion(self, expn_data: ExpnData) -> Span {
         HygieneData::with(|data| {
-            let expn_id = data.fresh_expn(Some(expn_info));
+            let expn_id = data.fresh_expn(Some(expn_data));
             self.with_ctxt(data.apply_mark(SyntaxContext::root(), expn_id))
         })
     }
@@ -585,7 +585,7 @@ pub fn fresh_expansion(self, expn_info: ExpnInfo) -> Span {
 /// A subset of properties from both macro definition and macro call available through global data.
 /// Avoid using this if you have access to the original definition or call structures.
 #[derive(Clone, Debug, RustcEncodable, RustcDecodable)]
-pub struct ExpnInfo {
+pub struct ExpnData {
     // --- The part unique to each expansion.
     /// The kind of this expansion - macro or compiler desugaring.
     pub kind: ExpnKind,
@@ -598,7 +598,7 @@ pub struct ExpnInfo {
     /// `foo!()` invoked `bar!()` internally, and there was an
     /// expression inside `bar!`; the call_site of the expression in
     /// the expansion would point to the `bar!` invocation; that
-    /// call_site span would have its own ExpnInfo, with the call_site
+    /// call_site span would have its own ExpnData, with the call_site
     /// pointing to the `foo!` invocation.
     pub call_site: Span,
 
@@ -609,7 +609,7 @@ pub struct ExpnInfo {
     /// The span of the macro definition (possibly dummy).
     /// This span serves only informational purpose and is not used for resolution.
     pub def_site: Span,
-    /// Transparency used by `apply_mark` for the expansion with this expansion info by default.
+    /// Transparency used by `apply_mark` for the expansion with this expansion data by default.
     pub default_transparency: Transparency,
     /// List of #[unstable]/feature-gated features that the macro is allowed to use
     /// internally without forcing the whole crate to opt-in
@@ -625,10 +625,10 @@ pub struct ExpnInfo {
     pub edition: Edition,
 }
 
-impl ExpnInfo {
-    /// Constructs an expansion info with default properties.
-    pub fn default(kind: ExpnKind, call_site: Span, edition: Edition) -> ExpnInfo {
-        ExpnInfo {
+impl ExpnData {
+    /// Constructs expansion data with default properties.
+    pub fn default(kind: ExpnKind, call_site: Span, edition: Edition) -> ExpnData {
+        ExpnData {
             kind,
             parent: ExpnId::root(),
             call_site,
@@ -642,10 +642,10 @@ pub fn default(kind: ExpnKind, call_site: Span, edition: Edition) -> ExpnInfo {
     }
 
     pub fn allow_unstable(kind: ExpnKind, call_site: Span, edition: Edition,
-                          allow_internal_unstable: Lrc<[Symbol]>) -> ExpnInfo {
-        ExpnInfo {
+                          allow_internal_unstable: Lrc<[Symbol]>) -> ExpnData {
+        ExpnData {
             allow_internal_unstable: Some(allow_internal_unstable),
-            ..ExpnInfo::default(kind, call_site, edition)
+            ..ExpnData::default(kind, call_site, edition)
         }
     }
 
index ae538677a3aac689afdcd5ca806cb0d59a13aa22..aa36fe27d8ec4dddd786884a44cf6467cce6bae3 100644 (file)
@@ -21,7 +21,7 @@
 pub mod edition;
 use edition::Edition;
 pub mod hygiene;
-pub use hygiene::{ExpnId, SyntaxContext, ExpnInfo, ExpnKind, MacroKind, DesugaringKind};
+pub use hygiene::{ExpnId, SyntaxContext, ExpnData, ExpnKind, MacroKind, DesugaringKind};
 
 mod span_encoding;
 pub use span_encoding::{Span, DUMMY_SP};
@@ -353,20 +353,20 @@ pub fn trim_start(self, other: Span) -> Option<Span> {
     /// Returns the source span -- this is either the supplied span, or the span for
     /// the macro callsite that expanded to it.
     pub fn source_callsite(self) -> Span {
-        let expn_info = self.ctxt().outer_expn_info();
-        if !expn_info.is_root() { expn_info.call_site.source_callsite() } else { self }
+        let expn_data = self.ctxt().outer_expn_data();
+        if !expn_data.is_root() { expn_data.call_site.source_callsite() } else { self }
     }
 
     /// The `Span` for the tokens in the previous macro expansion from which `self` was generated,
     /// if any.
     pub fn parent(self) -> Option<Span> {
-        let expn_info = self.ctxt().outer_expn_info();
-        if !expn_info.is_root() { Some(expn_info.call_site) } else { None }
+        let expn_data = self.ctxt().outer_expn_data();
+        if !expn_data.is_root() { Some(expn_data.call_site) } else { None }
     }
 
     /// Edition of the crate from which this span came.
     pub fn edition(self) -> edition::Edition {
-        self.ctxt().outer_expn_info().edition
+        self.ctxt().outer_expn_data().edition
     }
 
     #[inline]
@@ -382,22 +382,22 @@ pub fn rust_2018(&self) -> bool {
     /// Returns the source callee.
     ///
     /// Returns `None` if the supplied span has no expansion trace,
-    /// else returns the `ExpnInfo` for the macro definition
+    /// else returns the `ExpnData` for the macro definition
     /// corresponding to the source callsite.
-    pub fn source_callee(self) -> Option<ExpnInfo> {
-        fn source_callee(expn_info: ExpnInfo) -> ExpnInfo {
-            let next_expn_info = expn_info.call_site.ctxt().outer_expn_info();
-            if !next_expn_info.is_root() { source_callee(next_expn_info) } else { expn_info }
+    pub fn source_callee(self) -> Option<ExpnData> {
+        fn source_callee(expn_data: ExpnData) -> ExpnData {
+            let next_expn_data = expn_data.call_site.ctxt().outer_expn_data();
+            if !next_expn_data.is_root() { source_callee(next_expn_data) } else { expn_data }
         }
-        let expn_info = self.ctxt().outer_expn_info();
-        if !expn_info.is_root() { Some(source_callee(expn_info)) } else { None }
+        let expn_data = self.ctxt().outer_expn_data();
+        if !expn_data.is_root() { Some(source_callee(expn_data)) } else { None }
     }
 
     /// Checks if a span is "internal" to a macro in which `#[unstable]`
     /// items can be used (that is, a macro marked with
     /// `#[allow_internal_unstable]`).
     pub fn allows_unstable(&self, feature: Symbol) -> bool {
-        self.ctxt().outer_expn_info().allow_internal_unstable.map_or(false, |features| {
+        self.ctxt().outer_expn_data().allow_internal_unstable.map_or(false, |features| {
             features.iter().any(|&f| {
                 f == feature || f == sym::allow_internal_unstable_backcompat_hack
             })
@@ -406,7 +406,7 @@ pub fn allows_unstable(&self, feature: Symbol) -> bool {
 
     /// Checks if this span arises from a compiler desugaring of kind `kind`.
     pub fn is_desugaring(&self, kind: DesugaringKind) -> bool {
-        match self.ctxt().outer_expn_info().kind {
+        match self.ctxt().outer_expn_data().kind {
             ExpnKind::Desugaring(k) => k == kind,
             _ => false,
         }
@@ -415,7 +415,7 @@ pub fn is_desugaring(&self, kind: DesugaringKind) -> bool {
     /// Returns the compiler desugaring that created this span, or `None`
     /// if this span is not from a desugaring.
     pub fn desugaring_kind(&self) -> Option<DesugaringKind> {
-        match self.ctxt().outer_expn_info().kind {
+        match self.ctxt().outer_expn_data().kind {
             ExpnKind::Desugaring(k) => Some(k),
             _ => None
         }
@@ -425,20 +425,20 @@ pub fn desugaring_kind(&self) -> Option<DesugaringKind> {
     /// can be used without triggering the `unsafe_code` lint
     //  (that is, a macro marked with `#[allow_internal_unsafe]`).
     pub fn allows_unsafe(&self) -> bool {
-        self.ctxt().outer_expn_info().allow_internal_unsafe
+        self.ctxt().outer_expn_data().allow_internal_unsafe
     }
 
     pub fn macro_backtrace(mut self) -> Vec<MacroBacktrace> {
         let mut prev_span = DUMMY_SP;
         let mut result = vec![];
         loop {
-            let info = self.ctxt().outer_expn_info();
-            if info.is_root() {
+            let expn_data = self.ctxt().outer_expn_data();
+            if expn_data.is_root() {
                 break;
             }
             // Don't print recursive invocations.
-            if !info.call_site.source_equal(&prev_span) {
-                let (pre, post) = match info.kind {
+            if !expn_data.call_site.source_equal(&prev_span) {
+                let (pre, post) = match expn_data.kind {
                     ExpnKind::Root => break,
                     ExpnKind::Desugaring(..) => ("desugaring of ", ""),
                     ExpnKind::Macro(macro_kind, _) => match macro_kind {
@@ -448,14 +448,14 @@ pub fn macro_backtrace(mut self) -> Vec<MacroBacktrace> {
                     }
                 };
                 result.push(MacroBacktrace {
-                    call_site: info.call_site,
-                    macro_decl_name: format!("{}{}{}", pre, info.kind.descr(), post),
-                    def_site_span: info.def_site,
+                    call_site: expn_data.call_site,
+                    macro_decl_name: format!("{}{}{}", pre, expn_data.kind.descr(), post),
+                    def_site_span: expn_data.def_site,
                 });
             }
 
             prev_span = self;
-            self = info.call_site;
+            self = expn_data.call_site;
         }
         result
     }