X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_hir_typeck%2Fsrc%2Fcoercion.rs;h=43c7127b0d4c56b0e8495508eb2e9f51fa784d0d;hb=a673364c543986789cfbb844c925063519fb872a;hp=af0b7f62ae3195f6ce058bde7b0cf97be631efc1;hpb=e07425d55b77fde99af2092a92109a0da0860692;p=rust.git diff --git a/compiler/rustc_hir_typeck/src/coercion.rs b/compiler/rustc_hir_typeck/src/coercion.rs index af0b7f62ae3..43c7127b0d4 100644 --- a/compiler/rustc_hir_typeck/src/coercion.rs +++ b/compiler/rustc_hir_typeck/src/coercion.rs @@ -630,8 +630,7 @@ fn coerce_unsized(&self, mut source: Ty<'tcx>, mut target: Ty<'tcx>) -> CoerceRe cause, coerce_unsized_did, 0, - coerce_source, - &[coerce_target.into()] + [coerce_source, coerce_target] )]; let mut has_unsized_tuple_coercion = false; @@ -748,7 +747,7 @@ fn coerce_dyn_star( &self, a: Ty<'tcx>, b: Ty<'tcx>, - predicates: &'tcx ty::List>>, + predicates: &'tcx ty::List>, b_region: ty::Region<'tcx>, ) -> CoerceResult<'tcx> { if !self.tcx.features().dyn_star { @@ -805,10 +804,9 @@ fn coerce_dyn_star( self.tcx, self.cause.clone(), self.param_env, - ty::Binder::dummy(ty::TraitRef::new( - self.tcx.require_lang_item(hir::LangItem::PointerSized, Some(self.cause.span)), - self.tcx.mk_substs_trait(a, &[]), - )) + ty::Binder::dummy( + self.tcx.at(self.cause.span).mk_trait_ref(hir::LangItem::PointerSized, [a]), + ) .to_poly_trait_predicate(), )); } @@ -1086,8 +1084,7 @@ pub fn deref_once_mutably_for_diagnostic(&self, expr_ty: Ty<'tcx>) -> Option