Skip to content

Commit d7b282b

Browse files
committed
Auto merge of #94059 - b-naber:constantkind-val-transformation, r=lcnr
Treat constant values as mir::ConstantKind::Val Another step that is necessary for the introduction of Valtrees: we don't want to treat `ty::Const` instances of kind `ty::ConstKind::Value` as `mir::ConstantKind::Ty` anymore. r? `@oli-obk`
2 parents 01ad0ad + 021c3b0 commit d7b282b

File tree

17 files changed

+95
-36
lines changed

17 files changed

+95
-36
lines changed

compiler/rustc_const_eval/src/interpret/eval_context.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ pub enum StackPopCleanup {
164164
}
165165

166166
/// State of a local variable including a memoized layout
167-
#[derive(Clone, PartialEq, Eq, HashStable)]
167+
#[derive(Clone, Debug, PartialEq, Eq, HashStable)]
168168
pub struct LocalState<'tcx, Tag: Provenance = AllocId> {
169169
pub value: LocalValue<Tag>,
170170
/// Don't modify if `Some`, this is only used to prevent computing the layout twice
@@ -714,13 +714,15 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
714714
self.size_and_align_of(&mplace.meta, &mplace.layout)
715715
}
716716

717+
#[instrument(skip(self, body, return_place, return_to_block), level = "debug")]
717718
pub fn push_stack_frame(
718719
&mut self,
719720
instance: ty::Instance<'tcx>,
720721
body: &'mir mir::Body<'tcx>,
721722
return_place: Option<&PlaceTy<'tcx, M::PointerTag>>,
722723
return_to_block: StackPopCleanup,
723724
) -> InterpResult<'tcx> {
725+
debug!("body: {:#?}", body);
724726
// first push a stack frame so we have access to the local substs
725727
let pre_frame = Frame {
726728
body,
@@ -824,6 +826,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
824826
/// `Drop` impls for any locals that have been initialized at this point.
825827
/// The cleanup block ends with a special `Resume` terminator, which will
826828
/// cause us to continue unwinding.
829+
#[instrument(skip(self), level = "debug")]
827830
pub(super) fn pop_stack_frame(&mut self, unwinding: bool) -> InterpResult<'tcx> {
828831
info!(
829832
"popping stack frame ({})",
@@ -876,6 +879,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
876879
return Ok(());
877880
}
878881

882+
debug!("locals: {:#?}", frame.locals);
883+
879884
// Cleanup: deallocate all locals that are backed by an allocation.
880885
for local in &frame.locals {
881886
self.deallocate_local(local.value)?;
@@ -935,6 +940,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
935940
Ok(())
936941
}
937942

943+
#[instrument(skip(self), level = "debug")]
938944
fn deallocate_local(&mut self, local: LocalValue<M::PointerTag>) -> InterpResult<'tcx> {
939945
if let LocalValue::Live(Operand::Indirect(MemPlace { ptr, .. })) = local {
940946
// All locals have a backing allocation, even if the allocation is empty

compiler/rustc_const_eval/src/interpret/intern.rs

+2
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ pub fn intern_const_alloc_recursive<
359359
// pointers, ... So we can't intern them according to their type rules
360360

361361
let mut todo: Vec<_> = leftover_allocations.iter().cloned().collect();
362+
debug!(?todo);
363+
debug!("dead_alloc_map: {:#?}", ecx.memory.dead_alloc_map);
362364
while let Some(alloc_id) = todo.pop() {
363365
if let Some((_, mut alloc)) = ecx.memory.alloc_map.remove(&alloc_id) {
364366
// We can't call the `intern_shallow` method here, as its logic is tailored to safe

compiler/rustc_const_eval/src/interpret/memory.rs

+3
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
275275
Ok(new_ptr)
276276
}
277277

278+
#[instrument(skip(self), level = "debug")]
278279
pub fn deallocate(
279280
&mut self,
280281
ptr: Pointer<Option<M::PointerTag>>,
@@ -305,6 +306,8 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
305306
.into());
306307
};
307308

309+
debug!(?alloc);
310+
308311
if alloc.mutability == Mutability::Not {
309312
throw_ub_format!("deallocating immutable allocation {}", alloc_id);
310313
}

compiler/rustc_middle/src/mir/mod.rs

+29-1
Original file line numberDiff line numberDiff line change
@@ -2557,7 +2557,14 @@ impl<'tcx> Constant<'tcx> {
25572557
impl<'tcx> From<ty::Const<'tcx>> for ConstantKind<'tcx> {
25582558
#[inline]
25592559
fn from(ct: ty::Const<'tcx>) -> Self {
2560-
Self::Ty(ct)
2560+
match ct.val() {
2561+
ty::ConstKind::Value(cv) => {
2562+
// FIXME Once valtrees are introduced we need to convert those
2563+
// into `ConstValue` instances here
2564+
Self::Val(cv, ct.ty())
2565+
}
2566+
_ => Self::Ty(ct),
2567+
}
25612568
}
25622569
}
25632570

@@ -2638,6 +2645,27 @@ impl<'tcx> ConstantKind<'tcx> {
26382645
Self::Val(val, _) => val.try_to_machine_usize(tcx),
26392646
}
26402647
}
2648+
2649+
pub fn from_bool(tcx: TyCtxt<'tcx>, v: bool) -> Self {
2650+
let cv = ConstValue::from_bool(v);
2651+
Self::Val(cv, tcx.types.bool)
2652+
}
2653+
2654+
pub fn from_zero_sized(ty: Ty<'tcx>) -> Self {
2655+
let cv = ConstValue::Scalar(Scalar::ZST);
2656+
Self::Val(cv, ty)
2657+
}
2658+
2659+
pub fn from_usize(tcx: TyCtxt<'tcx>, n: u64) -> Self {
2660+
let ty = tcx.types.usize;
2661+
let size = tcx
2662+
.layout_of(ty::ParamEnv::empty().and(ty))
2663+
.unwrap_or_else(|e| bug!("could not compute layout for {:?}: {:?}", ty, e))
2664+
.size;
2665+
let cv = ConstValue::Scalar(Scalar::from_uint(n as u128, size));
2666+
2667+
Self::Val(cv, ty)
2668+
}
26412669
}
26422670

26432671
/// A collection of projections into user types.

compiler/rustc_mir_build/src/build/cfg.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use crate::build::CFG;
44
use rustc_middle::mir::*;
5-
use rustc_middle::ty::{self, TyCtxt};
5+
use rustc_middle::ty::TyCtxt;
66

77
impl<'tcx> CFG<'tcx> {
88
crate fn block_data(&self, blk: BasicBlock) -> &BasicBlockData<'tcx> {
@@ -73,7 +73,7 @@ impl<'tcx> CFG<'tcx> {
7373
Rvalue::Use(Operand::Constant(Box::new(Constant {
7474
span: source_info.span,
7575
user_ty: None,
76-
literal: ty::Const::zero_sized(tcx, tcx.types.unit).into(),
76+
literal: ConstantKind::from_zero_sized(tcx.types.unit),
7777
}))),
7878
);
7979
}

compiler/rustc_mir_build/src/build/expr/into.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_hir as hir;
99
use rustc_index::vec::Idx;
1010
use rustc_middle::mir::*;
1111
use rustc_middle::thir::*;
12-
use rustc_middle::ty::{self, CanonicalUserTypeAnnotation};
12+
use rustc_middle::ty::CanonicalUserTypeAnnotation;
1313
use std::iter;
1414

1515
impl<'a, 'tcx> Builder<'a, 'tcx> {
@@ -107,7 +107,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
107107
Constant {
108108
span: expr_span,
109109
user_ty: None,
110-
literal: ty::Const::from_bool(this.tcx, true).into(),
110+
literal: ConstantKind::from_bool(this.tcx, true),
111111
},
112112
);
113113

@@ -118,7 +118,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
118118
Constant {
119119
span: expr_span,
120120
user_ty: None,
121-
literal: ty::Const::from_bool(this.tcx, false).into(),
121+
literal: ConstantKind::from_bool(this.tcx, false),
122122
},
123123
);
124124

@@ -183,8 +183,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
183183
span: expr_span,
184184
user_ty: None,
185185
literal: match op {
186-
LogicalOp::And => ty::Const::from_bool(this.tcx, false).into(),
187-
LogicalOp::Or => ty::Const::from_bool(this.tcx, true).into(),
186+
LogicalOp::And => ConstantKind::from_bool(this.tcx, false),
187+
LogicalOp::Or => ConstantKind::from_bool(this.tcx, true),
188188
},
189189
},
190190
);

compiler/rustc_mir_build/src/build/misc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
5454
Constant {
5555
span: source_info.span,
5656
user_ty: None,
57-
literal: ty::Const::from_usize(self.tcx, value).into(),
57+
literal: ConstantKind::from_usize(self.tcx, value),
5858
},
5959
);
6060
temp

compiler/rustc_mir_build/src/thir/cx/expr.rs

+3
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,9 @@ impl<'tcx> Cx<'tcx> {
569569

570570
hir::ExprKind::ConstBlock(ref anon_const) => {
571571
let anon_const_def_id = self.tcx.hir().local_def_id(anon_const.hir_id);
572+
573+
// FIXME Do we want to use `from_inline_const` once valtrees
574+
// are introduced? This would create `ValTree`s that will never be used...
572575
let value = ty::Const::from_inline_const(self.tcx, anon_const_def_id);
573576

574577
ExprKind::ConstBlock { value }

compiler/rustc_trait_selection/src/traits/query/normalize.rs

+16-1
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,21 @@ impl<'cx, 'tcx> FallibleTypeFolder<'tcx> for QueryNormalizer<'cx, 'tcx> {
334334
&mut self,
335335
constant: mir::ConstantKind<'tcx>,
336336
) -> Result<mir::ConstantKind<'tcx>, Self::Error> {
337-
constant.try_super_fold_with(self)
337+
let constant_kind = match constant {
338+
mir::ConstantKind::Ty(c) => {
339+
let const_folded = c.try_fold_with(self)?;
340+
match const_folded.val() {
341+
ty::ConstKind::Value(cv) => {
342+
// FIXME With Valtrees we need to convert `cv: ValTree`
343+
// to a `ConstValue` here.
344+
mir::ConstantKind::Val(cv, const_folded.ty())
345+
}
346+
_ => mir::ConstantKind::Ty(const_folded),
347+
}
348+
}
349+
mir::ConstantKind::Val(_, _) => constant.try_super_fold_with(self)?,
350+
};
351+
352+
Ok(constant_kind)
338353
}
339354
}

src/test/mir-opt/inline/inline_generator.main.Inline.diff

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@
4646
- bb1: {
4747
+ discriminant(_4) = 0; // scope 2 at $DIR/inline-generator.rs:15:5: 15:41
4848
_3 = &mut _4; // scope 0 at $DIR/inline-generator.rs:9:23: 9:31
49-
- _2 = Pin::<&mut impl Generator<bool>>::new(move _3) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:9:14: 9:32
49+
- _2 = Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]>::new(move _3) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:9:14: 9:32
5050
- // mir::Constant
5151
- // + span: $DIR/inline-generator.rs:9:14: 9:22
5252
- // + user_ty: UserType(0)
53-
- // + literal: Const { ty: fn(&mut impl Generator<bool>) -> Pin<&mut impl Generator<bool>> {Pin::<&mut impl Generator<bool>>::new}, val: Value(Scalar(<ZST>)) }
53+
- // + literal: Const { ty: fn(&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]) -> Pin<&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]> {Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]>::new}, val: Value(Scalar(<ZST>)) }
5454
- }
5555
-
5656
- bb2: {
@@ -62,10 +62,10 @@
6262
+ StorageDead(_6); // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
6363
+ StorageDead(_5); // scope 4 at $SRC_DIR/core/src/pin.rs:LL:COL
6464
StorageDead(_3); // scope 0 at $DIR/inline-generator.rs:9:31: 9:32
65-
- _1 = <impl Generator<bool> as Generator<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
65+
- _1 = <[generator@$DIR/inline-generator.rs:15:5: 15:41] as Generator<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
6666
- // mir::Constant
6767
- // + span: $DIR/inline-generator.rs:9:33: 9:39
68-
- // + literal: Const { ty: for<'r> fn(Pin<&'r mut impl Generator<bool>>, bool) -> GeneratorState<<impl Generator<bool> as Generator<bool>>::Yield, <impl Generator<bool> as Generator<bool>>::Return> {<impl Generator<bool> as Generator<bool>>::resume}, val: Value(Scalar(<ZST>)) }
68+
- // + literal: Const { ty: for<'r> fn(Pin<&'r mut [generator@$DIR/inline-generator.rs:15:5: 15:41]>, bool) -> GeneratorState<<[generator@$DIR/inline-generator.rs:15:5: 15:41] as Generator<bool>>::Yield, <[generator@$DIR/inline-generator.rs:15:5: 15:41] as Generator<bool>>::Return> {<[generator@$DIR/inline-generator.rs:15:5: 15:41] as Generator<bool>>::resume}, val: Value(Scalar(<ZST>)) }
6969
+ StorageLive(_7); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
7070
+ _7 = const false; // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
7171
+ StorageLive(_10); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46

src/test/mir-opt/inline/issue_78442.bar.Inline.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
bb1: {
2626
_3 = &_4; // scope 0 at $DIR/issue-78442.rs:11:5: 11:15
2727
StorageLive(_5); // scope 0 at $DIR/issue-78442.rs:11:5: 11:17
28-
- _2 = <impl Fn() as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:11:5: 11:17
28+
- _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:11:5: 11:17
2929
- // mir::Constant
3030
- // + span: $DIR/issue-78442.rs:11:5: 11:15
31-
- // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> <impl Fn() as FnOnce<()>>::Output {<impl Fn() as Fn<()>>::call}, val: Value(Scalar(<ZST>)) }
31+
- // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r fn() {foo}, ()) -> <fn() {foo} as FnOnce<()>>::Output {<fn() {foo} as Fn<()>>::call}, val: Value(Scalar(<ZST>)) }
3232
+ _2 = move (*_3)() -> [return: bb5, unwind: bb3]; // scope 1 at $SRC_DIR/core/src/ops/function.rs:LL:COL
3333
}
3434

src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@
2525
_3 = &_4; // scope 0 at $DIR/issue-78442.rs:11:5: 11:15
2626
StorageLive(_5); // scope 0 at $DIR/issue-78442.rs:11:5: 11:17
2727
nop; // scope 0 at $DIR/issue-78442.rs:11:5: 11:17
28-
_2 = <impl Fn() as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:11:5: 11:17
28+
- _2 = <impl Fn() as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:11:5: 11:17
29+
+ _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:11:5: 11:17
2930
// mir::Constant
3031
// + span: $DIR/issue-78442.rs:11:5: 11:15
31-
// + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> <impl Fn() as FnOnce<()>>::Output {<impl Fn() as Fn<()>>::call}, val: Value(Scalar(<ZST>)) }
32+
- // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> <impl Fn() as FnOnce<()>>::Output {<impl Fn() as Fn<()>>::call}, val: Value(Scalar(<ZST>)) }
33+
+ // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r fn() {foo}, ()) -> <fn() {foo} as FnOnce<()>>::Output {<fn() {foo} as Fn<()>>::call}, val: Value(Scalar(<ZST>)) }
3234
}
3335

3436
bb2: {

src/test/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn use_x(_1: &'_#6r mut i32, _2: &'_#7r u32, _3: &'_#8r u32, _4: &'_#9r u32) ->
4242
let mut _0: bool; // return place in scope 0 at $DIR/named-lifetimes-basic.rs:12:81: 12:85
4343

4444
bb0: {
45-
_0 = const Const(Value(Scalar(0x01)): bool); // bb0[0]: scope 0 at $DIR/named-lifetimes-basic.rs:12:88: 12:92
45+
_0 = const ConstValue(Scalar(0x01): bool); // bb0[0]: scope 0 at $DIR/named-lifetimes-basic.rs:12:88: 12:92
4646
return; // bb0[1]: scope 0 at $DIR/named-lifetimes-basic.rs:12:94: 12:94
4747
}
4848
}

src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir

+7-7
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ fn main() -> () {
4545

4646
bb0: {
4747
StorageLive(_1); // bb0[0]: scope 0 at $DIR/region-subtyping-basic.rs:17:9: 17:14
48-
_1 = [const Const(Value(Scalar(0x00000001)): usize), const Const(Value(Scalar(0x00000002)): usize), const Const(Value(Scalar(0x00000003)): usize)]; // bb0[1]: scope 0 at $DIR/region-subtyping-basic.rs:17:17: 17:26
48+
_1 = [const ConstValue(Scalar(0x00000001): usize), const ConstValue(Scalar(0x00000002): usize), const ConstValue(Scalar(0x00000003): usize)]; // bb0[1]: scope 0 at $DIR/region-subtyping-basic.rs:17:17: 17:26
4949
FakeRead(ForLet(None), _1); // bb0[2]: scope 0 at $DIR/region-subtyping-basic.rs:17:9: 17:14
5050
StorageLive(_2); // bb0[3]: scope 1 at $DIR/region-subtyping-basic.rs:18:9: 18:10
5151
StorageLive(_3); // bb0[4]: scope 1 at $DIR/region-subtyping-basic.rs:18:16: 18:17
52-
_3 = const Const(Value(Scalar(0x00000000)): usize); // bb0[5]: scope 1 at $DIR/region-subtyping-basic.rs:18:16: 18:17
52+
_3 = const ConstValue(Scalar(0x00000000): usize); // bb0[5]: scope 1 at $DIR/region-subtyping-basic.rs:18:16: 18:17
5353
_4 = Len(_1); // bb0[6]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18
5454
_5 = Lt(_3, _4); // bb0[7]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18
5555
assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb7]; // bb0[8]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18
@@ -62,15 +62,15 @@ fn main() -> () {
6262
_6 = _2; // bb1[3]: scope 2 at $DIR/region-subtyping-basic.rs:19:13: 19:14
6363
FakeRead(ForLet(None), _6); // bb1[4]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10
6464
StorageLive(_7); // bb1[5]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12
65-
_7 = const Const(Value(Scalar(0x01)): bool); // bb1[6]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12
65+
_7 = const ConstValue(Scalar(0x01): bool); // bb1[6]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12
6666
switchInt(move _7) -> [Const(Value(Scalar(0x00)): bool): bb4, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12
6767
}
6868

6969
bb2: {
7070
StorageLive(_8); // bb2[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18
7171
StorageLive(_9); // bb2[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17
7272
_9 = (*_6); // bb2[2]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17
73-
_8 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(move _9) -> [return: bb3, unwind: bb7]; // bb2[3]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18
73+
_8 = ConstValue(Scalar(<ZST>): fn(usize) -> bool {use_x})(move _9) -> [return: bb3, unwind: bb7]; // bb2[3]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18
7474
// mir::Constant
7575
// + span: $DIR/region-subtyping-basic.rs:21:9: 21:14
7676
// + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) }
@@ -79,21 +79,21 @@ fn main() -> () {
7979
bb3: {
8080
StorageDead(_9); // bb3[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:17: 21:18
8181
StorageDead(_8); // bb3[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19
82-
_0 = const Const(Value(Scalar(<ZST>)): ()); // bb3[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:13: 22:6
82+
_0 = const ConstValue(Scalar(<ZST>): ()); // bb3[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:13: 22:6
8383
goto -> bb6; // bb3[3]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6
8484
}
8585

8686
bb4: {
8787
StorageLive(_10); // bb4[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18
88-
_10 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(const Const(Value(Scalar(0x00000016)): usize)) -> [return: bb5, unwind: bb7]; // bb4[1]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18
88+
_10 = ConstValue(Scalar(<ZST>): fn(usize) -> bool {use_x})(const ConstValue(Scalar(0x00000016): usize)) -> [return: bb5, unwind: bb7]; // bb4[1]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18
8989
// mir::Constant
9090
// + span: $DIR/region-subtyping-basic.rs:23:9: 23:14
9191
// + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) }
9292
}
9393

9494
bb5: {
9595
StorageDead(_10); // bb5[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:18: 23:19
96-
_0 = const Const(Value(Scalar(<ZST>)): ()); // bb5[1]: scope 3 at $DIR/region-subtyping-basic.rs:22:12: 24:6
96+
_0 = const ConstValue(Scalar(<ZST>): ()); // bb5[1]: scope 3 at $DIR/region-subtyping-basic.rs:22:12: 24:6
9797
goto -> bb6; // bb5[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6
9898
}
9999

0 commit comments

Comments
 (0)