query_name_of_opt_const_arg -> query_name_opt_const_arg
This commit is contained in:
parent
536674fb69
commit
8160bfa39c
6 changed files with 10 additions and 10 deletions
|
@ -438,7 +438,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn promoted_mir_of_opt_const_arg(
|
pub fn promoted_mir_opt_const_arg(
|
||||||
self,
|
self,
|
||||||
def: ty::WithOptConstParam<DefId>,
|
def: ty::WithOptConstParam<DefId>,
|
||||||
) -> &'tcx IndexVec<Promoted, Body<'tcx>> {
|
) -> &'tcx IndexVec<Promoted, Body<'tcx>> {
|
||||||
|
@ -450,7 +450,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn optimized_mir_of_opt_const_arg(
|
pub fn optimized_mir_opt_const_arg(
|
||||||
self,
|
self,
|
||||||
def: ty::WithOptConstParam<DefId>,
|
def: ty::WithOptConstParam<DefId>,
|
||||||
) -> &'tcx Body<'tcx> {
|
) -> &'tcx Body<'tcx> {
|
||||||
|
@ -462,7 +462,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn mir_abstract_const_of_opt_const_arg(
|
pub fn mir_abstract_const_opt_const_arg(
|
||||||
self,
|
self,
|
||||||
def: ty::WithOptConstParam<DefId>,
|
def: ty::WithOptConstParam<DefId>,
|
||||||
) -> Result<Option<&'tcx [abstract_const::Node<'tcx>]>, ErrorReported> {
|
) -> Result<Option<&'tcx [abstract_const::Node<'tcx>]>, ErrorReported> {
|
||||||
|
|
|
@ -2953,7 +2953,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||||
/// Returns the possibly-auto-generated MIR of a `(DefId, Subst)` pair.
|
/// Returns the possibly-auto-generated MIR of a `(DefId, Subst)` pair.
|
||||||
pub fn instance_mir(self, instance: ty::InstanceDef<'tcx>) -> &'tcx Body<'tcx> {
|
pub fn instance_mir(self, instance: ty::InstanceDef<'tcx>) -> &'tcx Body<'tcx> {
|
||||||
match instance {
|
match instance {
|
||||||
ty::InstanceDef::Item(def) => self.optimized_mir_of_opt_const_arg(def),
|
ty::InstanceDef::Item(def) => self.optimized_mir_opt_const_arg(def),
|
||||||
ty::InstanceDef::VtableShim(..)
|
ty::InstanceDef::VtableShim(..)
|
||||||
| ty::InstanceDef::ReifyShim(..)
|
| ty::InstanceDef::ReifyShim(..)
|
||||||
| ty::InstanceDef::Intrinsic(..)
|
| ty::InstanceDef::Intrinsic(..)
|
||||||
|
|
|
@ -343,7 +343,7 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
|
||||||
// deny-by-default lint
|
// deny-by-default lint
|
||||||
_ => {
|
_ => {
|
||||||
if let Some(p) = cid.promoted {
|
if let Some(p) = cid.promoted {
|
||||||
let span = tcx.promoted_mir_of_opt_const_arg(def.to_global())[p].span;
|
let span = tcx.promoted_mir_opt_const_arg(def.to_global())[p].span;
|
||||||
if let err_inval!(ReferencedConstant) = err.error {
|
if let err_inval!(ReferencedConstant) = err.error {
|
||||||
Err(err.report_as_error(
|
Err(err.report_as_error(
|
||||||
tcx.at(span),
|
tcx.at(span),
|
||||||
|
|
|
@ -477,12 +477,12 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||||
}
|
}
|
||||||
trace!("load mir(instance={:?}, promoted={:?})", instance, promoted);
|
trace!("load mir(instance={:?}, promoted={:?})", instance, promoted);
|
||||||
if let Some(promoted) = promoted {
|
if let Some(promoted) = promoted {
|
||||||
return Ok(&self.tcx.promoted_mir_of_opt_const_arg(def)[promoted]);
|
return Ok(&self.tcx.promoted_mir_opt_const_arg(def)[promoted]);
|
||||||
}
|
}
|
||||||
match instance {
|
match instance {
|
||||||
ty::InstanceDef::Item(def) => {
|
ty::InstanceDef::Item(def) => {
|
||||||
if self.tcx.is_mir_available(def.did) {
|
if self.tcx.is_mir_available(def.did) {
|
||||||
Ok(self.tcx.optimized_mir_of_opt_const_arg(def))
|
Ok(self.tcx.optimized_mir_opt_const_arg(def))
|
||||||
} else {
|
} else {
|
||||||
throw_unsup!(NoMirFor(def.did))
|
throw_unsup!(NoMirFor(def.did))
|
||||||
}
|
}
|
||||||
|
|
|
@ -332,7 +332,7 @@ fn mir_promoted(
|
||||||
// this point, before we steal the mir-const result.
|
// this point, before we steal the mir-const result.
|
||||||
// Also this means promotion can rely on all const checks having been done.
|
// Also this means promotion can rely on all const checks having been done.
|
||||||
let _ = tcx.mir_const_qualif_opt_const_arg(def);
|
let _ = tcx.mir_const_qualif_opt_const_arg(def);
|
||||||
let _ = tcx.mir_abstract_const_of_opt_const_arg(def.to_global());
|
let _ = tcx.mir_abstract_const_opt_const_arg(def.to_global());
|
||||||
let mut body = tcx.mir_const(def).steal();
|
let mut body = tcx.mir_const(def).steal();
|
||||||
|
|
||||||
let mut required_consts = Vec::new();
|
let mut required_consts = Vec::new();
|
||||||
|
|
|
@ -147,7 +147,7 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
|
||||||
if concrete.is_ok() && substs.has_param_types_or_consts() {
|
if concrete.is_ok() && substs.has_param_types_or_consts() {
|
||||||
match infcx.tcx.def_kind(def.did) {
|
match infcx.tcx.def_kind(def.did) {
|
||||||
DefKind::AnonConst => {
|
DefKind::AnonConst => {
|
||||||
let mir_body = infcx.tcx.optimized_mir_of_opt_const_arg(def);
|
let mir_body = infcx.tcx.optimized_mir_opt_const_arg(def);
|
||||||
|
|
||||||
if mir_body.is_polymorphic {
|
if mir_body.is_polymorphic {
|
||||||
future_compat_lint();
|
future_compat_lint();
|
||||||
|
@ -208,7 +208,7 @@ impl AbstractConst<'tcx> {
|
||||||
def: ty::WithOptConstParam<DefId>,
|
def: ty::WithOptConstParam<DefId>,
|
||||||
substs: SubstsRef<'tcx>,
|
substs: SubstsRef<'tcx>,
|
||||||
) -> Result<Option<AbstractConst<'tcx>>, ErrorReported> {
|
) -> Result<Option<AbstractConst<'tcx>>, ErrorReported> {
|
||||||
let inner = tcx.mir_abstract_const_of_opt_const_arg(def)?;
|
let inner = tcx.mir_abstract_const_opt_const_arg(def)?;
|
||||||
Ok(inner.map(|inner| AbstractConst { inner, substs }))
|
Ok(inner.map(|inner| AbstractConst { inner, substs }))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue