X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=compiler%2Frustc_infer%2Fsrc%2Finfer%2Fat.rs;fp=compiler%2Frustc_infer%2Fsrc%2Finfer%2Fat.rs;h=d816a9ed3d7c102517e024ac39f0d9a3eb52e863;hb=9c376795345a54460ed471eaed07adb518935ba4;hp=4429e4f43629a885543c06a5ac61426e96825760;hpb=487cf647e7ddc12d47e262b697079f87c1f08019;p=rustc.git diff --git a/compiler/rustc_infer/src/infer/at.rs b/compiler/rustc_infer/src/infer/at.rs index 4429e4f436..d816a9ed3d 100644 --- a/compiler/rustc_infer/src/infer/at.rs +++ b/compiler/rustc_infer/src/infer/at.rs @@ -411,7 +411,7 @@ impl<'tcx> ToTrace<'tcx> for ty::PolyTraitRef<'tcx> { } } -impl<'tcx> ToTrace<'tcx> for ty::ProjectionTy<'tcx> { +impl<'tcx> ToTrace<'tcx> for ty::AliasTy<'tcx> { fn to_trace( tcx: TyCtxt<'tcx>, cause: &ObligationCause<'tcx>, @@ -419,11 +419,23 @@ impl<'tcx> ToTrace<'tcx> for ty::ProjectionTy<'tcx> { a: Self, b: Self, ) -> TypeTrace<'tcx> { - let a_ty = tcx.mk_projection(a.item_def_id, a.substs); - let b_ty = tcx.mk_projection(b.item_def_id, b.substs); + let a_ty = tcx.mk_projection(a.def_id, a.substs); + let b_ty = tcx.mk_projection(b.def_id, b.substs); TypeTrace { cause: cause.clone(), values: Terms(ExpectedFound::new(a_is_expected, a_ty.into(), b_ty.into())), } } } + +impl<'tcx> ToTrace<'tcx> for ty::FnSig<'tcx> { + fn to_trace( + _: TyCtxt<'tcx>, + cause: &ObligationCause<'tcx>, + a_is_expected: bool, + a: Self, + b: Self, + ) -> TypeTrace<'tcx> { + TypeTrace { cause: cause.clone(), values: Sigs(ExpectedFound::new(a_is_expected, a, b)) } + } +}