diff options
Diffstat (limited to 'compiler/rustc_resolve')
| -rw-r--r-- | compiler/rustc_resolve/src/lib.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_resolve/src/macros.rs | 12 |
2 files changed, 15 insertions, 5 deletions
diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 9197f4059ca..300d2c01cb5 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -1770,9 +1770,11 @@ impl<'a> Resolver<'a> { let expn_data = expn_id.expn_data(); match expn_data.kind { ExpnKind::Root - | ExpnKind::Macro(MacroKind::Bang | MacroKind::Derive, _) => { - Scope::DeriveHelpersCompat - } + | ExpnKind::Macro { + kind: MacroKind::Bang | MacroKind::Derive, + name: _, + proc_macro: _, + } => Scope::DeriveHelpersCompat, _ => Scope::DeriveHelpers(expn_data.parent), } } diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs index 10e27f33c29..3f7db2b6962 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -20,7 +20,7 @@ use rustc_expand::compile_declarative_macro; use rustc_expand::expand::{AstFragment, Invocation, InvocationKind, SupportsMacroExpansion}; use rustc_feature::is_builtin_attr_name; use rustc_hir::def::{self, DefKind, NonMacroAttrKind}; -use rustc_hir::def_id; +use rustc_hir::def_id::{self, CrateNum}; use rustc_hir::PrimTy; use rustc_middle::middle::stability; use rustc_middle::ty; @@ -325,7 +325,11 @@ impl<'a> ResolverExpand for Resolver<'a> { let expn_data = expn_id.expn_data(); match expn_data.kind { ExpnKind::Root - | ExpnKind::Macro(MacroKind::Bang | MacroKind::Derive, _) => { + | ExpnKind::Macro { + name: _, + kind: MacroKind::Bang | MacroKind::Derive, + proc_macro: _, + } => { break; } _ => expn_id = expn_data.parent, @@ -462,6 +466,10 @@ impl<'a> ResolverExpand for Resolver<'a> { .emit(); Ok(false) } + + fn get_proc_macro_quoted_span(&self, krate: CrateNum, id: usize) -> Span { + self.crate_loader.cstore().get_proc_macro_quoted_span_untracked(krate, id, self.session) + } } impl<'a> Resolver<'a> { |
