about summary refs log tree commit diff
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.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/compiler/rustc_monomorphize/src/lib.rs b/compiler/rustc_monomorphize/src/lib.rs
index 8eb489bb596..616620edc09 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,13 +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(tcx.mk_trait_ref(def_id, source_ty, [target_ty.into()]));
+    let trait_ref =
+        ty::Binder::dummy(tcx.mk_trait_ref(LangItem::CoerceUnsized, source_ty, [target_ty.into()]));
 
     match tcx.codegen_select_candidate((ty::ParamEnv::reveal_all(), trait_ref)) {
         Ok(traits::ImplSource::UserDefined(traits::ImplSourceUserDefinedData {