X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_hir_typeck%2Fsrc%2Fcoercion.rs;h=43c7127b0d4c56b0e8495508eb2e9f51fa784d0d;hb=a673364c543986789cfbb844c925063519fb872a;hp=cf3b37f0a25088e4e5f00624a8ef172df8b6475a;hpb=ddf055ad07b93d27c826e737b674b65ab760e901;p=rust.git diff --git a/compiler/rustc_hir_typeck/src/coercion.rs b/compiler/rustc_hir_typeck/src/coercion.rs index cf3b37f0a25..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; @@ -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