use GlobalId in eval_to_valtree query and introduce query for valtree_to_const_val

This commit is contained in:
b-naber
2022-04-12 18:14:28 +02:00
parent 56d540e057
commit 96b36d6eb2
27 changed files with 541 additions and 245 deletions

View File

@@ -1,6 +1,6 @@
//! Values computed by queries that use MIR.
use crate::mir::{Body, Promoted};
use crate::mir::{self, Body, Promoted};
use crate::ty::{self, OpaqueHiddenType, Ty, TyCtxt};
use rustc_data_structures::stable_map::FxHashMap;
use rustc_data_structures::vec_map::VecMap;
@@ -413,13 +413,20 @@ pub enum ClosureOutlivesSubject<'tcx> {
Region(ty::RegionVid),
}
/// The constituent parts of an ADT or array.
/// The constituent parts of a type level constant of kind ADT or array.
#[derive(Copy, Clone, Debug, HashStable)]
pub struct DestructuredConst<'tcx> {
pub variant: Option<VariantIdx>,
pub fields: &'tcx [ty::Const<'tcx>],
}
/// The constituent parts of a mir constant of kind ADT or array.
#[derive(Copy, Clone, Debug, HashStable)]
pub struct DestructuredMirConstant<'tcx> {
pub variant: Option<VariantIdx>,
pub fields: &'tcx [mir::ConstantKind<'tcx>],
}
/// Coverage information summarized from a MIR if instrumented for source code coverage (see
/// compiler option `-Cinstrument-coverage`). This information is generated by the
/// `InstrumentCoverage` MIR pass and can be retrieved via the `coverageinfo` query.