Skip to content

Commit 29c95e9

Browse files
committed
also print 'immutable' flag
1 parent 4d93590 commit 29c95e9

File tree

40 files changed

+139
-138
lines changed

40 files changed

+139
-138
lines changed

compiler/rustc_middle/src/mir/interpret/pointer.rs

+12-25
Original file line numberDiff line numberDiff line change
@@ -114,22 +114,7 @@ pub trait Provenance: Copy + fmt::Debug + 'static {
114114
const OFFSET_IS_ADDR: bool;
115115

116116
/// Determines how a pointer should be printed.
117-
///
118-
/// Default impl is only good for when `OFFSET_IS_ADDR == true`.
119-
fn fmt(ptr: &Pointer<Self>, f: &mut fmt::Formatter<'_>) -> fmt::Result
120-
where
121-
Self: Sized,
122-
{
123-
assert!(Self::OFFSET_IS_ADDR);
124-
let (prov, addr) = ptr.into_parts(); // address is absolute
125-
write!(f, "{:#x}", addr.bytes())?;
126-
if f.alternate() {
127-
write!(f, "{prov:#?}")?;
128-
} else {
129-
write!(f, "{prov:?}")?;
130-
}
131-
Ok(())
132-
}
117+
fn fmt(ptr: &Pointer<Self>, f: &mut fmt::Formatter<'_>) -> fmt::Result;
133118

134119
/// If `OFFSET_IS_ADDR == false`, provenance must always be able to
135120
/// identify the allocation this ptr points to (i.e., this must return `Some`).
@@ -156,8 +141,11 @@ impl From<AllocId> for CtfeProvenance {
156141

157142
impl fmt::Debug for CtfeProvenance {
158143
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
159-
// FIXME print "immutable" bit
160-
self.alloc_id().fmt(f)
144+
fmt::Debug::fmt(&self.alloc_id(), f)?; // propagates `alternate` flag
145+
if self.immutable() {
146+
write!(f, "<imm>")?;
147+
}
148+
Ok(())
161149
}
162150
}
163151

@@ -189,17 +177,16 @@ impl Provenance for CtfeProvenance {
189177
const OFFSET_IS_ADDR: bool = false;
190178

191179
fn fmt(ptr: &Pointer<Self>, f: &mut fmt::Formatter<'_>) -> fmt::Result {
192-
// FIXME print "immutable" bit
193-
// Forward `alternate` flag to `alloc_id` printing.
194-
if f.alternate() {
195-
write!(f, "{:#?}", ptr.provenance.alloc_id())?;
196-
} else {
197-
write!(f, "{:?}", ptr.provenance.alloc_id())?;
198-
}
180+
// Print AllocId.
181+
fmt::Debug::fmt(&ptr.provenance.alloc_id(), f)?; // propagates `alternate` flag
199182
// Print offset only if it is non-zero.
200183
if ptr.offset.bytes() > 0 {
201184
write!(f, "+{:#x}", ptr.offset.bytes())?;
202185
}
186+
// Print immutable status.
187+
if ptr.provenance.immutable() {
188+
write!(f, "<imm>")?;
189+
}
203190
Ok(())
204191
}
205192

src/tools/compiletest/src/runtest.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -4288,15 +4288,18 @@ impl<'test> TestCx<'test> {
42884288
let mut seen_allocs = indexmap::IndexSet::new();
42894289

42904290
// The alloc-id appears in pretty-printed allocations.
4291-
let re = Regex::new(r"╾─*a(lloc)?([0-9]+)(\+0x[0-9]+)?─*╼").unwrap();
4291+
let re =
4292+
Regex::new(r"╾─*a(lloc)?([0-9]+)(\+0x[0-9]+)?(<imm>)?( \([0-9]+ ptr bytes\))?─*╼")
4293+
.unwrap();
42924294
normalized = re
42934295
.replace_all(&normalized, |caps: &Captures<'_>| {
42944296
// Renumber the captured index.
42954297
let index = caps.get(2).unwrap().as_str().to_string();
42964298
let (index, _) = seen_allocs.insert_full(index);
42974299
let offset = caps.get(3).map_or("", |c| c.as_str());
4300+
let imm = caps.get(4).map_or("", |c| c.as_str());
42984301
// Do not bother keeping it pretty, just make it deterministic.
4299-
format!("╾ALLOC{index}{offset}╼")
4302+
format!("╾ALLOC{index}{offset}{imm}╼")
43004303
})
43014304
.into_owned();
43024305

src/tools/miri/src/machine.rs

+11
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,17 @@ impl interpret::Provenance for Provenance {
260260
}
261261
}
262262

263+
fn fmt(ptr: &Pointer<Self>, f: &mut fmt::Formatter<'_>) -> fmt::Result {
264+
let (prov, addr) = ptr.into_parts(); // address is absolute
265+
write!(f, "{:#x}", addr.bytes())?;
266+
if f.alternate() {
267+
write!(f, "{prov:#?}")?;
268+
} else {
269+
write!(f, "{prov:?}")?;
270+
}
271+
Ok(())
272+
}
273+
263274
fn join(left: Option<Self>, right: Option<Self>) -> Option<Self> {
264275
match (left, right) {
265276
// If both are the *same* concrete tag, that is the result.

tests/mir-opt/const_allocation.main.ConstProp.after.32bit.mir

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ fn main() -> () {
1818
}
1919

2020
ALLOC9 (static: FOO, size: 8, align: 4) {
21-
╾ALLOC0╼ 03 00 00 00 │ ╾──╼....
21+
╾ALLOC0<imm>╼ 03 00 00 00 │ ╾──╼....
2222
}
2323

2424
ALLOC0 (size: 48, align: 4) {
25-
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC1╼ 00 00 00 00 │ ....░░░░╾──╼....
26-
0x10 │ 00 00 00 00 __ __ __ __ ╾ALLOC2╼ 02 00 00 00 │ ....░░░░╾──╼....
27-
0x20 │ 01 00 00 00 2a 00 00 00 ╾ALLOC3╼ 03 00 00 00 │ ....*...╾──╼....
25+
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC1<imm>╼ 00 00 00 00 │ ....░░░░╾──╼....
26+
0x10 │ 00 00 00 00 __ __ __ __ ╾ALLOC2<imm>╼ 02 00 00 00 │ ....░░░░╾──╼....
27+
0x20 │ 01 00 00 00 2a 00 00 00 ╾ALLOC3<imm>╼ 03 00 00 00 │ ....*...╾──╼....
2828
}
2929

3030
ALLOC1 (size: 0, align: 4) {}
3131

3232
ALLOC2 (size: 16, align: 4) {
33-
╾ALLOC4╼ 03 00 00 00 ╾ALLOC5╼ 03 00 00 00 │ ╾──╼....╾──╼....
33+
╾ALLOC4<imm>╼ 03 00 00 00 ╾ALLOC5<imm>╼ 03 00 00 00 │ ╾──╼....╾──╼....
3434
}
3535

3636
ALLOC4 (size: 3, align: 1) {
@@ -42,8 +42,8 @@ ALLOC5 (size: 3, align: 1) {
4242
}
4343

4444
ALLOC3 (size: 24, align: 4) {
45-
0x00 │ ╾ALLOC6╼ 03 00 00 00 ╾ALLOC7╼ 03 00 00 00 │ ╾──╼....╾──╼....
46-
0x10 │ ╾ALLOC8╼ 04 00 00 00 │ ╾──╼....
45+
0x00 │ ╾ALLOC6<imm>╼ 03 00 00 00 ╾ALLOC7<imm>╼ 03 00 00 00 │ ╾──╼....╾──╼....
46+
0x10 │ ╾ALLOC8<imm>╼ 04 00 00 00 │ ╾──╼....
4747
}
4848

4949
ALLOC6 (size: 3, align: 1) {

tests/mir-opt/const_allocation.main.ConstProp.after.64bit.mir

+9-9
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ fn main() -> () {
1818
}
1919

2020
ALLOC9 (static: FOO, size: 16, align: 8) {
21-
╾ALLOC0╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
21+
╾ALLOC0<imm>╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
2222
}
2323

2424
ALLOC0 (size: 72, align: 8) {
25-
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC1╼ │ ....░░░░╾──────╼
25+
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC1<imm>╼ │ ....░░░░╾──────╼
2626
0x10 │ 00 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ │ ............░░░░
27-
0x20 │ ╾ALLOC2╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
28-
0x30 │ 01 00 00 00 2a 00 00 00 ╾ALLOC3╼ │ ....*...╾──────╼
27+
0x20 │ ╾ALLOC2<imm>╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
28+
0x30 │ 01 00 00 00 2a 00 00 00 ╾ALLOC3<imm>╼ │ ....*...╾──────╼
2929
0x40 │ 03 00 00 00 00 00 00 00 │ ........
3030
}
3131

3232
ALLOC1 (size: 0, align: 8) {}
3333

3434
ALLOC2 (size: 32, align: 8) {
35-
0x00 │ ╾ALLOC4╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
36-
0x10 │ ╾ALLOC5╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
35+
0x00 │ ╾ALLOC4<imm>╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
36+
0x10 │ ╾ALLOC5<imm>╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
3737
}
3838

3939
ALLOC4 (size: 3, align: 1) {
@@ -45,9 +45,9 @@ ALLOC5 (size: 3, align: 1) {
4545
}
4646

4747
ALLOC3 (size: 48, align: 8) {
48-
0x00 │ ╾ALLOC6╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
49-
0x10 │ ╾ALLOC7╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
50-
0x20 │ ╾ALLOC8╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
48+
0x00 │ ╾ALLOC6<imm>╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
49+
0x10 │ ╾ALLOC7<imm>╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
50+
0x20 │ ╾ALLOC8<imm>╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
5151
}
5252

5353
ALLOC6 (size: 3, align: 1) {

tests/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ fn main() -> () {
1818
}
1919

2020
ALLOC9 (static: FOO, size: 8, align: 4) {
21-
╾ALLOC0╼ 03 00 00 00 │ ╾──╼....
21+
╾ALLOC0<imm>╼ 03 00 00 00 │ ╾──╼....
2222
}
2323

2424
ALLOC0 (size: 48, align: 4) {
25-
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC1╼ 00 00 00 00 │ ....░░░░╾──╼....
26-
0x10 │ 00 00 00 00 __ __ __ __ ╾ALLOC2╼ 02 00 00 00 │ ....░░░░╾──╼....
27-
0x20 │ 01 00 00 00 2a 00 00 00 ╾ALLOC3╼ 03 00 00 00 │ ....*...╾──╼....
25+
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC1<imm>╼ 00 00 00 00 │ ....░░░░╾──╼....
26+
0x10 │ 00 00 00 00 __ __ __ __ ╾ALLOC2<imm>╼ 02 00 00 00 │ ....░░░░╾──╼....
27+
0x20 │ 01 00 00 00 2a 00 00 00 ╾ALLOC3<imm>╼ 03 00 00 00 │ ....*...╾──╼....
2828
}
2929

3030
ALLOC1 (size: 0, align: 4) {}
3131

3232
ALLOC2 (size: 8, align: 4) {
33-
╾ALLOC4╼ ╾ALLOC5╼ │ ╾──╼╾──╼
33+
╾ALLOC4<imm>╼ ╾ALLOC5<imm>╼ │ ╾──╼╾──╼
3434
}
3535

3636
ALLOC4 (size: 1, align: 1) {
@@ -42,7 +42,7 @@ ALLOC5 (size: 1, align: 1) {
4242
}
4343

4444
ALLOC3 (size: 12, align: 4) {
45-
╾ALLOC6+0x3╼ ╾ALLOC7╼ ╾ALLOC8+0x2╼ │ ╾──╼╾──╼╾──╼
45+
╾ALLOC6+0x3<imm>╼ ╾ALLOC7<imm>╼ ╾ALLOC8+0x2<imm>╼ │ ╾──╼╾──╼╾──╼
4646
}
4747

4848
ALLOC6 (size: 4, align: 1) {

tests/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ fn main() -> () {
1818
}
1919

2020
ALLOC9 (static: FOO, size: 16, align: 8) {
21-
╾ALLOC0╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
21+
╾ALLOC0<imm>╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
2222
}
2323

2424
ALLOC0 (size: 72, align: 8) {
25-
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC1╼ │ ....░░░░╾──────╼
25+
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC1<imm>╼ │ ....░░░░╾──────╼
2626
0x10 │ 00 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ │ ............░░░░
27-
0x20 │ ╾ALLOC2╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
28-
0x30 │ 01 00 00 00 2a 00 00 00 ╾ALLOC3╼ │ ....*...╾──────╼
27+
0x20 │ ╾ALLOC2<imm>╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
28+
0x30 │ 01 00 00 00 2a 00 00 00 ╾ALLOC3<imm>╼ │ ....*...╾──────╼
2929
0x40 │ 03 00 00 00 00 00 00 00 │ ........
3030
}
3131

3232
ALLOC1 (size: 0, align: 8) {}
3333

3434
ALLOC2 (size: 16, align: 8) {
35-
╾ALLOC4╼ ╾ALLOC5╼ │ ╾──────╼╾──────╼
35+
╾ALLOC4<imm>╼ ╾ALLOC5<imm>╼ │ ╾──────╼╾──────╼
3636
}
3737

3838
ALLOC4 (size: 1, align: 1) {
@@ -44,8 +44,8 @@ ALLOC5 (size: 1, align: 1) {
4444
}
4545

4646
ALLOC3 (size: 24, align: 8) {
47-
0x00 │ ╾ALLOC6+0x3╼ ╾ALLOC7╼ │ ╾──────╼╾──────╼
48-
0x10 │ ╾ALLOC8+0x2╼ │ ╾──────╼
47+
0x00 │ ╾ALLOC6+0x3<imm>╼ ╾ALLOC7<imm>╼ │ ╾──────╼╾──────╼
48+
0x10 │ ╾ALLOC8+0x2<imm>╼ │ ╾──────╼
4949
}
5050

5151
ALLOC6 (size: 4, align: 1) {

tests/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ fn main() -> () {
1818
}
1919

2020
ALLOC4 (static: FOO, size: 4, align: 4) {
21-
╾ALLOC0╼ │ ╾──╼
21+
╾ALLOC0<imm>╼ │ ╾──╼
2222
}
2323

2424
ALLOC0 (size: 168, align: 1) {
2525
0x00 │ ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab │ ................
26-
0x10 │ ab ab ab ab ab ab ab ab ab ab ab ab ╾ALLOC1╼ │ ............╾──╼
26+
0x10 │ ab ab ab ab ab ab ab ab ab ab ab ab ╾ALLOC1<imm>╼ │ ............╾──╼
2727
0x20 │ 01 ef cd ab 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
2828
0x30 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
2929
0x40 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
3030
0x50 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
3131
0x60 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
3232
0x70 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
3333
0x80 │ 00 00 00 00 00 00 00 00 00 00 ╾ALLOC2╼ 00 00 │ ..........╾──╼..
34-
0x90 │ ╾ALLOC3+0x63╼ 00 00 00 00 00 00 00 00 00 00 00 00 │ ╾──╼............
34+
0x90 │ ╾ALLOC3+0x63<imm>╼ 00 00 00 00 00 00 00 00 00 00 00 00 │ ╾──╼............
3535
0xa0 │ 00 00 00 00 00 00 00 00 │ ........
3636
}
3737

tests/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ fn main() -> () {
1818
}
1919

2020
ALLOC2 (static: FOO, size: 8, align: 8) {
21-
╾ALLOC0╼ │ ╾──────╼
21+
╾ALLOC0<imm>╼ │ ╾──────╼
2222
}
2323

2424
ALLOC0 (size: 180, align: 1) {
2525
0x00 │ ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab │ ................
26-
0x10 │ ab ab ab ab ab ab ab ab ab ab ab ab ╾──ALLOC3── │ ............╾───
26+
0x10 │ ab ab ab ab ab ab ab ab ab ab ab ab ╾ALLOC3<imm> (8 ptr bytes) │ ............╾───
2727
0x20 │ ──────────╼ 01 ef cd ab 00 00 00 00 00 00 00 00 │ ───╼............
2828
0x30 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
2929
0x40 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
3030
0x50 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
3131
0x60 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
3232
0x70 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
3333
0x80 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ╾──── │ ..............╾─
34-
0x90 │ ─────ALLOC4─────╼ 00 00 ╾ALLOC1+0x63╼ │ ─────╼..╾──────╼
34+
0x90 │ ─────ALLOC4─────╼ 00 00 ╾ALLOC1+0x63<imm>╼ │ ─────╼..╾──────╼
3535
0xa0 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
3636
0xb0 │ 00 00 00 00 │ ....
3737
}

tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.32bit.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
}
119119

120120
ALLOC2 (static: RC, size: 4, align: 4) {
121-
╾ALLOC0╼ │ ╾──╼
121+
╾ALLOC0<imm>╼ │ ╾──╼
122122
}
123123

124124
ALLOC0 (size: 8, align: 4) {

tests/mir-opt/dataflow-const-prop/enum.statics.DataflowConstProp.64bit.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
}
119119

120120
ALLOC2 (static: RC, size: 8, align: 8) {
121-
╾ALLOC0╼ │ ╾──────╼
121+
╾ALLOC0<imm>╼ │ ╾──────╼
122122
}
123123

124124
ALLOC0 (size: 8, align: 4) {

tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.32bit.diff

+4-4
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,11 @@
220220
}
221221

222222
ALLOC5 (static: BIG_STAT, size: 4, align: 4) {
223-
╾ALLOC0╼ │ ╾──╼
223+
╾ALLOC0<imm>╼ │ ╾──╼
224224
}
225225

226226
ALLOC0 (size: 20, align: 4) {
227-
0x00 │ 01 00 00 00 23 00 00 00 ╾ALLOC1╼ 02 00 00 00 │ ....#...╾──╼....
227+
0x00 │ 01 00 00 00 23 00 00 00 ╾ALLOC1<imm>╼ 02 00 00 00 │ ....#...╾──╼....
228228
0x10 │ 00 00 a4 42 │ ...B
229229
}
230230

@@ -233,11 +233,11 @@
233233
}
234234

235235
ALLOC4 (static: SMALL_STAT, size: 4, align: 4) {
236-
╾ALLOC2╼ │ ╾──╼
236+
╾ALLOC2<imm>╼ │ ╾──╼
237237
}
238238

239239
ALLOC2 (size: 20, align: 4) {
240-
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC3╼ 01 00 00 00 │ ....░░░░╾──╼....
240+
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC3<imm>╼ 01 00 00 00 │ ....░░░░╾──╼....
241241
0x10 │ 00 00 10 41 │ ...A
242242
}
243243

tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.64bit.diff

+4-4
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,11 @@
220220
}
221221

222222
ALLOC5 (static: BIG_STAT, size: 8, align: 8) {
223-
╾ALLOC0╼ │ ╾──────╼
223+
╾ALLOC0<imm>╼ │ ╾──────╼
224224
}
225225

226226
ALLOC0 (size: 32, align: 8) {
227-
0x00 │ 01 00 00 00 23 00 00 00 ╾ALLOC1╼ │ ....#...╾──────╼
227+
0x00 │ 01 00 00 00 23 00 00 00 ╾ALLOC1<imm>╼ │ ....#...╾──────╼
228228
0x10 │ 02 00 00 00 00 00 00 00 00 00 a4 42 __ __ __ __ │ ...........B░░░░
229229
}
230230

@@ -233,11 +233,11 @@
233233
}
234234

235235
ALLOC4 (static: SMALL_STAT, size: 8, align: 8) {
236-
╾ALLOC2╼ │ ╾──────╼
236+
╾ALLOC2<imm>╼ │ ╾──────╼
237237
}
238238

239239
ALLOC2 (size: 32, align: 8) {
240-
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC3╼ │ ....░░░░╾──────╼
240+
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC3<imm>╼ │ ....░░░░╾──────╼
241241
0x10 │ 01 00 00 00 00 00 00 00 00 00 10 41 __ __ __ __ │ ...........A░░░░
242242
}
243243

tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
StorageLive(_6);
7979
_9 = const _;
8080
- _6 = std::alloc::Global::alloc_impl(_9, _1, const false) -> [return: bb4, unwind unreachable];
81-
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }}, const false) -> [return: bb4, unwind unreachable];
81+
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }}, const false) -> [return: bb4, unwind unreachable];
8282
}
8383

8484
bb4: {

tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
StorageLive(_6);
7777
_9 = const _;
7878
- _6 = std::alloc::Global::alloc_impl(_9, _1, const false) -> [return: bb5, unwind continue];
79-
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }}, const false) -> [return: bb5, unwind continue];
79+
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }}, const false) -> [return: bb5, unwind continue];
8080
}
8181

8282
bb5: {

tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
StorageLive(_6);
7979
_9 = const _;
8080
- _6 = std::alloc::Global::alloc_impl(_9, _1, const false) -> [return: bb4, unwind unreachable];
81-
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }}, const false) -> [return: bb4, unwind unreachable];
81+
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }}, const false) -> [return: bb4, unwind unreachable];
8282
}
8383

8484
bb4: {

0 commit comments

Comments
 (0)