about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/monomorphize
diff options
context:
space:
mode:
authorJack Huey <jack.huey@umassmed.edu>2021-01-07 00:41:55 -0500
committerJack Huey <jack.huey@umassmed.edu>2021-03-31 10:05:32 -0400
commit4955d755d3ffdfecfd2c22139c65fe1a10d60939 (patch)
tree4dedeed4ed4c636d226c13752898ee548d8b4c56 /compiler/rustc_mir/src/monomorphize
parenta5029ac0ab372aec515db2e718da6d7787f3d122 (diff)
Some rebinds and dummys
Diffstat (limited to 'compiler/rustc_mir/src/monomorphize')
-rw-r--r--compiler/rustc_mir/src/monomorphize/mod.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_mir/src/monomorphize/mod.rs b/compiler/rustc_mir/src/monomorphize/mod.rs
index d2586f0f84d..fd3f3b3a080 100644
--- a/compiler/rustc_mir/src/monomorphize/mod.rs
+++ b/compiler/rustc_mir/src/monomorphize/mod.rs
@@ -1,6 +1,6 @@
 use rustc_middle::traits;
 use rustc_middle::ty::adjustment::CustomCoerceUnsized;
-use rustc_middle::ty::{self, Ty, TyCtxt};
+use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable};
 
 use rustc_hir::lang_items::LangItem;
 
@@ -8,14 +8,16 @@ pub mod collector;
 pub mod partitioning;
 pub mod polymorphize;
 
-pub fn custom_coerce_unsize_info<'tcx>(
+fn custom_coerce_unsize_info<'tcx>(
     tcx: TyCtxt<'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::bind(ty::TraitRef {
+    debug_assert!(!source_ty.has_escaping_bound_vars());
+    debug_assert!(!target_ty.has_escaping_bound_vars());
+    let trait_ref = ty::Binder::dummy(ty::TraitRef {
         def_id,
         substs: tcx.mk_substs_trait(source_ty, &[target_ty.into()]),
     });