1
Fork 0

Some rebinds and dummys

This commit is contained in:
Jack Huey 2021-01-07 00:41:55 -05:00
parent a5029ac0ab
commit 4955d755d3
9 changed files with 29 additions and 20 deletions

View file

@ -2028,7 +2028,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
traits::ObligationCauseCode::RepeatVec(is_const_fn),
),
self.param_env,
ty::Binder::bind(ty::TraitRef::new(
ty::Binder::dummy(ty::TraitRef::new(
self.tcx().require_lang_item(
LangItem::Copy,
Some(self.last_span),

View file

@ -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()]),
});