about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-18 05:28:44 +0000
committerbors <bors@rust-lang.org>2023-04-18 05:28:44 +0000
commit74864fa496997a6498e623f0d2019ccb7eb6dad0 (patch)
tree90fc9fcdd8e4fb35b88ffa626a5f97a0b2734a62 /compiler/rustc_hir_analysis/src
parent386025117a6b7cd9e7f7c96946793db2ec8aa24c (diff)
parent5606653f01b6b2fbcbaa1b2ff37e04d4e66486f8 (diff)
downloadrust-74864fa496997a6498e623f0d2019ccb7eb6dad0.tar.gz
rust-74864fa496997a6498e623f0d2019ccb7eb6dad0.zip
Auto merge of #110481 - matthiaskrgr:rollup-phkkgm9, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #109981 (Set commit information environment variables when building tools)
 - #110348 (Add list of supported disambiguators and suffixes for intra-doc links in the rustdoc book)
 - #110409 (Don't use `serde_json` to serialize a simple JSON object)
 - #110442 (Avoid including dry run steps in the build metrics)
 - #110450 (rustdoc: Fix invalid handling of nested items with `--document-private-items`)
 - #110461 (Use `Item::expect_*` and `ImplItem::expect_*` more)
 - #110465 (Assure everyone that `has_type_flags` is fast)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_hir_analysis/src')
-rw-r--r--compiler/rustc_hir_analysis/src/coherence/builtin.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_hir_analysis/src/coherence/builtin.rs b/compiler/rustc_hir_analysis/src/coherence/builtin.rs
index 0f40cca9427..c2dc2a0f058 100644
--- a/compiler/rustc_hir_analysis/src/coherence/builtin.rs
+++ b/compiler/rustc_hir_analysis/src/coherence/builtin.rs
@@ -74,10 +74,9 @@ fn visit_implementation_of_copy(tcx: TyCtxt<'_>, impl_did: LocalDefId) {
 
     debug!("visit_implementation_of_copy: self_type={:?} (free)", self_type);
 
-    let span = match tcx.hir().expect_item(impl_did).kind {
-        ItemKind::Impl(hir::Impl { polarity: hir::ImplPolarity::Negative(_), .. }) => return,
-        ItemKind::Impl(impl_) => impl_.self_ty.span,
-        _ => bug!("expected Copy impl item"),
+    let span = match tcx.hir().expect_item(impl_did).expect_impl() {
+        hir::Impl { polarity: hir::ImplPolarity::Negative(_), .. } => return,
+        hir::Impl { self_ty, .. } => self_ty.span,
     };
 
     let cause = traits::ObligationCause::misc(span, impl_did);