diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
commit | 9835e2ae736235810b4ea1c162ca5e65c547e770 (patch) | |
tree | 3fcebf40ed70e581d776a8a4c65923e8ec20e026 /compiler/rustc_middle/src/mir/query.rs | |
parent | Releasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff) | |
download | rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip |
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_middle/src/mir/query.rs')
-rw-r--r-- | compiler/rustc_middle/src/mir/query.rs | 45 |
1 files changed, 3 insertions, 42 deletions
diff --git a/compiler/rustc_middle/src/mir/query.rs b/compiler/rustc_middle/src/mir/query.rs index cfdf1dcf5..53fd2dd23 100644 --- a/compiler/rustc_middle/src/mir/query.rs +++ b/compiler/rustc_middle/src/mir/query.rs @@ -1,14 +1,14 @@ //! Values computed by queries that use MIR. -use crate::mir::{Body, ConstantKind, Promoted}; +use crate::mir::ConstantKind; use crate::ty::{self, OpaqueHiddenType, Ty, TyCtxt}; use rustc_data_structures::fx::FxIndexMap; use rustc_data_structures::unord::UnordSet; use rustc_errors::ErrorGuaranteed; use rustc_hir as hir; -use rustc_hir::def_id::{DefId, LocalDefId}; +use rustc_hir::def_id::LocalDefId; use rustc_index::bit_set::BitMatrix; -use rustc_index::vec::{Idx, IndexVec}; +use rustc_index::{Idx, IndexVec}; use rustc_span::Span; use rustc_target::abi::{FieldIdx, VariantIdx}; use smallvec::SmallVec; @@ -454,42 +454,3 @@ pub struct CoverageInfo { /// The total number of coverage region counter expressions added to the MIR `Body`. pub num_expressions: u32, } - -/// Shims which make dealing with `WithOptConstParam` easier. -/// -/// For more information on why this is needed, consider looking -/// at the docs for `WithOptConstParam` itself. -impl<'tcx> TyCtxt<'tcx> { - #[inline] - pub fn mir_const_qualif_opt_const_arg( - self, - def: ty::WithOptConstParam<LocalDefId>, - ) -> ConstQualifs { - if let Some(param_did) = def.const_param_did { - self.mir_const_qualif_const_arg((def.did, param_did)) - } else { - self.mir_const_qualif(def.did) - } - } - - #[inline] - pub fn promoted_mir_opt_const_arg( - self, - def: ty::WithOptConstParam<DefId>, - ) -> &'tcx IndexVec<Promoted, Body<'tcx>> { - if let Some((did, param_did)) = def.as_const_arg() { - self.promoted_mir_of_const_arg((did, param_did)) - } else { - self.promoted_mir(def.did) - } - } - - #[inline] - pub fn mir_for_ctfe_opt_const_arg(self, def: ty::WithOptConstParam<DefId>) -> &'tcx Body<'tcx> { - if let Some((did, param_did)) = def.as_const_arg() { - self.mir_for_ctfe_of_const_arg((did, param_did)) - } else { - self.mir_for_ctfe(def.did) - } - } -} |