Registry Mirror
Skip to content

File tree

‎compiler/rustc_hir_analysis/src/check/check.rs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -839,9 +839,8 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(),
839839
tcx.ensure_ok().associated_items(def_id);
840840
if of_trait {
841841
let impl_trait_header = tcx.impl_trait_header(def_id);
842-
res = res.and(tcx.ensure_result().coherent_trait(
843-
impl_trait_header.trait_ref.instantiate_identity().skip_norm_wip().def_id,
844-
));
842+
res = res
843+
.and(tcx.ensure_result().coherent_trait(impl_trait_header.trait_ref.def_id()));
845844

846845
if res.is_ok() {
847846
// Checking this only makes sense if the all trait impls satisfy basic

‎compiler/rustc_mir_transform/src/check_call_recursion.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl<'tcx> MirLint<'tcx> for CheckDropRecursion {
4545
if let DefKind::AssocFn = tcx.def_kind(def_id)
4646
&& let Some(impl_id) = tcx.trait_impl_of_assoc(def_id.to_def_id())
4747
&& let trait_ref = tcx.impl_trait_ref(impl_id)
48-
&& tcx.is_lang_item(trait_ref.instantiate_identity().skip_norm_wip().def_id, LangItem::Drop)
48+
&& tcx.is_lang_item(trait_ref.def_id(), LangItem::Drop)
4949
// avoid erroneous `Drop` impls from causing ICEs below
5050
&& let sig = tcx.fn_sig(def_id).instantiate_identity().skip_norm_wip()
5151
&& sig.inputs().skip_binder().len() == 1

‎compiler/rustc_type_ir/src/binder.rs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,12 @@ impl<I: Interner, T> EarlyBinder<I, T> {
448448
}
449449
}
450450

451+
impl<I: Interner> EarlyBinder<I, ty::TraitRef<I>> {
452+
pub fn def_id(&self) -> I::TraitId {
453+
self.value.def_id
454+
}
455+
}
456+
451457
impl<I: Interner, T> EarlyBinder<I, Option<T>> {
452458
pub fn transpose(self) -> Option<EarlyBinder<I, T>> {
453459
self.value.map(|value| EarlyBinder { value, _tcx: PhantomData })

0 commit comments

Comments
 (0)