diff options
Diffstat (limited to 'compiler/rustc_passes')
| -rw-r--r-- | compiler/rustc_passes/src/check_attr.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_passes/src/dead.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_passes/src/reachable.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_passes/src/stability.rs | 9 |
4 files changed, 11 insertions, 8 deletions
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index a6a61ffc5da..ac73ba7062e 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -32,7 +32,7 @@ pub(crate) fn target_from_impl_item<'tcx>( let parent_hir_id = tcx.hir().get_parent_item(impl_item.hir_id); let containing_item = tcx.hir().expect_item(parent_hir_id); let containing_impl_is_for_trait = match &containing_item.kind { - hir::ItemKind::Impl { ref of_trait, .. } => of_trait.is_some(), + hir::ItemKind::Impl(impl_) => impl_.of_trait.is_some(), _ => bug!("parent of an ImplItem must be an Impl"), }; if containing_impl_is_for_trait { @@ -343,7 +343,7 @@ impl CheckAttrVisitor<'tcx> { // We can't link to trait impl's consts. let err = "associated constant in trait implementation block"; match containing_item.kind { - ItemKind::Impl { of_trait: Some(_), .. } => Some(err), + ItemKind::Impl(hir::Impl { of_trait: Some(_), .. }) => Some(err), _ => None, } } diff --git a/compiler/rustc_passes/src/dead.rs b/compiler/rustc_passes/src/dead.rs index c4fb0cf5b28..80a24c90421 100644 --- a/compiler/rustc_passes/src/dead.rs +++ b/compiler/rustc_passes/src/dead.rs @@ -396,7 +396,7 @@ impl<'v, 'k, 'tcx> ItemLikeVisitor<'v> for LifeSeeder<'k, 'tcx> { } } } - hir::ItemKind::Impl { ref of_trait, items, .. } => { + hir::ItemKind::Impl(hir::Impl { ref of_trait, items, .. }) => { if of_trait.is_some() { self.worklist.push(item.hir_id); } diff --git a/compiler/rustc_passes/src/reachable.rs b/compiler/rustc_passes/src/reachable.rs index fde83af99a5..b237671f8e2 100644 --- a/compiler/rustc_passes/src/reachable.rs +++ b/compiler/rustc_passes/src/reachable.rs @@ -349,7 +349,9 @@ impl<'a, 'tcx> ItemLikeVisitor<'tcx> for CollectPrivateImplItemsVisitor<'a, 'tcx } // We need only trait impls here, not inherent impls, and only non-exported ones - if let hir::ItemKind::Impl { of_trait: Some(ref trait_ref), ref items, .. } = item.kind { + if let hir::ItemKind::Impl(hir::Impl { of_trait: Some(ref trait_ref), ref items, .. }) = + item.kind + { if !self.access_levels.is_reachable(item.hir_id) { // FIXME(#53488) remove `let` let tcx = self.tcx; diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index def2a501cf4..4a3d6ecf8cc 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -330,11 +330,12 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> { // they don't have their own stability. They still can be annotated as unstable // and propagate this unstability to children, but this annotation is completely // optional. They inherit stability from their parents when unannotated. - hir::ItemKind::Impl { of_trait: None, .. } | hir::ItemKind::ForeignMod { .. } => { + hir::ItemKind::Impl(hir::Impl { of_trait: None, .. }) + | hir::ItemKind::ForeignMod { .. } => { self.in_trait_impl = false; kind = AnnotationKind::Container; } - hir::ItemKind::Impl { of_trait: Some(_), .. } => { + hir::ItemKind::Impl(hir::Impl { of_trait: Some(_), .. }) => { self.in_trait_impl = true; kind = AnnotationKind::DeprecationProhibited; } @@ -503,7 +504,7 @@ impl<'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'tcx> { // optional. They inherit stability from their parents when unannotated. if !matches!( i.kind, - hir::ItemKind::Impl { of_trait: None, .. } | hir::ItemKind::ForeignMod { .. } + hir::ItemKind::Impl(hir::Impl { of_trait: None, .. }) | hir::ItemKind::ForeignMod { .. } ) { self.check_missing_stability(i.hir_id, i.span); } @@ -672,7 +673,7 @@ impl Visitor<'tcx> for Checker<'tcx> { // For implementations of traits, check the stability of each item // individually as it's possible to have a stable trait with unstable // items. - hir::ItemKind::Impl { of_trait: Some(ref t), self_ty, items, .. } => { + hir::ItemKind::Impl(hir::Impl { of_trait: Some(ref t), self_ty, items, .. }) => { if self.tcx.features().staged_api { // If this impl block has an #[unstable] attribute, give an // error if all involved types and traits are stable, because |
