mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
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
@ -694,6 +694,7 @@ impl<'tcx> Instance<'tcx> {
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
// Keep me in sync with try_instantiate_mir_and_normalize_erasing_regions
|
||||
pub fn instantiate_mir_and_normalize_erasing_regions<T>(
|
||||
&self,
|
||||
tcx: TyCtxt<'tcx>,
|
||||
@ -701,16 +702,17 @@ impl<'tcx> Instance<'tcx> {
|
||||
v: EarlyBinder<T>,
|
||||
) -> T
|
||||
where
|
||||
T: TypeFoldable<TyCtxt<'tcx>> + Clone,
|
||||
T: TypeFoldable<TyCtxt<'tcx>>,
|
||||
{
|
||||
if let Some(args) = self.args_for_mir_body() {
|
||||
tcx.instantiate_and_normalize_erasing_regions(args, param_env, v)
|
||||
} else {
|
||||
tcx.normalize_erasing_regions(param_env, v.skip_binder())
|
||||
tcx.normalize_erasing_regions(param_env, v.instantiate_identity())
|
||||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
// Keep me in sync with instantiate_mir_and_normalize_erasing_regions
|
||||
pub fn try_instantiate_mir_and_normalize_erasing_regions<T>(
|
||||
&self,
|
||||
tcx: TyCtxt<'tcx>,
|
||||
|
Loading…
Reference in New Issue
Block a user