out_of_scope_macro_calls: Detect calls inside attributes more precisely
This commit is contained in:
@@ -1139,7 +1139,7 @@ pub struct Resolver<'a, 'tcx> {
|
||||
/// When collecting definitions from an AST fragment produced by a macro invocation `ExpnId`
|
||||
/// we know what parent node that fragment should be attached to thanks to this table,
|
||||
/// and how the `impl Trait` fragments were introduced.
|
||||
invocation_parents: FxHashMap<LocalExpnId, (LocalDefId, ImplTraitContext)>,
|
||||
invocation_parents: FxHashMap<LocalExpnId, (LocalDefId, ImplTraitContext, bool /*in_attr*/)>,
|
||||
|
||||
/// Some way to know that we are in a *trait* impl in `visit_assoc_item`.
|
||||
/// FIXME: Replace with a more general AST map (together with some other fields).
|
||||
@@ -1371,7 +1371,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
||||
node_id_to_def_id.insert(CRATE_NODE_ID, crate_feed);
|
||||
|
||||
let mut invocation_parents = FxHashMap::default();
|
||||
invocation_parents.insert(LocalExpnId::ROOT, (CRATE_DEF_ID, ImplTraitContext::Existential));
|
||||
invocation_parents
|
||||
.insert(LocalExpnId::ROOT, (CRATE_DEF_ID, ImplTraitContext::Existential, false));
|
||||
|
||||
let mut extern_prelude: FxHashMap<Ident, ExternPreludeEntry<'_>> = tcx
|
||||
.sess
|
||||
|
||||
Reference in New Issue
Block a user