Rollup merge of #122141 - klensy:sync-me, r=lcnr
sync (try_)instantiate_mir_and_normalize_erasing_regions implementation
`try_instantiate_mir_and_normalize_erasing_regions` was changed in dbc2cc8717
, but not `instantiate_mir_and_normalize_erasing_regions`, sync them.
see https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/instantiate_mir_and_normalize_erasing_regions.20vs.20try_*.20ver
r? `@lcnr`
This commit is contained in:
commit
010fc20215
1 changed files with 4 additions and 2 deletions
|
@ -694,6 +694,7 @@ impl<'tcx> Instance<'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
|
// Keep me in sync with try_instantiate_mir_and_normalize_erasing_regions
|
||||||
pub fn instantiate_mir_and_normalize_erasing_regions<T>(
|
pub fn instantiate_mir_and_normalize_erasing_regions<T>(
|
||||||
&self,
|
&self,
|
||||||
tcx: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
|
@ -701,16 +702,17 @@ impl<'tcx> Instance<'tcx> {
|
||||||
v: EarlyBinder<T>,
|
v: EarlyBinder<T>,
|
||||||
) -> T
|
) -> T
|
||||||
where
|
where
|
||||||
T: TypeFoldable<TyCtxt<'tcx>> + Clone,
|
T: TypeFoldable<TyCtxt<'tcx>>,
|
||||||
{
|
{
|
||||||
if let Some(args) = self.args_for_mir_body() {
|
if let Some(args) = self.args_for_mir_body() {
|
||||||
tcx.instantiate_and_normalize_erasing_regions(args, param_env, v)
|
tcx.instantiate_and_normalize_erasing_regions(args, param_env, v)
|
||||||
} else {
|
} else {
|
||||||
tcx.normalize_erasing_regions(param_env, v.skip_binder())
|
tcx.normalize_erasing_regions(param_env, v.instantiate_identity())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
|
// Keep me in sync with instantiate_mir_and_normalize_erasing_regions
|
||||||
pub fn try_instantiate_mir_and_normalize_erasing_regions<T>(
|
pub fn try_instantiate_mir_and_normalize_erasing_regions<T>(
|
||||||
&self,
|
&self,
|
||||||
tcx: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue