separate definitions and HIR
owners
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
This commit is contained in:
parent
bb5a016175
commit
8fe936099a
114 changed files with 659 additions and 518 deletions
|
@ -385,7 +385,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
|
|||
}
|
||||
|
||||
self.annotate(
|
||||
i.def_id,
|
||||
i.def_id.def_id,
|
||||
i.span,
|
||||
fn_sig,
|
||||
kind,
|
||||
|
@ -404,7 +404,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
|
|||
};
|
||||
|
||||
self.annotate(
|
||||
ti.def_id,
|
||||
ti.def_id.def_id,
|
||||
ti.span,
|
||||
fn_sig,
|
||||
AnnotationKind::Required,
|
||||
|
@ -427,7 +427,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
|
|||
};
|
||||
|
||||
self.annotate(
|
||||
ii.def_id,
|
||||
ii.def_id.def_id,
|
||||
ii.span,
|
||||
fn_sig,
|
||||
kind,
|
||||
|
@ -485,7 +485,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
|
|||
|
||||
fn visit_foreign_item(&mut self, i: &'tcx hir::ForeignItem<'tcx>) {
|
||||
self.annotate(
|
||||
i.def_id,
|
||||
i.def_id.def_id,
|
||||
i.span,
|
||||
None,
|
||||
AnnotationKind::Required,
|
||||
|
@ -573,25 +573,25 @@ impl<'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'tcx> {
|
|||
hir::ItemKind::Impl(hir::Impl { of_trait: None, .. })
|
||||
| hir::ItemKind::ForeignMod { .. }
|
||||
) {
|
||||
self.check_missing_stability(i.def_id, i.span);
|
||||
self.check_missing_stability(i.def_id.def_id, i.span);
|
||||
}
|
||||
|
||||
// Ensure stable `const fn` have a const stability attribute.
|
||||
self.check_missing_const_stability(i.def_id, i.span);
|
||||
self.check_missing_const_stability(i.def_id.def_id, i.span);
|
||||
|
||||
intravisit::walk_item(self, i)
|
||||
}
|
||||
|
||||
fn visit_trait_item(&mut self, ti: &'tcx hir::TraitItem<'tcx>) {
|
||||
self.check_missing_stability(ti.def_id, ti.span);
|
||||
self.check_missing_stability(ti.def_id.def_id, ti.span);
|
||||
intravisit::walk_trait_item(self, ti);
|
||||
}
|
||||
|
||||
fn visit_impl_item(&mut self, ii: &'tcx hir::ImplItem<'tcx>) {
|
||||
let impl_def_id = self.tcx.hir().get_parent_item(ii.hir_id());
|
||||
if self.tcx.impl_trait_ref(impl_def_id).is_none() {
|
||||
self.check_missing_stability(ii.def_id, ii.span);
|
||||
self.check_missing_const_stability(ii.def_id, ii.span);
|
||||
self.check_missing_stability(ii.def_id.def_id, ii.span);
|
||||
self.check_missing_const_stability(ii.def_id.def_id, ii.span);
|
||||
}
|
||||
intravisit::walk_impl_item(self, ii);
|
||||
}
|
||||
|
@ -610,7 +610,7 @@ impl<'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'tcx> {
|
|||
}
|
||||
|
||||
fn visit_foreign_item(&mut self, i: &'tcx hir::ForeignItem<'tcx>) {
|
||||
self.check_missing_stability(i.def_id, i.span);
|
||||
self.check_missing_stability(i.def_id.def_id, i.span);
|
||||
intravisit::walk_foreign_item(self, i);
|
||||
}
|
||||
// Note that we don't need to `check_missing_stability` for default generic parameters,
|
||||
|
@ -716,7 +716,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'tcx> {
|
|||
return;
|
||||
}
|
||||
|
||||
let Some(cnum) = self.tcx.extern_mod_stmt_cnum(item.def_id) else {
|
||||
let Some(cnum) = self.tcx.extern_mod_stmt_cnum(item.def_id.def_id) else {
|
||||
return;
|
||||
};
|
||||
let def_id = cnum.as_def_id();
|
||||
|
@ -869,7 +869,7 @@ fn is_unstable_reexport<'tcx>(tcx: TyCtxt<'tcx>, id: hir::HirId) -> bool {
|
|||
}
|
||||
|
||||
// If this is a path that isn't a use, we don't need to do anything special
|
||||
if !matches!(tcx.hir().item(hir::ItemId { def_id }).kind, ItemKind::Use(..)) {
|
||||
if !matches!(tcx.hir().expect_item(def_id).kind, ItemKind::Use(..)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue