Use Item::expect_*
and ImplItem::expect_*
more
This commit is contained in:
parent
e49122fb1c
commit
9534541dd4
5 changed files with 11 additions and 22 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue