summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_monomorphize/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_monomorphize/src/lib.rs')
-rw-r--r--compiler/rustc_monomorphize/src/lib.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/compiler/rustc_monomorphize/src/lib.rs b/compiler/rustc_monomorphize/src/lib.rs
index 42781bd25..b616ed35d 100644
--- a/compiler/rustc_monomorphize/src/lib.rs
+++ b/compiler/rustc_monomorphize/src/lib.rs
@@ -13,8 +13,8 @@ extern crate rustc_middle;
use rustc_hir::lang_items::LangItem;
use rustc_middle::traits;
use rustc_middle::ty::adjustment::CustomCoerceUnsized;
-use rustc_middle::ty::query::Providers;
-use rustc_middle::ty::{self, Ty, TyCtxt};
+use rustc_middle::ty::query::{Providers, TyCtxtAt};
+use rustc_middle::ty::{self, Ty};
mod collector;
mod errors;
@@ -23,16 +23,12 @@ mod polymorphize;
mod util;
fn custom_coerce_unsize_info<'tcx>(
- tcx: TyCtxt<'tcx>,
+ tcx: TyCtxtAt<'tcx>,
source_ty: Ty<'tcx>,
target_ty: Ty<'tcx>,
) -> CustomCoerceUnsized {
- let def_id = tcx.require_lang_item(LangItem::CoerceUnsized, None);
-
- let trait_ref = ty::Binder::dummy(ty::TraitRef {
- def_id,
- substs: tcx.mk_substs_trait(source_ty, &[target_ty.into()]),
- });
+ let trait_ref =
+ ty::Binder::dummy(tcx.mk_trait_ref(LangItem::CoerceUnsized, [source_ty, target_ty]));
match tcx.codegen_select_candidate((ty::ParamEnv::reveal_all(), trait_ref)) {
Ok(traits::ImplSource::UserDefined(traits::ImplSourceUserDefinedData {