Normalize alloc-id in tests.

This commit is contained in:
Camille GILLOT 2023-10-15 17:00:11 +00:00
parent e7bdc5f9f8
commit 02424e4bc5
106 changed files with 357 additions and 327 deletions

View File

@ -697,6 +697,7 @@ dependencies = [
"getopts",
"glob",
"home",
"indexmap 2.0.0",
"lazycell",
"libc",
"miow",

View File

@ -11,6 +11,7 @@ colored = "2"
diff = "0.1.10"
unified-diff = "0.2.1"
getopts = "0.2"
indexmap = "2.0.0"
miropt-test-tools = { path = "../miropt-test-tools" }
build_helper = { path = "../build_helper" }
tracing = "0.1"

View File

@ -4258,6 +4258,34 @@ impl<'test> TestCx<'test> {
V0_BACK_REF_RE.replace_all(&normalized, V0_BACK_REF_PLACEHOLDER).into_owned();
}
// Normalize AllocId counter
{
use std::fmt::Write;
let re = Regex::new(r"(╾a|─a|\balloc)([0-9]+)\b(─|\+0x[0-9]+─)?").unwrap();
let mut seen_allocs = indexmap::IndexSet::new();
normalized = re
.replace_all(&normalized, |caps: &Captures<'_>| {
// Use uppercase to distinguish with the non-normalized version.
let mut ret = caps.get(1).unwrap().as_str().to_uppercase();
// Renumber the captured index.
let index = caps.get(2).unwrap().as_str().to_string();
let (index, _) = seen_allocs.insert_full(index);
write!(&mut ret, "{index}").unwrap();
// If we have a tail finishing with `─`, this means pretty-printing.
// Complete with filler `─` to preserve the pretty-print.
if let Some(tail) = caps.get(3) {
ret.push_str(tail.as_str());
let diff = caps.get(0).unwrap().as_str().len() - ret.len();
for _ in 0..diff {
ret.push('─');
}
}
ret
})
.into_owned();
}
// Custom normalization rules
for rule in custom_rules {
let re = Regex::new(&rule.0).expect("bad regex in custom normalization rule");

View File

@ -6,16 +6,16 @@ fn statics() -> () {
let mut _2: *mut i32;
bb0: {
_1 = const {alloc1: &i32};
_2 = const {alloc2: *mut i32};
_1 = const {ALLOC0: &i32};
_2 = const {ALLOC1: *mut i32};
return;
}
}
alloc2 (static: T, size: 4, align: 4) {
ALLOC1 (static: T, size: 4, align: 4) {
0a 0a 0a 0a ....
}
alloc1 (static: S, size: 4, align: 4) {
ALLOC0 (static: S, size: 4, align: 4) {
05 05 05 05 ....
}

View File

@ -23,6 +23,6 @@ fn main() -> () {
}
}
alloc1 (size: 3, align: 1) {
ALLOC0 (size: 3, align: 1) {
66 6f 6f foo
}

View File

@ -8,7 +8,7 @@ fn main() -> () {
bb0: {
StorageLive(_1);
StorageLive(_2);
_2 = const {alloc1: &&[(Option<i32>, &[&str])]};
_2 = const {ALLOC0: &&[(Option<i32>, &[&str])]};
_1 = (*_2);
StorageDead(_2);
StorageDead(_1);
@ -17,43 +17,43 @@ fn main() -> () {
}
}
alloc1 (static: FOO, size: 8, align: 4) {
alloc19 03 00 00 00 ....
ALLOC0 (static: FOO, size: 8, align: 4) {
ALLOC1 03 00 00 00 ....
}
alloc19 (size: 48, align: 4) {
0x00 00 00 00 00 __ __ __ __ alloc6 00 00 00 00 ........
0x10 00 00 00 00 __ __ __ __ alloc10 02 00 00 00 ........
0x20 01 00 00 00 2a 00 00 00 alloc15 03 00 00 00 ....*.......
ALLOC1 (size: 48, align: 4) {
0x00 00 00 00 00 __ __ __ __ ALLOC2 00 00 00 00 ........
0x10 00 00 00 00 __ __ __ __ ALLOC3 02 00 00 00 ........
0x20 01 00 00 00 2a 00 00 00 ALLOC4 03 00 00 00 ....*.......
}
alloc6 (size: 0, align: 4) {}
ALLOC2 (size: 0, align: 4) {}
alloc10 (size: 16, align: 4) {
alloc9 03 00 00 00 alloc11 03 00 00 00 ........
ALLOC3 (size: 16, align: 4) {
ALLOC5 03 00 00 00 ALLOC6 03 00 00 00 ........
}
alloc9 (size: 3, align: 1) {
ALLOC5 (size: 3, align: 1) {
66 6f 6f foo
}
alloc11 (size: 3, align: 1) {
ALLOC6 (size: 3, align: 1) {
62 61 72 bar
}
alloc15 (size: 24, align: 4) {
0x00 alloc14 03 00 00 00 alloc16 03 00 00 00 ........
0x10 alloc17 04 00 00 00 ....
ALLOC4 (size: 24, align: 4) {
0x00 ALLOC7 03 00 00 00 ALLOC8 03 00 00 00 ........
0x10 ALLOC9 04 00 00 00 ....
}
alloc14 (size: 3, align: 1) {
ALLOC7 (size: 3, align: 1) {
6d 65 68 meh
}
alloc16 (size: 3, align: 1) {
ALLOC8 (size: 3, align: 1) {
6d 6f 70 mop
}
alloc17 (size: 4, align: 1) {
ALLOC9 (size: 4, align: 1) {
6d c3 b6 70 m..p
}

View File

@ -8,7 +8,7 @@ fn main() -> () {
bb0: {
StorageLive(_1);
StorageLive(_2);
_2 = const {alloc1: &&[(Option<i32>, &[&str])]};
_2 = const {ALLOC0: &&[(Option<i32>, &[&str])]};
_1 = (*_2);
StorageDead(_2);
StorageDead(_1);
@ -17,47 +17,47 @@ fn main() -> () {
}
}
alloc1 (static: FOO, size: 16, align: 8) {
alloc19 03 00 00 00 00 00 00 00 ........
ALLOC0 (static: FOO, size: 16, align: 8) {
ALLOC1 03 00 00 00 00 00 00 00 ........
}
alloc19 (size: 72, align: 8) {
0x00 00 00 00 00 __ __ __ __ alloc6 ....
ALLOC1 (size: 72, align: 8) {
0x00 00 00 00 00 __ __ __ __ ALLOC2 ....
0x10 00 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ ............
0x20 alloc10 02 00 00 00 00 00 00 00 ........
0x30 01 00 00 00 2a 00 00 00 alloc15 ....*...
0x20 ALLOC3 02 00 00 00 00 00 00 00 ........
0x30 01 00 00 00 2a 00 00 00 ALLOC4 ....*...
0x40 03 00 00 00 00 00 00 00 ........
}
alloc6 (size: 0, align: 8) {}
ALLOC2 (size: 0, align: 8) {}
alloc10 (size: 32, align: 8) {
0x00 alloc9 03 00 00 00 00 00 00 00 ........
0x10 alloc11 03 00 00 00 00 00 00 00 ........
ALLOC3 (size: 32, align: 8) {
0x00 ALLOC5 03 00 00 00 00 00 00 00 ........
0x10 ALLOC6 03 00 00 00 00 00 00 00 ........
}
alloc9 (size: 3, align: 1) {
ALLOC5 (size: 3, align: 1) {
66 6f 6f foo
}
alloc11 (size: 3, align: 1) {
ALLOC6 (size: 3, align: 1) {
62 61 72 bar
}
alloc15 (size: 48, align: 8) {
0x00 alloc14 03 00 00 00 00 00 00 00 ........
0x10 alloc16 03 00 00 00 00 00 00 00 ........
0x20 alloc17 04 00 00 00 00 00 00 00 ........
ALLOC4 (size: 48, align: 8) {
0x00 ALLOC7 03 00 00 00 00 00 00 00 ........
0x10 ALLOC8 03 00 00 00 00 00 00 00 ........
0x20 ALLOC9 04 00 00 00 00 00 00 00 ........
}
alloc14 (size: 3, align: 1) {
ALLOC7 (size: 3, align: 1) {
6d 65 68 meh
}
alloc16 (size: 3, align: 1) {
ALLOC8 (size: 3, align: 1) {
6d 6f 70 mop
}
alloc17 (size: 4, align: 1) {
ALLOC9 (size: 4, align: 1) {
6d c3 b6 70 m..p
}

View File

@ -8,7 +8,7 @@ fn main() -> () {
bb0: {
StorageLive(_1);
StorageLive(_2);
_2 = const {alloc1: &&[(Option<i32>, &[&u8])]};
_2 = const {ALLOC0: &&[(Option<i32>, &[&u8])]};
_1 = (*_2);
StorageDead(_2);
StorageDead(_1);
@ -17,42 +17,42 @@ fn main() -> () {
}
}
alloc1 (static: FOO, size: 8, align: 4) {
alloc23 03 00 00 00 ....
ALLOC0 (static: FOO, size: 8, align: 4) {
ALLOC1 03 00 00 00 ....
}
alloc23 (size: 48, align: 4) {
0x00 00 00 00 00 __ __ __ __ alloc10 00 00 00 00 ........
0x10 00 00 00 00 __ __ __ __ alloc15 02 00 00 00 ........
0x20 01 00 00 00 2a 00 00 00 alloc21 03 00 00 00 ....*.......
ALLOC1 (size: 48, align: 4) {
0x00 00 00 00 00 __ __ __ __ ALLOC2 00 00 00 00 ........
0x10 00 00 00 00 __ __ __ __ ALLOC3 02 00 00 00 ........
0x20 01 00 00 00 2a 00 00 00 ALLOC4 03 00 00 00 ....*.......
}
alloc10 (size: 0, align: 4) {}
ALLOC2 (size: 0, align: 4) {}
alloc15 (size: 8, align: 4) {
alloc13 alloc14
ALLOC3 (size: 8, align: 4) {
ALLOC5 ALLOC6
}
alloc13 (size: 1, align: 1) {
ALLOC5 (size: 1, align: 1) {
05 .
}
alloc14 (size: 1, align: 1) {
ALLOC6 (size: 1, align: 1) {
06 .
}
alloc21 (size: 12, align: 4) {
a18+0x3 alloc19 a20+0x2
ALLOC4 (size: 12, align: 4) {
A7+0x3 ALLOC8 A9+0x2
}
alloc18 (size: 4, align: 1) {
ALLOC7 (size: 4, align: 1) {
2a 45 15 6f *E.o
}
alloc19 (size: 1, align: 1) {
ALLOC8 (size: 1, align: 1) {
2a *
}
alloc20 (size: 4, align: 1) {
ALLOC9 (size: 4, align: 1) {
2a 45 15 6f *E.o
}

View File

@ -8,7 +8,7 @@ fn main() -> () {
bb0: {
StorageLive(_1);
StorageLive(_2);
_2 = const {alloc1: &&[(Option<i32>, &[&u8])]};
_2 = const {ALLOC0: &&[(Option<i32>, &[&u8])]};
_1 = (*_2);
StorageDead(_2);
StorageDead(_1);
@ -17,45 +17,45 @@ fn main() -> () {
}
}
alloc1 (static: FOO, size: 16, align: 8) {
alloc23 03 00 00 00 00 00 00 00 ........
ALLOC0 (static: FOO, size: 16, align: 8) {
ALLOC1 03 00 00 00 00 00 00 00 ........
}
alloc23 (size: 72, align: 8) {
0x00 00 00 00 00 __ __ __ __ alloc10 ....
ALLOC1 (size: 72, align: 8) {
0x00 00 00 00 00 __ __ __ __ ALLOC2 ....
0x10 00 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ ............
0x20 alloc15 02 00 00 00 00 00 00 00 ........
0x30 01 00 00 00 2a 00 00 00 alloc21 ....*...
0x20 ALLOC3 02 00 00 00 00 00 00 00 ........
0x30 01 00 00 00 2a 00 00 00 ALLOC4 ....*...
0x40 03 00 00 00 00 00 00 00 ........
}
alloc10 (size: 0, align: 8) {}
ALLOC2 (size: 0, align: 8) {}
alloc15 (size: 16, align: 8) {
alloc13 alloc14
ALLOC3 (size: 16, align: 8) {
ALLOC5 ALLOC6
}
alloc13 (size: 1, align: 1) {
ALLOC5 (size: 1, align: 1) {
05 .
}
alloc14 (size: 1, align: 1) {
ALLOC6 (size: 1, align: 1) {
06 .
}
alloc21 (size: 24, align: 8) {
0x00 alloc18+0x3 alloc19
0x10 alloc20+0x2
ALLOC4 (size: 24, align: 8) {
0x00 ALLOC7+0x3 ALLOC8
0x10 ALLOC9+0x2
}
alloc18 (size: 4, align: 1) {
ALLOC7 (size: 4, align: 1) {
2a 45 15 6f *E.o
}
alloc19 (size: 1, align: 1) {
ALLOC8 (size: 1, align: 1) {
2a *
}
alloc20 (size: 4, align: 1) {
ALLOC9 (size: 4, align: 1) {
2a 45 15 6f *E.o
}

View File

@ -8,7 +8,7 @@ fn main() -> () {
bb0: {
StorageLive(_1);
StorageLive(_2);
_2 = const {alloc1: &&Packed};
_2 = const {ALLOC0: &&Packed};
_1 = (*_2);
StorageDead(_2);
StorageDead(_1);
@ -17,31 +17,31 @@ fn main() -> () {
}
}
alloc1 (static: FOO, size: 4, align: 4) {
alloc12
ALLOC0 (static: FOO, size: 4, align: 4) {
ALLOC1
}
alloc12 (size: 168, align: 1) {
ALLOC1 (size: 168, align: 1) {
0x00 ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................
0x10 ab ab ab ab ab ab ab ab ab ab ab ab alloc7 ............
0x10 ab ab ab ab ab ab ab ab ab ab ab ab ALLOC2 ............
0x20 01 ef cd ab 00 00 00 00 00 00 00 00 00 00 00 00 ................
0x30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0x40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0x50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0x60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0x70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0x80 00 00 00 00 00 00 00 00 00 00 alloc9 00 00 ............
0x90 a10+0x63 00 00 00 00 00 00 00 00 00 00 00 00 ............
0x80 00 00 00 00 00 00 00 00 00 00 ALLOC3 00 00 ............
0x90 A4+0x63 00 00 00 00 00 00 00 00 00 00 00 00 ............
0xa0 00 00 00 00 00 00 00 00 ........
}
alloc7 (size: 4, align: 4) {
ALLOC2 (size: 4, align: 4) {
2a 00 00 00 *...
}
alloc9 (fn: main)
ALLOC3 (fn: main)
alloc10 (size: 100, align: 1) {
ALLOC4 (size: 100, align: 1) {
0x00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0x10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0x20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

View File

@ -8,7 +8,7 @@ fn main() -> () {
bb0: {
StorageLive(_1);
StorageLive(_2);
_2 = const {alloc1: &&Packed};
_2 = const {ALLOC0: &&Packed};
_1 = (*_2);
StorageDead(_2);
StorageDead(_1);
@ -17,13 +17,13 @@ fn main() -> () {
}
}
alloc1 (static: FOO, size: 8, align: 8) {
alloc12
ALLOC0 (static: FOO, size: 8, align: 8) {
ALLOC1
}
alloc12 (size: 180, align: 1) {
ALLOC1 (size: 180, align: 1) {
0x00 ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ................
0x10 ab ab ab ab ab ab ab ab ab ab ab ab alloc7 ............
0x10 ab ab ab ab ab ab ab ab ab ab ab ab ALLOC2 ............
0x20 01 ef cd ab 00 00 00 00 00 00 00 00 ............
0x30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0x40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
@ -31,18 +31,18 @@ alloc12 (size: 180, align: 1) {
0x60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0x70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0x80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
0x90 alloc9 00 00 alloc10+0x63 ..
0x90 ALLOC3 00 00 ALLOC4+0x63 ..
0xa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0xb0 00 00 00 00 ....
}
alloc7 (size: 4, align: 4) {
ALLOC2 (size: 4, align: 4) {
2a 00 00 00 *...
}
alloc9 (fn: main)
ALLOC3 (fn: main)
alloc10 (size: 100, align: 1) {
ALLOC4 (size: 100, align: 1) {
0x00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0x10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0x20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

View File

@ -7,7 +7,7 @@ promoted[0] in BAR: &[&i32; 1] = {
let mut _3: &i32;
bb0: {
_3 = const {alloc1: &i32};
_3 = const {ALLOC0: &i32};
_2 = &(*_3);
_1 = [move _2];
_0 = &_1;
@ -15,6 +15,6 @@ promoted[0] in BAR: &[&i32; 1] = {
}
}
alloc1 (static: Y, size: 4, align: 4) {
ALLOC0 (static: Y, size: 4, align: 4) {
2a 00 00 00 *...
}

View File

@ -16,7 +16,7 @@
- StorageLive(_3);
- StorageLive(_4);
- StorageLive(_5);
- _5 = const {alloc1: &i32};
- _5 = const {ALLOC0: &i32};
- _4 = &(*_5);
- _3 = [move _4];
- _2 = &_3;
@ -40,7 +40,7 @@
}
- }
-
- alloc1 (static: Y, size: 4, align: 4) {
- ALLOC0 (static: Y, size: 4, align: 4) {
- 2a 00 00 00 │ *...
}

View File

@ -7,7 +7,7 @@ promoted[0] in FOO: &[&i32; 1] = {
let mut _3: *const i32;
bb0: {
_3 = const {alloc3: *const i32};
_3 = const {ALLOC0: *const i32};
_2 = &(*_3);
_1 = [move _2];
_0 = &_1;
@ -15,4 +15,4 @@ promoted[0] in FOO: &[&i32; 1] = {
}
}
alloc3 (extern static: X)
ALLOC0 (extern static: X)

View File

@ -18,7 +18,7 @@
- StorageLive(_3);
- StorageLive(_4);
- StorageLive(_5);
- _5 = const {alloc3: *const i32};
- _5 = const {ALLOC0: *const i32};
- _4 = &(*_5);
- _3 = [move _4];
- _2 = &_3;
@ -42,5 +42,5 @@
}
}
-
- alloc3 (extern static: X)
- ALLOC0 (extern static: X)

View File

@ -26,7 +26,7 @@
}
+ }
+
+ alloc3 (size: 8, align: 4) {
+ ALLOC0 (size: 8, align: 4) {
+ 02 00 00 00 00 __ __ __ │ .....░░░
}

View File

@ -26,7 +26,7 @@
}
+ }
+
+ alloc3 (size: 8, align: 4) {
+ ALLOC0 (size: 8, align: 4) {
+ 02 00 00 00 00 __ __ __ │ .....░░░
}

View File

@ -31,7 +31,7 @@
}
+ }
+
+ alloc3 (size: 2, align: 1) {
+ ALLOC0 (size: 2, align: 1) {
+ 03 00 │ ..
}

View File

@ -31,7 +31,7 @@
}
+ }
+
+ alloc3 (size: 2, align: 1) {
+ ALLOC0 (size: 2, align: 1) {
+ 03 00 │ ..
}

View File

@ -39,7 +39,7 @@
}
+ }
+
+ alloc3 (size: 2, align: 1) {
+ ALLOC0 (size: 2, align: 1) {
+ 00 01 │ ..
}

View File

@ -39,7 +39,7 @@
}
+ }
+
+ alloc3 (size: 2, align: 1) {
+ ALLOC0 (size: 2, align: 1) {
+ 00 01 │ ..
}

View File

@ -20,11 +20,11 @@
}
+ }
+
+ alloc8 (size: 2, align: 1) {
+ ALLOC0 (size: 2, align: 1) {
+ 00 00 │ ..
+ }
+
+ alloc7 (size: 2, align: 1) {
+ ALLOC1 (size: 2, align: 1) {
+ 00 00 │ ..
}

View File

@ -20,11 +20,11 @@
}
+ }
+
+ alloc8 (size: 2, align: 1) {
+ ALLOC0 (size: 2, align: 1) {
+ 00 00 │ ..
+ }
+
+ alloc7 (size: 2, align: 1) {
+ ALLOC1 (size: 2, align: 1) {
+ 00 00 │ ..
}

View File

@ -25,15 +25,15 @@
}
+ }
+
+ alloc12 (size: 2, align: 1) {
+ ALLOC0 (size: 2, align: 1) {
+ 01 02 │ ..
+ }
+
+ alloc11 (size: 2, align: 1) {
+ ALLOC1 (size: 2, align: 1) {
+ 01 02 │ ..
+ }
+
+ alloc8 (size: 2, align: 1) {
+ ALLOC2 (size: 2, align: 1) {
+ 01 02 │ ..
}

View File

@ -25,15 +25,15 @@
}
+ }
+
+ alloc12 (size: 2, align: 1) {
+ ALLOC0 (size: 2, align: 1) {
+ 01 02 │ ..
+ }
+
+ alloc11 (size: 2, align: 1) {
+ ALLOC1 (size: 2, align: 1) {
+ 01 02 │ ..
+ }
+
+ alloc8 (size: 2, align: 1) {
+ ALLOC2 (size: 2, align: 1) {
+ 01 02 │ ..
}

View File

@ -27,11 +27,11 @@
}
+ }
+
+ alloc7 (size: 8, align: 4) {
+ ALLOC0 (size: 8, align: 4) {
+ 2a 00 00 00 63 00 00 00 │ *...c...
+ }
+
+ alloc5 (size: 8, align: 4) {
+ ALLOC1 (size: 8, align: 4) {
+ 2a 00 00 00 2b 00 00 00 │ *...+...
}

View File

@ -23,7 +23,7 @@
StorageLive(_2);
StorageLive(_3);
StorageLive(_4);
_4 = const {alloc1: *mut u32};
_4 = const {ALLOC0: *mut u32};
_3 = (*_4);
_1 = move _3;
StorageDead(_3);
@ -39,7 +39,7 @@
}
}
alloc1 (static: STATIC, size: 4, align: 4) {
ALLOC0 (static: STATIC, size: 4, align: 4) {
42 42 42 42 │ BBBB
}

View File

@ -48,7 +48,7 @@
}
+ }
+
+ alloc7 (size: 8, align: 4) {
+ ALLOC0 (size: 8, align: 4) {
+ 01 00 00 00 02 00 00 00 │ ........
}

View File

@ -48,7 +48,7 @@
}
+ }
+
+ alloc7 (size: 8, align: 4) {
+ ALLOC0 (size: 8, align: 4) {
+ 01 00 00 00 02 00 00 00 │ ........
}

View File

@ -16,12 +16,12 @@
StorageLive(_1);
StorageLive(_2);
StorageLive(_3);
_3 = const {alloc1: &u8};
_3 = const {ALLOC0: &u8};
- _2 = (*_3);
+ _2 = const 2_u8;
StorageLive(_4);
StorageLive(_5);
_5 = const {alloc1: &u8};
_5 = const {ALLOC0: &u8};
- _4 = (*_5);
- _1 = Add(move _2, move _4);
+ _4 = const 2_u8;
@ -36,7 +36,7 @@
}
}
alloc1 (static: FOO, size: 1, align: 1) {
ALLOC0 (static: FOO, size: 1, align: 1) {
02 │ .
}

View File

@ -19,7 +19,7 @@
}
+ }
+
+ alloc5 (size: 8, align: 4) {
+ ALLOC0 (size: 8, align: 4) {
+ 04 00 00 00 00 __ __ __ │ .....░░░
}

View File

@ -19,7 +19,7 @@
}
+ }
+
+ alloc5 (size: 8, align: 4) {
+ ALLOC0 (size: 8, align: 4) {
+ 04 00 00 00 00 __ __ __ │ .....░░░
}

View File

@ -15,6 +15,6 @@ fn add() -> u32 {
}
}
alloc5 (size: 8, align: 4) {
ALLOC0 (size: 8, align: 4) {
04 00 00 00 00 __ __ __ .....
}

View File

@ -15,6 +15,6 @@ fn add() -> u32 {
}
}
alloc5 (size: 8, align: 4) {
ALLOC0 (size: 8, align: 4) {
04 00 00 00 00 __ __ __ .....
}

View File

@ -31,15 +31,15 @@
}
+ }
+
+ alloc9 (size: 8, align: 4) {
+ ALLOC0 (size: 8, align: 4) {
+ 01 00 00 00 02 00 00 00 │ ........
+ }
+
+ alloc8 (size: 8, align: 4) {
+ ALLOC1 (size: 8, align: 4) {
+ 01 00 00 00 02 00 00 00 │ ........
+ }
+
+ alloc6 (size: 8, align: 4) {
+ ALLOC2 (size: 8, align: 4) {
+ 01 00 00 00 02 00 00 00 │ ........
}

View File

@ -31,15 +31,15 @@
}
+ }
+
+ alloc9 (size: 8, align: 4) {
+ ALLOC0 (size: 8, align: 4) {
+ 01 00 00 00 02 00 00 00 │ ........
+ }
+
+ alloc8 (size: 8, align: 4) {
+ ALLOC1 (size: 8, align: 4) {
+ 01 00 00 00 02 00 00 00 │ ........
+ }
+
+ alloc6 (size: 8, align: 4) {
+ ALLOC2 (size: 8, align: 4) {
+ 01 00 00 00 02 00 00 00 │ ........
}

View File

@ -87,13 +87,13 @@
+ _4 = const Unique::<[bool; 0]> {{ pointer: NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}, _marker: PhantomData::<[bool; 0]> }};
StorageDead(_5);
- _3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize));
+ _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc7, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
+ _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
StorageDead(_4);
- _2 = Box::<[bool]>(_3, const std::alloc::Global);
+ _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc10, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
+ _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
StorageDead(_3);
- _1 = A { foo: move _2 };
+ _1 = A { foo: const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc11, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) };
+ _1 = A { foo: const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) };
StorageDead(_2);
_0 = const ();
drop(_1) -> [return: bb1, unwind unreachable];
@ -105,15 +105,15 @@
}
+ }
+
+ alloc11 (size: 8, align: 4) {
+ ALLOC2 (size: 8, align: 4) {
+ 01 00 00 00 00 00 00 00 │ ........
+ }
+
+ alloc10 (size: 8, align: 4) {
+ ALLOC1 (size: 8, align: 4) {
+ 01 00 00 00 00 00 00 00 │ ........
+ }
+
+ alloc7 (size: 8, align: 4) {
+ ALLOC0 (size: 8, align: 4) {
+ 01 00 00 00 00 00 00 00 │ ........
}

View File

@ -87,13 +87,13 @@
+ _4 = const Unique::<[bool; 0]> {{ pointer: NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}, _marker: PhantomData::<[bool; 0]> }};
StorageDead(_5);
- _3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize));
+ _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc7, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
+ _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
StorageDead(_4);
- _2 = Box::<[bool]>(_3, const std::alloc::Global);
+ _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc10, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
+ _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
StorageDead(_3);
- _1 = A { foo: move _2 };
+ _1 = A { foo: const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc11, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) };
+ _1 = A { foo: const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) };
StorageDead(_2);
_0 = const ();
drop(_1) -> [return: bb1, unwind: bb2];
@ -109,15 +109,15 @@
}
+ }
+
+ alloc11 (size: 8, align: 4) {
+ ALLOC2 (size: 8, align: 4) {
+ 01 00 00 00 00 00 00 00 │ ........
+ }
+
+ alloc10 (size: 8, align: 4) {
+ ALLOC1 (size: 8, align: 4) {
+ 01 00 00 00 00 00 00 00 │ ........
+ }
+
+ alloc7 (size: 8, align: 4) {
+ ALLOC0 (size: 8, align: 4) {
+ 01 00 00 00 00 00 00 00 │ ........
}

View File

@ -87,13 +87,13 @@
+ _4 = const Unique::<[bool; 0]> {{ pointer: NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}, _marker: PhantomData::<[bool; 0]> }};
StorageDead(_5);
- _3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize));
+ _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc7, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
+ _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
StorageDead(_4);
- _2 = Box::<[bool]>(_3, const std::alloc::Global);
+ _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc10, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
+ _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
StorageDead(_3);
- _1 = A { foo: move _2 };
+ _1 = A { foo: const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc11, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) };
+ _1 = A { foo: const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) };
StorageDead(_2);
_0 = const ();
drop(_1) -> [return: bb1, unwind unreachable];
@ -105,15 +105,15 @@
}
+ }
+
+ alloc11 (size: 16, align: 8) {
+ ALLOC2 (size: 16, align: 8) {
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+ }
+
+ alloc10 (size: 16, align: 8) {
+ ALLOC1 (size: 16, align: 8) {
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+ }
+
+ alloc7 (size: 16, align: 8) {
+ ALLOC0 (size: 16, align: 8) {
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
}

View File

@ -87,13 +87,13 @@
+ _4 = const Unique::<[bool; 0]> {{ pointer: NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}, _marker: PhantomData::<[bool; 0]> }};
StorageDead(_5);
- _3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize));
+ _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc7, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
+ _3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
StorageDead(_4);
- _2 = Box::<[bool]>(_3, const std::alloc::Global);
+ _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc10, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
+ _2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
StorageDead(_3);
- _1 = A { foo: move _2 };
+ _1 = A { foo: const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc11, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) };
+ _1 = A { foo: const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) };
StorageDead(_2);
_0 = const ();
drop(_1) -> [return: bb1, unwind: bb2];
@ -109,15 +109,15 @@
}
+ }
+
+ alloc11 (size: 16, align: 8) {
+ ALLOC2 (size: 16, align: 8) {
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+ }
+
+ alloc10 (size: 16, align: 8) {
+ ALLOC1 (size: 16, align: 8) {
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+ }
+
+ alloc7 (size: 16, align: 8) {
+ ALLOC0 (size: 16, align: 8) {
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
}

View File

@ -81,11 +81,11 @@
StorageDead(_6);
_4 = const Unique::<[bool; 0]> {{ pointer: NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}, _marker: PhantomData::<[bool; 0]> }};
StorageDead(_5);
_3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc7, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
_3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
StorageDead(_4);
_2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc10, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
_2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
StorageDead(_3);
_1 = A { foo: const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc11, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) };
_1 = A { foo: const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) };
StorageDead(_2);
_0 = const ();
drop(_1) -> [return: bb1, unwind unreachable];
@ -97,15 +97,15 @@
}
}
alloc11 (size: 8, align: 4) {
ALLOC2 (size: 8, align: 4) {
01 00 00 00 00 00 00 00 │ ........
}
alloc10 (size: 8, align: 4) {
ALLOC1 (size: 8, align: 4) {
01 00 00 00 00 00 00 00 │ ........
}
alloc7 (size: 8, align: 4) {
ALLOC0 (size: 8, align: 4) {
01 00 00 00 00 00 00 00 │ ........
}

View File

@ -81,11 +81,11 @@
StorageDead(_6);
_4 = const Unique::<[bool; 0]> {{ pointer: NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}, _marker: PhantomData::<[bool; 0]> }};
StorageDead(_5);
_3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc7, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
_3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
StorageDead(_4);
_2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc10, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
_2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
StorageDead(_3);
_1 = A { foo: const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc11, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) };
_1 = A { foo: const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) };
StorageDead(_2);
_0 = const ();
drop(_1) -> [return: bb1, unwind: bb2];
@ -101,15 +101,15 @@
}
}
alloc11 (size: 8, align: 4) {
ALLOC2 (size: 8, align: 4) {
01 00 00 00 00 00 00 00 │ ........
}
alloc10 (size: 8, align: 4) {
ALLOC1 (size: 8, align: 4) {
01 00 00 00 00 00 00 00 │ ........
}
alloc7 (size: 8, align: 4) {
ALLOC0 (size: 8, align: 4) {
01 00 00 00 00 00 00 00 │ ........
}

View File

@ -81,11 +81,11 @@
StorageDead(_6);
_4 = const Unique::<[bool; 0]> {{ pointer: NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}, _marker: PhantomData::<[bool; 0]> }};
StorageDead(_5);
_3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc7, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
_3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
StorageDead(_4);
_2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc10, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
_2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
StorageDead(_3);
_1 = A { foo: const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc11, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) };
_1 = A { foo: const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) };
StorageDead(_2);
_0 = const ();
drop(_1) -> [return: bb1, unwind unreachable];
@ -97,15 +97,15 @@
}
}
alloc11 (size: 16, align: 8) {
ALLOC2 (size: 16, align: 8) {
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
}
alloc10 (size: 16, align: 8) {
ALLOC1 (size: 16, align: 8) {
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
}
alloc7 (size: 16, align: 8) {
ALLOC0 (size: 16, align: 8) {
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
}

View File

@ -81,11 +81,11 @@
StorageDead(_6);
_4 = const Unique::<[bool; 0]> {{ pointer: NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}, _marker: PhantomData::<[bool; 0]> }};
StorageDead(_5);
_3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc7, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
_3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
StorageDead(_4);
_2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc10, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
_2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
StorageDead(_3);
_1 = A { foo: const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: alloc11, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) };
_1 = A { foo: const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) };
StorageDead(_2);
_0 = const ();
drop(_1) -> [return: bb1, unwind: bb2];
@ -101,15 +101,15 @@
}
}
alloc11 (size: 16, align: 8) {
ALLOC2 (size: 16, align: 8) {
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
}
alloc10 (size: 16, align: 8) {
ALLOC1 (size: 16, align: 8) {
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
}
alloc7 (size: 16, align: 8) {
ALLOC0 (size: 16, align: 8) {
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
}

View File

@ -43,7 +43,7 @@
bb0: {
StorageLive(_1);
StorageLive(_2);
_2 = const {alloc1: &E};
_2 = const {ALLOC0: &E};
_1 = (*_2);
StorageDead(_2);
StorageLive(_3);
@ -78,7 +78,7 @@
bb4: {
StorageLive(_7);
StorageLive(_8);
_8 = const {alloc2: &&E};
_8 = const {ALLOC1: &&E};
_7 = (*_8);
StorageDead(_8);
StorageLive(_9);
@ -112,15 +112,15 @@
}
}
alloc2 (static: RC, size: 4, align: 4) {
╾─alloc14─╼ │ ╾──╼
ALLOC1 (static: RC, size: 4, align: 4) {
╾─ALLOC2──╼ │ ╾──╼
}
alloc14 (size: 8, align: 4) {
ALLOC2 (size: 8, align: 4) {
01 00 00 00 04 00 00 00 │ ........
}
alloc1 (static: statics::C, size: 8, align: 4) {
ALLOC0 (static: statics::C, size: 8, align: 4) {
00 00 00 00 00 00 00 00 │ ........
}

View File

@ -43,7 +43,7 @@
bb0: {
StorageLive(_1);
StorageLive(_2);
_2 = const {alloc1: &E};
_2 = const {ALLOC0: &E};
_1 = (*_2);
StorageDead(_2);
StorageLive(_3);
@ -78,7 +78,7 @@
bb4: {
StorageLive(_7);
StorageLive(_8);
_8 = const {alloc2: &&E};
_8 = const {ALLOC1: &&E};
_7 = (*_8);
StorageDead(_8);
StorageLive(_9);
@ -112,15 +112,15 @@
}
}
alloc2 (static: RC, size: 8, align: 8) {
╾───────alloc14───────╼ │ ╾──────╼
ALLOC1 (static: RC, size: 8, align: 8) {
╾───────ALLOC2────────╼ │ ╾──────╼
}
alloc14 (size: 8, align: 4) {
ALLOC2 (size: 8, align: 4) {
01 00 00 00 04 00 00 00 │ ........
}
alloc1 (static: statics::C, size: 8, align: 4) {
ALLOC0 (static: statics::C, size: 8, align: 4) {
00 00 00 00 00 00 00 00 │ ........
}

View File

@ -84,7 +84,7 @@
+ _10 = const S(13_i32);
StorageDead(_11);
StorageLive(_16);
_16 = const {alloc1: &&BigStruct};
_16 = const {ALLOC0: &&BigStruct};
_17 = deref_copy (*_16);
StorageLive(_12);
_18 = deref_copy (*_16);
@ -119,11 +119,11 @@
}
}
alloc1 (static: STAT, size: 4, align: 4) {
╾─alloc15─╼ │ ╾──╼
ALLOC0 (static: STAT, size: 4, align: 4) {
╾─ALLOC1──╼ │ ╾──╼
}
alloc15 (size: 16, align: 4) {
ALLOC1 (size: 16, align: 4) {
01 00 00 00 00 00 e0 40 0d 00 00 00 05 __ __ __ │ .......@.....░░░
}

View File

@ -84,7 +84,7 @@
+ _10 = const S(13_i32);
StorageDead(_11);
StorageLive(_16);
_16 = const {alloc1: &&BigStruct};
_16 = const {ALLOC0: &&BigStruct};
_17 = deref_copy (*_16);
StorageLive(_12);
_18 = deref_copy (*_16);
@ -119,11 +119,11 @@
}
}
alloc1 (static: STAT, size: 8, align: 8) {
╾───────alloc15───────╼ │ ╾──────╼
ALLOC0 (static: STAT, size: 8, align: 8) {
╾───────ALLOC1────────╼ │ ╾──────╼
}
alloc15 (size: 16, align: 4) {
ALLOC1 (size: 16, align: 4) {
01 00 00 00 00 00 e0 40 0d 00 00 00 05 __ __ __ │ .......@.....░░░
}

View File

@ -66,7 +66,7 @@
}
+ }
+
+ alloc15 (size: 8, align: 4) {
+ ALLOC0 (size: 8, align: 4) {
+ 02 00 00 00 05 20 00 00 │ ..... ..
}

View File

@ -66,7 +66,7 @@
}
+ }
+
+ alloc15 (size: 16, align: 8) {
+ ALLOC0 (size: 16, align: 8) {
+ 02 00 00 00 00 00 00 00 05 20 00 00 00 00 00 00 │ ......... ......
}

View File

@ -66,7 +66,7 @@
}
+ }
+
+ alloc14 (size: 8, align: 4) {
+ ALLOC0 (size: 8, align: 4) {
+ 05 20 00 00 01 00 00 00 │ . ......
}

View File

@ -66,7 +66,7 @@
}
+ }
+
+ alloc14 (size: 16, align: 8) {
+ ALLOC0 (size: 16, align: 8) {
+ 05 20 00 00 00 00 00 00 01 00 00 00 00 00 00 00 │ . ..............
}

View File

@ -271,6 +271,6 @@ fn main() -> () {
}
}
alloc4 (size: 4, align: 1) {
ALLOC0 (size: 4, align: 1) {
41 41 41 41 AAAA
}

View File

@ -271,6 +271,6 @@ fn main() -> () {
}
}
alloc4 (size: 4, align: 1) {
ALLOC0 (size: 4, align: 1) {
41 41 41 41 AAAA
}

View File

@ -57,7 +57,7 @@
}
+ }
+
+ alloc5 (size: 8, align: 4) {
+ ALLOC0 (size: 8, align: 4) {
+ 04 00 00 00 00 __ __ __ │ .....░░░
}

View File

@ -57,7 +57,7 @@
}
+ }
+
+ alloc5 (size: 8, align: 4) {
+ ALLOC0 (size: 8, align: 4) {
+ 04 00 00 00 00 __ __ __ │ .....░░░
}

View File

@ -57,7 +57,7 @@
}
+ }
+
+ alloc5 (size: 8, align: 4) {
+ ALLOC0 (size: 8, align: 4) {
+ 04 00 00 00 00 __ __ __ │ .....░░░
}

View File

@ -57,7 +57,7 @@
}
+ }
+
+ alloc5 (size: 8, align: 4) {
+ ALLOC0 (size: 8, align: 4) {
+ 04 00 00 00 00 __ __ __ │ .....░░░
}

View File

@ -11,7 +11,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/issue-100313.rs:10:13
|
LL | *(B as *const bool as *mut bool) = false;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to alloc7 which is read-only
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to ALLOC0 which is read-only
|
note: inside `T::<&true>::set_false`
--> $DIR/issue-100313.rs:10:13

View File

@ -1,7 +1,7 @@
// Strip out raw byte dumps to make comparison platform-independent:
// normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
// normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*a(lloc)?[0-9]+(\+[a-z0-9]+)?─*╼ )+ *│.*" -> "HEX_DUMP"
// normalize-stderr-test "alloc\d+" -> "allocN"
// normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*A(LLOC)?[0-9]+(\+[a-z0-9]+)?─*╼ )+ *│.*" -> "HEX_DUMP"
#![feature(
slice_from_ptr_range,
const_slice_from_ptr_range,

View File

@ -122,7 +122,7 @@ LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
error[E0080]: could not evaluate static initializer
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
= note: out-of-bounds pointer arithmetic: allocN has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
= note: out-of-bounds pointer arithmetic: ALLOC6 has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
|
note: inside `ptr::const_ptr::<impl *const u32>::add`
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@ -181,7 +181,7 @@ LL | pub static R7: &[u16] = unsafe {
error[E0080]: could not evaluate static initializer
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
= note: out-of-bounds pointer arithmetic: allocN has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
= note: out-of-bounds pointer arithmetic: ALLOC11 has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
|
note: inside `ptr::const_ptr::<impl *const u64>::add`
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL

View File

@ -1,7 +1,7 @@
error[E0080]: evaluation of constant value failed
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
= note: memory access failed: alloc5 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
= note: memory access failed: ALLOC0 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
|
note: inside `std::ptr::read::<u32>`
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
@ -14,7 +14,7 @@ LL | const _READ: u32 = unsafe { ptr::read(PAST_END_PTR) };
error[E0080]: evaluation of constant value failed
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
= note: memory access failed: alloc5 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
= note: memory access failed: ALLOC0 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
|
note: inside `std::ptr::read::<u32>`
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
@ -29,7 +29,7 @@ LL | const _CONST_READ: u32 = unsafe { PAST_END_PTR.read() };
error[E0080]: evaluation of constant value failed
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
= note: memory access failed: alloc5 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
= note: memory access failed: ALLOC0 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
|
note: inside `std::ptr::read::<u32>`
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL

View File

@ -20,25 +20,25 @@ error[E0080]: evaluation of constant value failed
--> $DIR/const-compare-bytes-ub.rs:22:9
|
LL | compare_bytes([1, 2, 3].as_ptr(), [1, 2, 3, 4].as_ptr(), 4)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: alloc6 has size 3, so pointer to 4 bytes starting at offset 0 is out-of-bounds
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC0 has size 3, so pointer to 4 bytes starting at offset 0 is out-of-bounds
error[E0080]: evaluation of constant value failed
--> $DIR/const-compare-bytes-ub.rs:26:9
|
LL | compare_bytes([1, 2, 3, 4].as_ptr(), [1, 2, 3].as_ptr(), 4)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: alloc13 has size 3, so pointer to 4 bytes starting at offset 0 is out-of-bounds
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC1 has size 3, so pointer to 4 bytes starting at offset 0 is out-of-bounds
error[E0080]: evaluation of constant value failed
--> $DIR/const-compare-bytes-ub.rs:30:9
|
LL | compare_bytes(MaybeUninit::uninit().as_ptr(), [1].as_ptr(), 1)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reading memory at alloc17[0x0..0x1], but memory is uninitialized at [0x0..0x1], and this operation requires initialized memory
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reading memory at ALLOC2[0x0..0x1], but memory is uninitialized at [0x0..0x1], and this operation requires initialized memory
error[E0080]: evaluation of constant value failed
--> $DIR/const-compare-bytes-ub.rs:34:9
|
LL | compare_bytes([1].as_ptr(), MaybeUninit::uninit().as_ptr(), 1)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reading memory at alloc25[0x0..0x1], but memory is uninitialized at [0x0..0x1], and this operation requires initialized memory
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reading memory at ALLOC3[0x0..0x1], but memory is uninitialized at [0x0..0x1], and this operation requires initialized memory
error[E0080]: evaluation of constant value failed
--> $DIR/const-compare-bytes-ub.rs:38:9

View File

@ -6,7 +6,7 @@ LL | const BAR: &i32 = unsafe { &*(intrinsics::const_allocate(4, 4) as *mut i32)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
╾─alloc2──╼ │ ╾──╼
╾─ALLOC0──╼ │ ╾──╼
}
error: aborting due to previous error

View File

@ -6,7 +6,7 @@ LL | const BAR: &i32 = unsafe { &*(intrinsics::const_allocate(4, 4) as *mut i32)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
╾───────alloc2────────╼ │ ╾──────╼
╾───────ALLOC0────────╼ │ ╾──────╼
}
error: aborting due to previous error

View File

@ -8,7 +8,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/dealloc_intrinsic_dangling.rs:18:5
|
LL | *reference
| ^^^^^^^^^^ memory access failed: alloc4 has been freed, so this pointer is dangling
| ^^^^^^^^^^ memory access failed: ALLOC0 has been freed, so this pointer is dangling
error: aborting due to 2 previous errors

View File

@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/dealloc_intrinsic_duplicate.rs:9:5
|
LL | intrinsics::const_deallocate(ptr, 4, 4);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: alloc2 has been freed, so this pointer is dangling
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC0 has been freed, so this pointer is dangling
error: aborting due to previous error

View File

@ -2,19 +2,19 @@ error[E0080]: evaluation of constant value failed
--> $DIR/dealloc_intrinsic_incorrect_layout.rs:8:5
|
LL | intrinsics::const_deallocate(ptr, 4, 2);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: alloc2 has size 4 and alignment 4, but gave size 4 and alignment 2
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: ALLOC0 has size 4 and alignment 4, but gave size 4 and alignment 2
error[E0080]: evaluation of constant value failed
--> $DIR/dealloc_intrinsic_incorrect_layout.rs:13:5
|
LL | intrinsics::const_deallocate(ptr, 2, 4);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: alloc4 has size 4 and alignment 4, but gave size 2 and alignment 4
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: ALLOC1 has size 4 and alignment 4, but gave size 2 and alignment 4
error[E0080]: evaluation of constant value failed
--> $DIR/dealloc_intrinsic_incorrect_layout.rs:19:5
|
LL | intrinsics::const_deallocate(ptr, 3, 4);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: alloc6 has size 4 and alignment 4, but gave size 3 and alignment 4
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: ALLOC2 has size 4 and alignment 4, but gave size 3 and alignment 4
error[E0080]: evaluation of constant value failed
--> $DIR/dealloc_intrinsic_incorrect_layout.rs:25:5

View File

@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/issue-49296.rs:9:16
|
LL | const X: u64 = *wat(42);
| ^^^^^^^^ memory access failed: alloc3 has been freed, so this pointer is dangling
| ^^^^^^^^ memory access failed: ALLOC0 has been freed, so this pointer is dangling
error: aborting due to previous error

View File

@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/partial_ptr_overwrite.rs:8:9
|
LL | *(ptr as *mut u8) = 123;
| ^^^^^^^^^^^^^^^^^^^^^^^ unable to overwrite parts of a pointer in memory at alloc4
| ^^^^^^^^^^^^^^^^^^^^^^^ unable to overwrite parts of a pointer in memory at ALLOC0
|
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported

View File

@ -211,7 +211,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:106:1
|
LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a function pointer
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC3, but expected a function pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
@ -385,7 +385,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:175:1
|
LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC16, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
@ -396,7 +396,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:179:1
|
LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC18, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
@ -418,7 +418,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:186:1
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC21, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
@ -451,7 +451,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:196:1
|
LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC26, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
@ -556,7 +556,7 @@ LL | pub static S7: &[u16] = unsafe {
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
╾ALLOC_ID+0x2╼ 04 00 00 00 │ ╾──╼....
╾A31+0x2──╼ 04 00 00 00 │ ╾──╼....
}
error[E0080]: it is undefined behavior to use this value

View File

@ -211,7 +211,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:106:1
|
LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a function pointer
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC3, but expected a function pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
@ -385,7 +385,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:175:1
|
LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC16, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
@ -396,7 +396,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:179:1
|
LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC18, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
@ -418,7 +418,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:186:1
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC21, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
@ -451,7 +451,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:196:1
|
LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC26, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {

View File

@ -1,8 +1,8 @@
// stderr-per-bitwidth
// ignore-endian-big
// ignore-tidy-linelength
// normalize-stderr-test "╾─*a(lloc)?[0-9]+(\+[a-z0-9]+)?─*╼" -> "╾ALLOC_ID$2╼"
// normalize-stderr-test "alloc\d+" -> "allocN"
// normalize-stderr-test "╾─*ALLOC[0-9]+(\+[a-z0-9]+)?─*╼" -> "╾ALLOC_ID$1╼"
#![feature(never_type, rustc_attrs, ptr_metadata, slice_from_ptr_range, const_slice_from_ptr_range)]
#![allow(invalid_value)]

View File

@ -1,8 +1,8 @@
// normalize-stderr-test "alloc\d+" -> "allocN"
#![feature(const_pointer_byte_offsets)]
#![feature(pointer_byte_offsets)]
#![feature(const_mut_refs)]
const MISALIGNED_LOAD: () = unsafe {
let mem = [0u32; 8];
let ptr = mem.as_ptr().byte_add(1);

View File

@ -35,7 +35,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/raw-pointer-ub.rs:43:16
|
LL | let _val = *ptr;
| ^^^^ memory access failed: allocN has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
| ^^^^ memory access failed: ALLOC0 has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
error: aborting due to 5 previous errors

View File

@ -2,55 +2,55 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-incorrect-vtable.rs:18:1
|
LL | const INVALID_VTABLE_ALIGNMENT: &dyn Trait =
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC0, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
╾─allocN──╼ ╾─allocN──╼ │ ╾──╼╾──╼
╾─ALLOC1──╼ ╾─ALLOC0──╼ │ ╾──╼╾──╼
}
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-incorrect-vtable.rs:23:1
|
LL | const INVALID_VTABLE_SIZE: &dyn Trait =
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC2, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
╾─allocN─╼ ╾─allocN─╼ │ ╾──╼╾──╼
╾─ALLOC3──╼ ╾─ALLOC2──╼ │ ╾──╼╾──╼
}
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-incorrect-vtable.rs:33:1
|
LL | const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> =
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC4, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
╾─allocN─╼ ╾─allocN─╼ │ ╾──╼╾──╼
╾─ALLOC5──╼ ╾─ALLOC4──╼ │ ╾──╼╾──╼
}
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-incorrect-vtable.rs:38:1
|
LL | const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> =
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC6, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
╾─allocN─╼ ╾─allocN─╼ │ ╾──╼╾──╼
╾─ALLOC7──╼ ╾─ALLOC6──╼ │ ╾──╼╾──╼
}
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-incorrect-vtable.rs:44:1
|
LL | const INVALID_VTABLE_UB: W<&dyn Trait> =
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC8, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
╾─allocN─╼ ╾─allocN─╼ │ ╾──╼╾──╼
╾─ALLOC9──╼ ╾─ALLOC8──╼ │ ╾──╼╾──╼
}
error[E0080]: it is undefined behavior to use this value
@ -61,7 +61,7 @@ LL | const G: Wide = unsafe { Transmute { t: FOO }.u };
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
╾─allocN─╼ ╾─allocN─╼ │ ╾──╼╾──╼
╾─ALLOC10─╼ ╾─ALLOC11─╼ │ ╾──╼╾──╼
}
error: aborting due to 6 previous errors

View File

@ -2,55 +2,55 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-incorrect-vtable.rs:18:1
|
LL | const INVALID_VTABLE_ALIGNMENT: &dyn Trait =
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC0, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
╾───────allocN────────╼ ╾───────allocN────────╼ │ ╾──────╼╾──────╼
╾───────ALLOC1────────╼ ╾───────ALLOC0────────╼ │ ╾──────╼╾──────╼
}
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-incorrect-vtable.rs:23:1
|
LL | const INVALID_VTABLE_SIZE: &dyn Trait =
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC2, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
╾───────allocN───────╼ ╾───────allocN───────╼ │ ╾──────╼╾──────╼
╾───────ALLOC3────────╼ ╾───────ALLOC2────────╼ │ ╾──────╼╾──────╼
}
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-incorrect-vtable.rs:33:1
|
LL | const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> =
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC4, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
╾───────allocN───────╼ ╾───────allocN───────╼ │ ╾──────╼╾──────╼
╾───────ALLOC5────────╼ ╾───────ALLOC4────────╼ │ ╾──────╼╾──────╼
}
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-incorrect-vtable.rs:38:1
|
LL | const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> =
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC6, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
╾───────allocN───────╼ ╾───────allocN───────╼ │ ╾──────╼╾──────╼
╾───────ALLOC7────────╼ ╾───────ALLOC6────────╼ │ ╾──────╼╾──────╼
}
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-incorrect-vtable.rs:44:1
|
LL | const INVALID_VTABLE_UB: W<&dyn Trait> =
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC8, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
╾───────allocN───────╼ ╾───────allocN───────╼ │ ╾──────╼╾──────╼
╾───────ALLOC9────────╼ ╾───────ALLOC8────────╼ │ ╾──────╼╾──────╼
}
error[E0080]: it is undefined behavior to use this value
@ -61,7 +61,7 @@ LL | const G: Wide = unsafe { Transmute { t: FOO }.u };
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
╾───────allocN───────╼ ╾───────allocN───────╼ │ ╾──────╼╾──────╼
╾───────ALLOC10───────╼ ╾───────ALLOC11───────╼ │ ╾──────╼╾──────╼
}
error: aborting due to 6 previous errors

View File

@ -11,7 +11,7 @@
// errors are emitted instead of ICEs.
// stderr-per-bitwidth
// normalize-stderr-test "alloc\d+" -> "allocN"
trait Trait {}

View File

@ -1,6 +1,6 @@
// Strip out raw byte dumps to make comparison platform-independent:
// normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
// normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*a(lloc)?[0-9]+(\+[a-z0-9]+)?─*╼ )+ *│.*" -> "HEX_DUMP"
// normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?─*╼ )+ *│.*" -> "HEX_DUMP"
#![feature(rustc_attrs, ptr_metadata)]
#![allow(invalid_value)] // make sure we cannot allow away the errors tested here

View File

@ -13,7 +13,7 @@ error[E0080]: evaluation of constant value failed
--> $DIR/ub-nonnull.rs:20:29
|
LL | let out_of_bounds_ptr = &ptr[255];
| ^^^^^^^^^ out-of-bounds pointer arithmetic: alloc11 has size 1, so pointer to 255 bytes starting at offset 0 is out-of-bounds
| ^^^^^^^^^ out-of-bounds pointer arithmetic: ALLOC0 has size 1, so pointer to 255 bytes starting at offset 0 is out-of-bounds
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-nonnull.rs:24:1

View File

@ -1,7 +1,7 @@
// ignore-tidy-linelength
// Strip out raw byte dumps to make comparison platform-independent:
// normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
// normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*a(lloc)?[0-9]+(\+[a-z0-9]+)?─*╼ )+ *│.*" -> "HEX_DUMP"
// normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?─*╼ )+ *│.*" -> "HEX_DUMP"
#![allow(invalid_value)]
use std::mem;

View File

@ -141,7 +141,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-ref-ptr.rs:59:1
|
LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered alloc39, but expected a function pointer
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC2, but expected a function pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {

View File

@ -6,7 +6,7 @@ LL | const BAD_UPVAR: &dyn FnOnce() = &{
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
╾─alloc3──╼ ╾─alloc4──╼ │ ╾──╼╾──╼
╾─ALLOC0──╼ ╾─ALLOC1──╼ │ ╾──╼╾──╼
}
error: aborting due to previous error

View File

@ -6,7 +6,7 @@ LL | const BAD_UPVAR: &dyn FnOnce() = &{
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
╾───────alloc3────────╼ ╾───────alloc4────────╼ │ ╾──────╼╾──────╼
╾───────ALLOC0────────╼ ╾───────ALLOC1────────╼ │ ╾──────╼╾──────╼
}
error: aborting due to previous error

View File

@ -5,11 +5,11 @@ use std::mem;
// Strip out raw byte dumps to make comparison platform-independent:
// normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
// normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*a(lloc)?[0-9]+(\+[a-z0-9]+)?─*╼ )+ *│.*" -> "HEX_DUMP"
// normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?─*╼ )+ *│.*" -> "HEX_DUMP"
// normalize-stderr-test "offset \d+" -> "offset N"
// normalize-stderr-test "alloc\d+" -> "allocN"
// normalize-stderr-test "size \d+" -> "size N"
/// A newtype wrapper to prevent MIR generation from inserting reborrows that would affect the error
/// message.
#[repr(transparent)]

View File

@ -189,7 +189,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:113:1
|
LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC11, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
@ -200,7 +200,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:117:1
|
LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC13, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
@ -222,7 +222,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:124:1
|
LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC16, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
@ -233,7 +233,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:127:1
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC18, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
@ -244,7 +244,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:130:1
|
LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC20, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
@ -255,7 +255,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:133:1
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC22, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
@ -288,7 +288,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:145:1
|
LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC27, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
@ -310,7 +310,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:154:1
|
LL | static mut RAW_TRAIT_OBJ_VTABLE_INVALID_THROUGH_REF: *const dyn Trait = unsafe {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC30, but expected a vtable pointer
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {

View File

@ -6,7 +6,7 @@ LL | const TEST: &u8 = &MY_STATIC;
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
╾─alloc1──╼ │ ╾──╼
╾─ALLOC0──╼ │ ╾──╼
}
warning: skipping const checks

View File

@ -6,7 +6,7 @@ LL | const TEST: &u8 = &MY_STATIC;
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
╾───────alloc1────────╼ │ ╾──────╼
╾───────ALLOC0────────╼ │ ╾──────╼
}
warning: skipping const checks

View File

@ -2,13 +2,13 @@ error[E0080]: evaluation of constant value failed
--> $DIR/copy-intrinsic.rs:27:5
|
LL | copy_nonoverlapping(0x100 as *const i32, dangle, 0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: alloc5 has size 4, so pointer at offset 40 is out-of-bounds
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC0 has size 4, so pointer at offset 40 is out-of-bounds
error[E0080]: evaluation of constant value failed
--> $DIR/copy-intrinsic.rs:34:5
|
LL | copy_nonoverlapping(dangle, 0x100 as *mut i32, 0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: alloc7 has size 4, so pointer at offset 40 is out-of-bounds
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC1 has size 4, so pointer at offset 40 is out-of-bounds
error[E0080]: evaluation of constant value failed
--> $DIR/copy-intrinsic.rs:41:5

View File

@ -6,7 +6,7 @@ LL | fn main() {
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
╾─alloc7──╼ │ ╾──╼
╾─ALLOC0──╼ │ ╾──╼
}
note: erroneous constant encountered

View File

@ -6,7 +6,7 @@ LL | fn main() {
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
╾───────alloc7────────╼ │ ╾──────╼
╾───────ALLOC0────────╼ │ ╾──────╼
}
note: erroneous constant encountered

View File

@ -6,7 +6,7 @@ LL | const SLICE_WAY_TOO_LONG: &[u8] = unsafe {
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
╾─alloc4──╼ ff ff ff ff │ ╾──╼....
╾─ALLOC0──╼ ff ff ff ff │ ╾──╼....
}
error: aborting due to previous error

View File

@ -6,7 +6,7 @@ LL | const SLICE_WAY_TOO_LONG: &[u8] = unsafe {
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
╾───────alloc4────────╼ ff ff ff ff ff ff ff ff │ ╾──────╼........
╾───────ALLOC0────────╼ ff ff ff ff ff ff ff ff │ ╾──────╼........
}
error: aborting due to previous error

View File

@ -6,7 +6,7 @@ LL | const G: Fat = unsafe { Transmute { t: FOO }.u };
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
╾───────alloc3────────╼ ╾───────alloc4────────╼ │ ╾──────╼╾──────╼
╾───────ALLOC0────────╼ ╾───────ALLOC1────────╼ │ ╾──────╼╾──────╼
}
error: aborting due to previous error

View File

@ -24,7 +24,7 @@ LL | const REF_INTERIOR_MUT: &usize = {
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
╾─alloc4──╼ │ ╾──╼
╾─ALLOC0──╼ │ ╾──╼
}
error[E0080]: it is undefined behavior to use this value
@ -35,7 +35,7 @@ LL | const READ_IMMUT: &usize = {
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
╾─alloc5──╼ │ ╾──╼
╾─ALLOC1──╼ │ ╾──╼
}
warning: skipping const checks

View File

@ -24,7 +24,7 @@ LL | const REF_INTERIOR_MUT: &usize = {
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
╾───────alloc4────────╼ │ ╾──────╼
╾───────ALLOC0────────╼ │ ╾──────╼
}
error[E0080]: it is undefined behavior to use this value
@ -35,7 +35,7 @@ LL | const READ_IMMUT: &usize = {
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
╾───────alloc5────────╼ │ ╾──────╼
╾───────ALLOC1────────╼ │ ╾──────╼
}
warning: skipping const checks

View File

@ -6,7 +6,7 @@ LL | const SLICE_MUT: &[u8; 1] = {
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
╾─alloc1──╼ │ ╾──╼
╾─ALLOC0──╼ │ ╾──╼
}
error: could not evaluate constant pattern
@ -23,7 +23,7 @@ LL | const U8_MUT: &u8 = {
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
╾─alloc1──╼ │ ╾──╼
╾─ALLOC0──╼ │ ╾──╼
}
error: could not evaluate constant pattern

View File

@ -6,7 +6,7 @@ LL | const SLICE_MUT: &[u8; 1] = {
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
╾───────alloc1────────╼ │ ╾──────╼
╾───────ALLOC0────────╼ │ ╾──────╼
}
error: could not evaluate constant pattern
@ -23,7 +23,7 @@ LL | const U8_MUT: &u8 = {
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
╾───────alloc1────────╼ │ ╾──────╼
╾───────ALLOC0────────╼ │ ╾──────╼
}
error: could not evaluate constant pattern

View File

@ -6,7 +6,7 @@ LL | const MUH: Meh = Meh {
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
╾─alloc3──╼ │ ╾──╼
╾─ALLOC0──╼ │ ╾──╼
}
error[E0080]: it is undefined behavior to use this value
@ -17,7 +17,7 @@ LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 4) {
╾─alloc7──╼ ╾─alloc8──╼ │ ╾──╼╾──╼
╾─ALLOC1──╼ ╾─ALLOC2──╼ │ ╾──╼╾──╼
}
error[E0080]: it is undefined behavior to use this value
@ -28,7 +28,7 @@ LL | const BLUNT: &mut i32 = &mut 42;
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 4, align: 4) {
╾─alloc10─╼ │ ╾──╼
╾─ALLOC3──╼ │ ╾──╼
}
warning: skipping const checks

View File

@ -6,7 +6,7 @@ LL | const MUH: Meh = Meh {
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
╾───────alloc3────────╼ │ ╾──────╼
╾───────ALLOC0────────╼ │ ╾──────╼
}
error[E0080]: it is undefined behavior to use this value
@ -17,7 +17,7 @@ LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 16, align: 8) {
╾───────alloc7────────╼ ╾───────alloc8────────╼ │ ╾──────╼╾──────╼
╾───────ALLOC1────────╼ ╾───────ALLOC2────────╼ │ ╾──────╼╾──────╼
}
error[E0080]: it is undefined behavior to use this value
@ -28,7 +28,7 @@ LL | const BLUNT: &mut i32 = &mut 42;
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
= note: the raw bytes of the constant (size: 8, align: 8) {
╾───────alloc10───────╼ │ ╾──────╼
╾───────ALLOC3────────╼ │ ╾──────╼
}
warning: skipping const checks

Some files were not shown because too many files have changed in this diff Show More