1
Fork 0

Simplify the optimize_mir query

This commit is contained in:
oli 2020-10-28 13:49:10 +00:00
parent 1f5fb3e056
commit eb4e94b2e5
3 changed files with 11 additions and 19 deletions

View file

@ -439,7 +439,7 @@ impl<'tcx> TyCtxt<'tcx> {
}
#[inline]
pub fn optimized_mir_opt_const_arg(
pub fn optimized_mir_or_const_arg_mir(
self,
def: ty::WithOptConstParam<DefId>,
) -> &'tcx Body<'tcx> {

View file

@ -3018,7 +3018,7 @@ impl<'tcx> TyCtxt<'tcx> {
| DefKind::AnonConst => self.mir_for_ctfe_opt_const_arg(def),
// If the caller wants `mir_for_ctfe` they should not be using `instance_mir`, so
// we'll assume const fn also wants the optimized version.
_ => self.optimized_mir_opt_const_arg(def),
_ => self.optimized_mir_or_const_arg_mir(def),
},
ty::InstanceDef::VtableShim(..)
| ty::InstanceDef::ReifyShim(..)