Skip to content

Commit 8160bfa

Browse files
committed
query_name_of_opt_const_arg -> query_name_opt_const_arg
1 parent 536674f commit 8160bfa

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

Diff for: compiler/rustc_middle/src/mir/query.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ impl<'tcx> TyCtxt<'tcx> {
438438
}
439439

440440
#[inline]
441-
pub fn promoted_mir_of_opt_const_arg(
441+
pub fn promoted_mir_opt_const_arg(
442442
self,
443443
def: ty::WithOptConstParam<DefId>,
444444
) -> &'tcx IndexVec<Promoted, Body<'tcx>> {
@@ -450,7 +450,7 @@ impl<'tcx> TyCtxt<'tcx> {
450450
}
451451

452452
#[inline]
453-
pub fn optimized_mir_of_opt_const_arg(
453+
pub fn optimized_mir_opt_const_arg(
454454
self,
455455
def: ty::WithOptConstParam<DefId>,
456456
) -> &'tcx Body<'tcx> {
@@ -462,7 +462,7 @@ impl<'tcx> TyCtxt<'tcx> {
462462
}
463463

464464
#[inline]
465-
pub fn mir_abstract_const_of_opt_const_arg(
465+
pub fn mir_abstract_const_opt_const_arg(
466466
self,
467467
def: ty::WithOptConstParam<DefId>,
468468
) -> Result<Option<&'tcx [abstract_const::Node<'tcx>]>, ErrorReported> {

Diff for: compiler/rustc_middle/src/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2953,7 +2953,7 @@ impl<'tcx> TyCtxt<'tcx> {
29532953
/// Returns the possibly-auto-generated MIR of a `(DefId, Subst)` pair.
29542954
pub fn instance_mir(self, instance: ty::InstanceDef<'tcx>) -> &'tcx Body<'tcx> {
29552955
match instance {
2956-
ty::InstanceDef::Item(def) => self.optimized_mir_of_opt_const_arg(def),
2956+
ty::InstanceDef::Item(def) => self.optimized_mir_opt_const_arg(def),
29572957
ty::InstanceDef::VtableShim(..)
29582958
| ty::InstanceDef::ReifyShim(..)
29592959
| ty::InstanceDef::Intrinsic(..)

Diff for: compiler/rustc_mir/src/const_eval/eval_queries.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
343343
// deny-by-default lint
344344
_ => {
345345
if let Some(p) = cid.promoted {
346-
let span = tcx.promoted_mir_of_opt_const_arg(def.to_global())[p].span;
346+
let span = tcx.promoted_mir_opt_const_arg(def.to_global())[p].span;
347347
if let err_inval!(ReferencedConstant) = err.error {
348348
Err(err.report_as_error(
349349
tcx.at(span),

Diff for: compiler/rustc_mir/src/interpret/eval_context.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,12 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
477477
}
478478
trace!("load mir(instance={:?}, promoted={:?})", instance, promoted);
479479
if let Some(promoted) = promoted {
480-
return Ok(&self.tcx.promoted_mir_of_opt_const_arg(def)[promoted]);
480+
return Ok(&self.tcx.promoted_mir_opt_const_arg(def)[promoted]);
481481
}
482482
match instance {
483483
ty::InstanceDef::Item(def) => {
484484
if self.tcx.is_mir_available(def.did) {
485-
Ok(self.tcx.optimized_mir_of_opt_const_arg(def))
485+
Ok(self.tcx.optimized_mir_opt_const_arg(def))
486486
} else {
487487
throw_unsup!(NoMirFor(def.did))
488488
}

Diff for: compiler/rustc_mir/src/transform/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ fn mir_promoted(
332332
// this point, before we steal the mir-const result.
333333
// Also this means promotion can rely on all const checks having been done.
334334
let _ = tcx.mir_const_qualif_opt_const_arg(def);
335-
let _ = tcx.mir_abstract_const_of_opt_const_arg(def.to_global());
335+
let _ = tcx.mir_abstract_const_opt_const_arg(def.to_global());
336336
let mut body = tcx.mir_const(def).steal();
337337

338338
let mut required_consts = Vec::new();

Diff for: compiler/rustc_trait_selection/src/traits/const_evaluatable.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
147147
if concrete.is_ok() && substs.has_param_types_or_consts() {
148148
match infcx.tcx.def_kind(def.did) {
149149
DefKind::AnonConst => {
150-
let mir_body = infcx.tcx.optimized_mir_of_opt_const_arg(def);
150+
let mir_body = infcx.tcx.optimized_mir_opt_const_arg(def);
151151

152152
if mir_body.is_polymorphic {
153153
future_compat_lint();
@@ -208,7 +208,7 @@ impl AbstractConst<'tcx> {
208208
def: ty::WithOptConstParam<DefId>,
209209
substs: SubstsRef<'tcx>,
210210
) -> Result<Option<AbstractConst<'tcx>>, ErrorReported> {
211-
let inner = tcx.mir_abstract_const_of_opt_const_arg(def)?;
211+
let inner = tcx.mir_abstract_const_opt_const_arg(def)?;
212212
Ok(inner.map(|inner| AbstractConst { inner, substs }))
213213
}
214214

0 commit comments

Comments
 (0)