1
Fork 0

Only store a LocalDefId in hir::MacroDef.

This commit is contained in:
Camille GILLOT 2021-01-31 18:20:18 +01:00
parent ff14cac621
commit c4e7427081
16 changed files with 47 additions and 29 deletions

View file

@ -1155,7 +1155,7 @@ impl Visitor<'tcx> for CheckAttrVisitor<'tcx> {
fn visit_macro_def(&mut self, macro_def: &'tcx hir::MacroDef<'tcx>) {
self.check_attributes(
macro_def.hir_id,
macro_def.hir_id(),
macro_def.attrs,
&macro_def.span,
Target::MacroDef,

View file

@ -106,7 +106,7 @@ fn collect<'tcx>(tcx: TyCtxt<'tcx>) -> FxHashMap<Symbol, DefId> {
tcx.hir().krate().visit_all_item_likes(&mut collector);
for m in tcx.hir().krate().exported_macros {
collector.observe_item(m.attrs, m.hir_id);
collector.observe_item(m.attrs, m.hir_id());
}
collector.items

View file

@ -246,7 +246,7 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> {
}
fn visit_macro_def(&mut self, macro_def: &'v hir::MacroDef<'v>) {
self.record("MacroDef", Id::Node(macro_def.hir_id), macro_def);
self.record("MacroDef", Id::Node(macro_def.hir_id()), macro_def);
hir_visit::walk_macro_def(self, macro_def)
}
}

View file

@ -473,7 +473,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
fn visit_macro_def(&mut self, md: &'tcx hir::MacroDef<'tcx>) {
self.annotate(
md.hir_id,
md.hir_id(),
&md.attrs,
md.span,
AnnotationKind::Required,
@ -599,7 +599,7 @@ impl<'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'tcx> {
}
fn visit_macro_def(&mut self, md: &'tcx hir::MacroDef<'tcx>) {
self.check_missing_stability(md.hir_id, md.span);
self.check_missing_stability(md.hir_id(), md.span);
}
// Note that we don't need to `check_missing_stability` for default generic parameters,