Revert "Auto merge of #93800 - b-naber:static-initializers-mir-val, r=oli-obk"
This reverts commit a240ccd81c74c105b6f5fe84c46f8d36edb7e306, reversing changes made to 393fdc10483da930cdbb00eabc3635030d2e776f. This PR was likely responsible for a relatively large regression in dist-x86_64-msvc-alt builder times, from approximately 1.7 to 2.8 hours, bringing that builder into the pool of the slowest builders we currently have. This seems to be limited to the alt builder due to needing parallel-compiler enabled, likely leading to slow LLVM compilation for some reason.
This commit is contained in:
parent
45e2c2881d
commit
9f76214854
@ -2533,7 +2533,7 @@ pub enum ConstantKind<'tcx> {
|
|||||||
|
|
||||||
impl<'tcx> Constant<'tcx> {
|
impl<'tcx> Constant<'tcx> {
|
||||||
pub fn check_static_ptr(&self, tcx: TyCtxt<'_>) -> Option<DefId> {
|
pub fn check_static_ptr(&self, tcx: TyCtxt<'_>) -> Option<DefId> {
|
||||||
match self.literal.try_to_scalar() {
|
match self.literal.const_for_ty()?.val().try_to_scalar() {
|
||||||
Some(Scalar::Ptr(ptr, _size)) => match tcx.global_alloc(ptr.provenance) {
|
Some(Scalar::Ptr(ptr, _size)) => match tcx.global_alloc(ptr.provenance) {
|
||||||
GlobalAlloc::Static(def_id) => {
|
GlobalAlloc::Static(def_id) => {
|
||||||
assert!(!tcx.is_thread_local_static(def_id));
|
assert!(!tcx.is_thread_local_static(def_id));
|
||||||
|
@ -17,8 +17,9 @@ use rustc_middle::mir::interpret::{
|
|||||||
use rustc_middle::mir::visit::Visitor;
|
use rustc_middle::mir::visit::Visitor;
|
||||||
use rustc_middle::mir::MirSource;
|
use rustc_middle::mir::MirSource;
|
||||||
use rustc_middle::mir::*;
|
use rustc_middle::mir::*;
|
||||||
use rustc_middle::ty::{self, TyCtxt};
|
use rustc_middle::ty::{self, TyCtxt, TypeFoldable, TypeVisitor};
|
||||||
use rustc_target::abi::Size;
|
use rustc_target::abi::Size;
|
||||||
|
use std::ops::ControlFlow;
|
||||||
|
|
||||||
const INDENT: &str = " ";
|
const INDENT: &str = " ";
|
||||||
/// Alignment for lining up comments following MIR statements
|
/// Alignment for lining up comments following MIR statements
|
||||||
@ -663,7 +664,6 @@ pub fn write_allocations<'tcx>(
|
|||||||
fn alloc_ids_from_alloc(alloc: &Allocation) -> impl DoubleEndedIterator<Item = AllocId> + '_ {
|
fn alloc_ids_from_alloc(alloc: &Allocation) -> impl DoubleEndedIterator<Item = AllocId> + '_ {
|
||||||
alloc.relocations().values().map(|id| *id)
|
alloc.relocations().values().map(|id| *id)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn alloc_ids_from_const(val: ConstValue<'_>) -> impl Iterator<Item = AllocId> + '_ {
|
fn alloc_ids_from_const(val: ConstValue<'_>) -> impl Iterator<Item = AllocId> + '_ {
|
||||||
match val {
|
match val {
|
||||||
ConstValue::Scalar(interpret::Scalar::Ptr(ptr, _size)) => {
|
ConstValue::Scalar(interpret::Scalar::Ptr(ptr, _size)) => {
|
||||||
@ -677,29 +677,17 @@ pub fn write_allocations<'tcx>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct CollectAllocIds(BTreeSet<AllocId>);
|
struct CollectAllocIds(BTreeSet<AllocId>);
|
||||||
|
impl<'tcx> TypeVisitor<'tcx> for CollectAllocIds {
|
||||||
impl<'tcx> Visitor<'tcx> for CollectAllocIds {
|
fn visit_const(&mut self, c: ty::Const<'tcx>) -> ControlFlow<Self::BreakTy> {
|
||||||
fn visit_const(&mut self, c: ty::Const<'tcx>, _loc: Location) {
|
|
||||||
if let ty::ConstKind::Value(val) = c.val() {
|
if let ty::ConstKind::Value(val) = c.val() {
|
||||||
self.0.extend(alloc_ids_from_const(val));
|
self.0.extend(alloc_ids_from_const(val));
|
||||||
}
|
}
|
||||||
}
|
c.super_visit_with(self)
|
||||||
|
|
||||||
fn visit_constant(&mut self, c: &Constant<'tcx>, loc: Location) {
|
|
||||||
match c.literal {
|
|
||||||
ConstantKind::Ty(c) => self.visit_const(c, loc),
|
|
||||||
ConstantKind::Val(val, _) => {
|
|
||||||
self.0.extend(alloc_ids_from_const(val));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut visitor = CollectAllocIds(Default::default());
|
let mut visitor = CollectAllocIds(Default::default());
|
||||||
visitor.visit_body(body);
|
body.visit_with(&mut visitor);
|
||||||
|
|
||||||
// `seen` contains all seen allocations, including the ones we have *not* printed yet.
|
// `seen` contains all seen allocations, including the ones we have *not* printed yet.
|
||||||
// The protocol is to first `insert` into `seen`, and only if that returns `true`
|
// The protocol is to first `insert` into `seen`, and only if that returns `true`
|
||||||
// then push to `todo`.
|
// then push to `todo`.
|
||||||
|
@ -17,7 +17,6 @@ use rustc_index::newtype_index;
|
|||||||
use rustc_index::vec::IndexVec;
|
use rustc_index::vec::IndexVec;
|
||||||
use rustc_middle::infer::canonical::Canonical;
|
use rustc_middle::infer::canonical::Canonical;
|
||||||
use rustc_middle::middle::region;
|
use rustc_middle::middle::region;
|
||||||
use rustc_middle::mir::interpret::AllocId;
|
|
||||||
use rustc_middle::mir::{
|
use rustc_middle::mir::{
|
||||||
BinOp, BorrowKind, FakeReadCause, Field, Mutability, UnOp, UserTypeProjection,
|
BinOp, BorrowKind, FakeReadCause, Field, Mutability, UnOp, UserTypeProjection,
|
||||||
};
|
};
|
||||||
@ -420,8 +419,7 @@ pub enum ExprKind<'tcx> {
|
|||||||
/// This is only distinguished from `Literal` so that we can register some
|
/// This is only distinguished from `Literal` so that we can register some
|
||||||
/// info for diagnostics.
|
/// info for diagnostics.
|
||||||
StaticRef {
|
StaticRef {
|
||||||
alloc_id: AllocId,
|
literal: Const<'tcx>,
|
||||||
ty: Ty<'tcx>,
|
|
||||||
def_id: DefId,
|
def_id: DefId,
|
||||||
},
|
},
|
||||||
/// Inline assembly, i.e. `asm!()`.
|
/// Inline assembly, i.e. `asm!()`.
|
||||||
|
@ -123,7 +123,7 @@ pub fn walk_expr<'a, 'tcx: 'a, V: Visitor<'a, 'tcx>>(visitor: &mut V, expr: &Exp
|
|||||||
}
|
}
|
||||||
Closure { closure_id: _, substs: _, upvars: _, movability: _, fake_reads: _ } => {}
|
Closure { closure_id: _, substs: _, upvars: _, movability: _, fake_reads: _ } => {}
|
||||||
Literal { literal, user_ty: _, const_id: _ } => visitor.visit_const(literal),
|
Literal { literal, user_ty: _, const_id: _ } => visitor.visit_const(literal),
|
||||||
StaticRef { .. } => {}
|
StaticRef { literal, def_id: _ } => visitor.visit_const(literal),
|
||||||
InlineAsm { ref operands, template: _, options: _, line_spans: _ } => {
|
InlineAsm { ref operands, template: _, options: _, line_spans: _ } => {
|
||||||
for op in &**operands {
|
for op in &**operands {
|
||||||
use InlineAsmOperand::*;
|
use InlineAsmOperand::*;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
//! See docs in build/expr/mod.rs
|
//! See docs in build/expr/mod.rs
|
||||||
|
|
||||||
use crate::build::Builder;
|
use crate::build::Builder;
|
||||||
use rustc_middle::mir::interpret::{ConstValue, Scalar};
|
|
||||||
use rustc_middle::mir::*;
|
use rustc_middle::mir::*;
|
||||||
use rustc_middle::thir::*;
|
use rustc_middle::thir::*;
|
||||||
use rustc_middle::ty::CanonicalUserTypeAnnotation;
|
use rustc_middle::ty::CanonicalUserTypeAnnotation;
|
||||||
@ -27,12 +26,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||||||
assert_eq!(literal.ty(), ty);
|
assert_eq!(literal.ty(), ty);
|
||||||
Constant { span, user_ty, literal: literal.into() }
|
Constant { span, user_ty, literal: literal.into() }
|
||||||
}
|
}
|
||||||
ExprKind::StaticRef { alloc_id, ty, .. } => {
|
ExprKind::StaticRef { literal, .. } => {
|
||||||
let const_val =
|
Constant { span, user_ty: None, literal: literal.into() }
|
||||||
ConstValue::Scalar(Scalar::from_pointer(alloc_id.into(), &this.tcx));
|
|
||||||
let literal = ConstantKind::Val(const_val, ty);
|
|
||||||
|
|
||||||
Constant { span, user_ty: None, literal }
|
|
||||||
}
|
}
|
||||||
ExprKind::ConstBlock { value } => {
|
ExprKind::ConstBlock { value } => {
|
||||||
Constant { span: span, user_ty: None, literal: value.into() }
|
Constant { span: span, user_ty: None, literal: value.into() }
|
||||||
|
@ -8,6 +8,7 @@ use rustc_middle::hir::place::Place as HirPlace;
|
|||||||
use rustc_middle::hir::place::PlaceBase as HirPlaceBase;
|
use rustc_middle::hir::place::PlaceBase as HirPlaceBase;
|
||||||
use rustc_middle::hir::place::ProjectionKind as HirProjectionKind;
|
use rustc_middle::hir::place::ProjectionKind as HirProjectionKind;
|
||||||
use rustc_middle::middle::region;
|
use rustc_middle::middle::region;
|
||||||
|
use rustc_middle::mir::interpret::Scalar;
|
||||||
use rustc_middle::mir::{BinOp, BorrowKind, Field, UnOp};
|
use rustc_middle::mir::{BinOp, BorrowKind, Field, UnOp};
|
||||||
use rustc_middle::thir::*;
|
use rustc_middle::thir::*;
|
||||||
use rustc_middle::ty::adjustment::{
|
use rustc_middle::ty::adjustment::{
|
||||||
@ -940,8 +941,15 @@ impl<'tcx> Cx<'tcx> {
|
|||||||
let kind = if self.tcx.is_thread_local_static(id) {
|
let kind = if self.tcx.is_thread_local_static(id) {
|
||||||
ExprKind::ThreadLocalRef(id)
|
ExprKind::ThreadLocalRef(id)
|
||||||
} else {
|
} else {
|
||||||
let alloc_id = self.tcx.create_static_alloc(id);
|
let ptr = self.tcx.create_static_alloc(id);
|
||||||
ExprKind::StaticRef { alloc_id, ty, def_id: id }
|
ExprKind::StaticRef {
|
||||||
|
literal: ty::Const::from_scalar(
|
||||||
|
self.tcx,
|
||||||
|
Scalar::from_pointer(ptr.into(), &self.tcx),
|
||||||
|
ty,
|
||||||
|
),
|
||||||
|
def_id: id,
|
||||||
|
}
|
||||||
};
|
};
|
||||||
ExprKind::Deref {
|
ExprKind::Deref {
|
||||||
arg: self.thir.exprs.push(Expr { ty, temp_lifetime, span: expr.span, kind }),
|
arg: self.thir.exprs.push(Expr { ty, temp_lifetime, span: expr.span, kind }),
|
||||||
|
@ -9,9 +9,12 @@ fn main() -> () {
|
|||||||
StorageLive(_1); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
|
StorageLive(_1); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
|
||||||
StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
|
StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
|
||||||
_2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
|
_2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
|
||||||
|
// ty::Const
|
||||||
|
// + ty: &&[(std::option::Option<i32>, &[&str])]
|
||||||
|
// + val: Value(Scalar(alloc1))
|
||||||
// mir::Constant
|
// mir::Constant
|
||||||
// + span: $DIR/const_allocation.rs:8:5: 8:8
|
// + span: $DIR/const_allocation.rs:8:5: 8:8
|
||||||
// + literal: Const { ty: &&[(Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
|
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
|
||||||
_1 = (*_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
|
_1 = (*_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
|
||||||
StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
|
StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
|
||||||
StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
|
StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
|
||||||
|
@ -9,9 +9,12 @@ fn main() -> () {
|
|||||||
StorageLive(_1); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
|
StorageLive(_1); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
|
||||||
StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
|
StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
|
||||||
_2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
|
_2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
|
||||||
|
// ty::Const
|
||||||
|
// + ty: &&[(std::option::Option<i32>, &[&str])]
|
||||||
|
// + val: Value(Scalar(alloc1))
|
||||||
// mir::Constant
|
// mir::Constant
|
||||||
// + span: $DIR/const_allocation.rs:8:5: 8:8
|
// + span: $DIR/const_allocation.rs:8:5: 8:8
|
||||||
// + literal: Const { ty: &&[(Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
|
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
|
||||||
_1 = (*_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
|
_1 = (*_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
|
||||||
StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
|
StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
|
||||||
StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
|
StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
|
||||||
|
@ -9,9 +9,12 @@ fn main() -> () {
|
|||||||
StorageLive(_1); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
|
StorageLive(_1); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
|
||||||
StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
|
StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
|
||||||
_2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
|
_2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
|
||||||
|
// ty::Const
|
||||||
|
// + ty: &&[(std::option::Option<i32>, &[&u8])]
|
||||||
|
// + val: Value(Scalar(alloc1))
|
||||||
// mir::Constant
|
// mir::Constant
|
||||||
// + span: $DIR/const_allocation2.rs:5:5: 5:8
|
// + span: $DIR/const_allocation2.rs:5:5: 5:8
|
||||||
// + literal: Const { ty: &&[(Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
|
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
|
||||||
_1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
|
_1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
|
||||||
StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
|
StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
|
||||||
StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
|
StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
|
||||||
|
@ -9,9 +9,12 @@ fn main() -> () {
|
|||||||
StorageLive(_1); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
|
StorageLive(_1); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
|
||||||
StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
|
StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
|
||||||
_2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
|
_2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
|
||||||
|
// ty::Const
|
||||||
|
// + ty: &&[(std::option::Option<i32>, &[&u8])]
|
||||||
|
// + val: Value(Scalar(alloc1))
|
||||||
// mir::Constant
|
// mir::Constant
|
||||||
// + span: $DIR/const_allocation2.rs:5:5: 5:8
|
// + span: $DIR/const_allocation2.rs:5:5: 5:8
|
||||||
// + literal: Const { ty: &&[(Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
|
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
|
||||||
_1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
|
_1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
|
||||||
StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
|
StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
|
||||||
StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
|
StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
|
||||||
|
@ -9,6 +9,9 @@ fn main() -> () {
|
|||||||
StorageLive(_1); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
|
StorageLive(_1); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
|
||||||
StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
|
StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
|
||||||
_2 = const {alloc1: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
|
_2 = const {alloc1: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
|
||||||
|
// ty::Const
|
||||||
|
// + ty: &&Packed
|
||||||
|
// + val: Value(Scalar(alloc1))
|
||||||
// mir::Constant
|
// mir::Constant
|
||||||
// + span: $DIR/const_allocation3.rs:5:5: 5:8
|
// + span: $DIR/const_allocation3.rs:5:5: 5:8
|
||||||
// + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) }
|
// + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) }
|
||||||
|
@ -9,6 +9,9 @@ fn main() -> () {
|
|||||||
StorageLive(_1); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
|
StorageLive(_1); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
|
||||||
StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
|
StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
|
||||||
_2 = const {alloc1: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
|
_2 = const {alloc1: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
|
||||||
|
// ty::Const
|
||||||
|
// + ty: &&Packed
|
||||||
|
// + val: Value(Scalar(alloc1))
|
||||||
// mir::Constant
|
// mir::Constant
|
||||||
// + span: $DIR/const_allocation3.rs:5:5: 5:8
|
// + span: $DIR/const_allocation3.rs:5:5: 5:8
|
||||||
// + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) }
|
// + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) }
|
||||||
|
@ -8,6 +8,9 @@ promoted[0] in BAR: &[&i32; 1] = {
|
|||||||
|
|
||||||
bb0: {
|
bb0: {
|
||||||
_3 = const {alloc1: &i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
|
_3 = const {alloc1: &i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
|
||||||
|
// ty::Const
|
||||||
|
// + ty: &i32
|
||||||
|
// + val: Value(Scalar(alloc1))
|
||||||
// mir::Constant
|
// mir::Constant
|
||||||
// + span: $DIR/const-promotion-extern-static.rs:9:33: 9:34
|
// + span: $DIR/const-promotion-extern-static.rs:9:33: 9:34
|
||||||
// + literal: Const { ty: &i32, val: Value(Scalar(alloc1)) }
|
// + literal: Const { ty: &i32, val: Value(Scalar(alloc1)) }
|
||||||
|
@ -18,7 +18,9 @@
|
|||||||
- StorageLive(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
|
- StorageLive(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
|
||||||
- _5 = const {alloc1: &i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
|
- _5 = const {alloc1: &i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
|
||||||
+ _6 = const BAR::promoted[0]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
|
+ _6 = const BAR::promoted[0]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
|
||||||
+ // ty::Const
|
// ty::Const
|
||||||
|
- // + ty: &i32
|
||||||
|
- // + val: Value(Scalar(alloc1))
|
||||||
+ // + ty: &[&i32; 1]
|
+ // + ty: &[&i32; 1]
|
||||||
+ // + val: Unevaluated(BAR, [], Some(promoted[0]))
|
+ // + val: Unevaluated(BAR, [], Some(promoted[0]))
|
||||||
// mir::Constant
|
// mir::Constant
|
||||||
|
@ -8,6 +8,9 @@ promoted[0] in FOO: &[&i32; 1] = {
|
|||||||
|
|
||||||
bb0: {
|
bb0: {
|
||||||
_3 = const {alloc3: *const i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
|
_3 = const {alloc3: *const i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
|
||||||
|
// ty::Const
|
||||||
|
// + ty: *const i32
|
||||||
|
// + val: Value(Scalar(alloc3))
|
||||||
// mir::Constant
|
// mir::Constant
|
||||||
// + span: $DIR/const-promotion-extern-static.rs:13:42: 13:43
|
// + span: $DIR/const-promotion-extern-static.rs:13:42: 13:43
|
||||||
// + literal: Const { ty: *const i32, val: Value(Scalar(alloc3)) }
|
// + literal: Const { ty: *const i32, val: Value(Scalar(alloc3)) }
|
||||||
|
@ -20,7 +20,9 @@
|
|||||||
- StorageLive(_5); // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
|
- StorageLive(_5); // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
|
||||||
- _5 = const {alloc3: *const i32}; // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
|
- _5 = const {alloc3: *const i32}; // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
|
||||||
+ _6 = const FOO::promoted[0]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
|
+ _6 = const FOO::promoted[0]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
|
||||||
+ // ty::Const
|
// ty::Const
|
||||||
|
- // + ty: *const i32
|
||||||
|
- // + val: Value(Scalar(alloc3))
|
||||||
+ // + ty: &[&i32; 1]
|
+ // + ty: &[&i32; 1]
|
||||||
+ // + val: Unevaluated(FOO, [], Some(promoted[0]))
|
+ // + val: Unevaluated(FOO, [], Some(promoted[0]))
|
||||||
// mir::Constant
|
// mir::Constant
|
||||||
|
@ -24,6 +24,9 @@
|
|||||||
StorageLive(_3); // scope 2 at $DIR/mutable_variable_no_prop.rs:9:13: 9:19
|
StorageLive(_3); // scope 2 at $DIR/mutable_variable_no_prop.rs:9:13: 9:19
|
||||||
StorageLive(_4); // scope 2 at $DIR/mutable_variable_no_prop.rs:9:13: 9:19
|
StorageLive(_4); // scope 2 at $DIR/mutable_variable_no_prop.rs:9:13: 9:19
|
||||||
_4 = const {alloc1: *mut u32}; // scope 2 at $DIR/mutable_variable_no_prop.rs:9:13: 9:19
|
_4 = const {alloc1: *mut u32}; // scope 2 at $DIR/mutable_variable_no_prop.rs:9:13: 9:19
|
||||||
|
// ty::Const
|
||||||
|
// + ty: *mut u32
|
||||||
|
// + val: Value(Scalar(alloc1))
|
||||||
// mir::Constant
|
// mir::Constant
|
||||||
// + span: $DIR/mutable_variable_no_prop.rs:9:13: 9:19
|
// + span: $DIR/mutable_variable_no_prop.rs:9:13: 9:19
|
||||||
// + literal: Const { ty: *mut u32, val: Value(Scalar(alloc1)) }
|
// + literal: Const { ty: *mut u32, val: Value(Scalar(alloc1)) }
|
||||||
|
@ -17,6 +17,9 @@
|
|||||||
StorageLive(_2); // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
|
StorageLive(_2); // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
|
||||||
StorageLive(_3); // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
|
StorageLive(_3); // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
|
||||||
_3 = const {alloc1: &u8}; // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
|
_3 = const {alloc1: &u8}; // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
|
||||||
|
// ty::Const
|
||||||
|
// + ty: &u8
|
||||||
|
// + val: Value(Scalar(alloc1))
|
||||||
// mir::Constant
|
// mir::Constant
|
||||||
// + span: $DIR/read_immutable_static.rs:7:13: 7:16
|
// + span: $DIR/read_immutable_static.rs:7:13: 7:16
|
||||||
// + literal: Const { ty: &u8, val: Value(Scalar(alloc1)) }
|
// + literal: Const { ty: &u8, val: Value(Scalar(alloc1)) }
|
||||||
@ -25,6 +28,9 @@
|
|||||||
StorageLive(_4); // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
|
StorageLive(_4); // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
|
||||||
StorageLive(_5); // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
|
StorageLive(_5); // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
|
||||||
_5 = const {alloc1: &u8}; // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
|
_5 = const {alloc1: &u8}; // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
|
||||||
|
// ty::Const
|
||||||
|
// + ty: &u8
|
||||||
|
// + val: Value(Scalar(alloc1))
|
||||||
// mir::Constant
|
// mir::Constant
|
||||||
// + span: $DIR/read_immutable_static.rs:7:19: 7:22
|
// + span: $DIR/read_immutable_static.rs:7:19: 7:22
|
||||||
// + literal: Const { ty: &u8, val: Value(Scalar(alloc1)) }
|
// + literal: Const { ty: &u8, val: Value(Scalar(alloc1)) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user