mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
Stop trying to preserve pretty-printing.
This commit is contained in:
parent
0eb958a89b
commit
1f90d857d7
@ -4263,30 +4263,30 @@ impl<'test> TestCx<'test> {
|
||||
// to keep them numbered, to see if the same id appears multiple times.
|
||||
// So we remap to deterministic numbers that only depend on the subset of allocations
|
||||
// that actually appear in the output.
|
||||
// We use uppercase ALLOC to distinguish from the non-normalized version.
|
||||
{
|
||||
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();
|
||||
|
||||
// The alloc-id appears in pretty-printed allocations.
|
||||
let re = Regex::new(r"╾─*a(lloc)?([0-9]+)(\+0x[0-9]+)?─*╼").unwrap();
|
||||
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 orig_len = caps.get(0).unwrap().as_str().len();
|
||||
let ret_len = ret.len();
|
||||
for _ in orig_len..ret_len {
|
||||
ret.push('─');
|
||||
}
|
||||
}
|
||||
ret
|
||||
let offset = caps.get(3).map_or("", |c| c.as_str());
|
||||
// Do not bother keeping it pretty, just make it deterministic.
|
||||
format!("╾ALLOC{index}{offset}╼")
|
||||
})
|
||||
.into_owned();
|
||||
|
||||
// The alloc-id appears in a sentence.
|
||||
let re = Regex::new(r"\balloc([0-9]+)\b").unwrap();
|
||||
normalized = re
|
||||
.replace_all(&normalized, |caps: &Captures<'_>| {
|
||||
let index = caps.get(1).unwrap().as_str().to_string();
|
||||
let (index, _) = seen_allocs.insert_full(index);
|
||||
format!("ALLOC{index}")
|
||||
})
|
||||
.into_owned();
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ fn main() -> () {
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
StorageLive(_2);
|
||||
_2 = const {ALLOC0: &&[(Option<i32>, &[&str])]};
|
||||
_2 = const {ALLOC9: &&[(Option<i32>, &[&str])]};
|
||||
_1 = (*_2);
|
||||
StorageDead(_2);
|
||||
StorageDead(_1);
|
||||
@ -17,43 +17,43 @@ fn main() -> () {
|
||||
}
|
||||
}
|
||||
|
||||
ALLOC0 (static: FOO, size: 8, align: 4) {
|
||||
╾─ALLOC1─╼ 03 00 00 00 │ ╾──╼....
|
||||
ALLOC9 (static: FOO, size: 8, align: 4) {
|
||||
╾ALLOC0╼ 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 │ ....*...╾──╼....
|
||||
ALLOC0 (size: 48, align: 4) {
|
||||
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC1╼ 00 00 00 00 │ ....░░░░╾──╼....
|
||||
0x10 │ 00 00 00 00 __ __ __ __ ╾ALLOC2╼ 02 00 00 00 │ ....░░░░╾──╼....
|
||||
0x20 │ 01 00 00 00 2a 00 00 00 ╾ALLOC3╼ 03 00 00 00 │ ....*...╾──╼....
|
||||
}
|
||||
|
||||
ALLOC2 (size: 0, align: 4) {}
|
||||
ALLOC1 (size: 0, align: 4) {}
|
||||
|
||||
ALLOC3 (size: 16, align: 4) {
|
||||
╾─ALLOC5──╼ 03 00 00 00 ╾─ALLOC6─╼ 03 00 00 00 │ ╾──╼....╾──╼....
|
||||
ALLOC2 (size: 16, align: 4) {
|
||||
╾ALLOC4╼ 03 00 00 00 ╾ALLOC5╼ 03 00 00 00 │ ╾──╼....╾──╼....
|
||||
}
|
||||
|
||||
ALLOC5 (size: 3, align: 1) {
|
||||
ALLOC4 (size: 3, align: 1) {
|
||||
66 6f 6f │ foo
|
||||
}
|
||||
|
||||
ALLOC6 (size: 3, align: 1) {
|
||||
ALLOC5 (size: 3, align: 1) {
|
||||
62 61 72 │ bar
|
||||
}
|
||||
|
||||
ALLOC4 (size: 24, align: 4) {
|
||||
0x00 │ ╾─ALLOC7─╼ 03 00 00 00 ╾─ALLOC8─╼ 03 00 00 00 │ ╾──╼....╾──╼....
|
||||
0x10 │ ╾─ALLOC9─╼ 04 00 00 00 │ ╾──╼....
|
||||
ALLOC3 (size: 24, align: 4) {
|
||||
0x00 │ ╾ALLOC6╼ 03 00 00 00 ╾ALLOC7╼ 03 00 00 00 │ ╾──╼....╾──╼....
|
||||
0x10 │ ╾ALLOC8╼ 04 00 00 00 │ ╾──╼....
|
||||
}
|
||||
|
||||
ALLOC7 (size: 3, align: 1) {
|
||||
ALLOC6 (size: 3, align: 1) {
|
||||
6d 65 68 │ meh
|
||||
}
|
||||
|
||||
ALLOC8 (size: 3, align: 1) {
|
||||
ALLOC7 (size: 3, align: 1) {
|
||||
6d 6f 70 │ mop
|
||||
}
|
||||
|
||||
ALLOC9 (size: 4, align: 1) {
|
||||
ALLOC8 (size: 4, align: 1) {
|
||||
6d c3 b6 70 │ m..p
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ fn main() -> () {
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
StorageLive(_2);
|
||||
_2 = const {ALLOC0: &&[(Option<i32>, &[&str])]};
|
||||
_2 = const {ALLOC9: &&[(Option<i32>, &[&str])]};
|
||||
_1 = (*_2);
|
||||
StorageDead(_2);
|
||||
StorageDead(_1);
|
||||
@ -17,47 +17,47 @@ fn main() -> () {
|
||||
}
|
||||
}
|
||||
|
||||
ALLOC0 (static: FOO, size: 16, align: 8) {
|
||||
╾───────ALLOC1───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||
ALLOC9 (static: FOO, size: 16, align: 8) {
|
||||
╾ALLOC0╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||
}
|
||||
|
||||
ALLOC1 (size: 72, align: 8) {
|
||||
0x00 │ 00 00 00 00 __ __ __ __ ╾───────ALLOC2────────╼ │ ....░░░░╾──────╼
|
||||
ALLOC0 (size: 72, align: 8) {
|
||||
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC1╼ │ ....░░░░╾──────╼
|
||||
0x10 │ 00 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ │ ............░░░░
|
||||
0x20 │ ╾───────ALLOC3───────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||
0x30 │ 01 00 00 00 2a 00 00 00 ╾───────ALLOC4───────╼ │ ....*...╾──────╼
|
||||
0x20 │ ╾ALLOC2╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||
0x30 │ 01 00 00 00 2a 00 00 00 ╾ALLOC3╼ │ ....*...╾──────╼
|
||||
0x40 │ 03 00 00 00 00 00 00 00 │ ........
|
||||
}
|
||||
|
||||
ALLOC2 (size: 0, align: 8) {}
|
||||
ALLOC1 (size: 0, align: 8) {}
|
||||
|
||||
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 │ ╾──────╼........
|
||||
ALLOC2 (size: 32, align: 8) {
|
||||
0x00 │ ╾ALLOC4╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||
0x10 │ ╾ALLOC5╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||
}
|
||||
|
||||
ALLOC5 (size: 3, align: 1) {
|
||||
ALLOC4 (size: 3, align: 1) {
|
||||
66 6f 6f │ foo
|
||||
}
|
||||
|
||||
ALLOC6 (size: 3, align: 1) {
|
||||
ALLOC5 (size: 3, align: 1) {
|
||||
62 61 72 │ bar
|
||||
}
|
||||
|
||||
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 │ ╾──────╼........
|
||||
ALLOC3 (size: 48, align: 8) {
|
||||
0x00 │ ╾ALLOC6╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||
0x10 │ ╾ALLOC7╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||
0x20 │ ╾ALLOC8╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||
}
|
||||
|
||||
ALLOC7 (size: 3, align: 1) {
|
||||
ALLOC6 (size: 3, align: 1) {
|
||||
6d 65 68 │ meh
|
||||
}
|
||||
|
||||
ALLOC8 (size: 3, align: 1) {
|
||||
ALLOC7 (size: 3, align: 1) {
|
||||
6d 6f 70 │ mop
|
||||
}
|
||||
|
||||
ALLOC9 (size: 4, align: 1) {
|
||||
ALLOC8 (size: 4, align: 1) {
|
||||
6d c3 b6 70 │ m..p
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ fn main() -> () {
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
StorageLive(_2);
|
||||
_2 = const {ALLOC0: &&[(Option<i32>, &[&u8])]};
|
||||
_2 = const {ALLOC9: &&[(Option<i32>, &[&u8])]};
|
||||
_1 = (*_2);
|
||||
StorageDead(_2);
|
||||
StorageDead(_1);
|
||||
@ -17,42 +17,42 @@ fn main() -> () {
|
||||
}
|
||||
}
|
||||
|
||||
ALLOC0 (static: FOO, size: 8, align: 4) {
|
||||
╾─ALLOC1─╼ 03 00 00 00 │ ╾──╼....
|
||||
ALLOC9 (static: FOO, size: 8, align: 4) {
|
||||
╾ALLOC0╼ 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 │ ....*...╾──╼....
|
||||
ALLOC0 (size: 48, align: 4) {
|
||||
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC1╼ 00 00 00 00 │ ....░░░░╾──╼....
|
||||
0x10 │ 00 00 00 00 __ __ __ __ ╾ALLOC2╼ 02 00 00 00 │ ....░░░░╾──╼....
|
||||
0x20 │ 01 00 00 00 2a 00 00 00 ╾ALLOC3╼ 03 00 00 00 │ ....*...╾──╼....
|
||||
}
|
||||
|
||||
ALLOC2 (size: 0, align: 4) {}
|
||||
ALLOC1 (size: 0, align: 4) {}
|
||||
|
||||
ALLOC3 (size: 8, align: 4) {
|
||||
╾─ALLOC5─╼ ╾─ALLOC6─╼ │ ╾──╼╾──╼
|
||||
ALLOC2 (size: 8, align: 4) {
|
||||
╾ALLOC4╼ ╾ALLOC5╼ │ ╾──╼╾──╼
|
||||
}
|
||||
|
||||
ALLOC5 (size: 1, align: 1) {
|
||||
ALLOC4 (size: 1, align: 1) {
|
||||
05 │ .
|
||||
}
|
||||
|
||||
ALLOC6 (size: 1, align: 1) {
|
||||
ALLOC5 (size: 1, align: 1) {
|
||||
06 │ .
|
||||
}
|
||||
|
||||
ALLOC4 (size: 12, align: 4) {
|
||||
╾─A7+0x3─╼ ╾─ALLOC8─╼ ╾─A9+0x2─╼ │ ╾──╼╾──╼╾──╼
|
||||
ALLOC3 (size: 12, align: 4) {
|
||||
╾ALLOC6+0x3╼ ╾ALLOC7╼ ╾ALLOC8+0x2╼ │ ╾──╼╾──╼╾──╼
|
||||
}
|
||||
|
||||
ALLOC7 (size: 4, align: 1) {
|
||||
ALLOC6 (size: 4, align: 1) {
|
||||
2a 45 15 6f │ *E.o
|
||||
}
|
||||
|
||||
ALLOC8 (size: 1, align: 1) {
|
||||
ALLOC7 (size: 1, align: 1) {
|
||||
2a │ *
|
||||
}
|
||||
|
||||
ALLOC9 (size: 4, align: 1) {
|
||||
ALLOC8 (size: 4, align: 1) {
|
||||
2a 45 15 6f │ *E.o
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ fn main() -> () {
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
StorageLive(_2);
|
||||
_2 = const {ALLOC0: &&[(Option<i32>, &[&u8])]};
|
||||
_2 = const {ALLOC9: &&[(Option<i32>, &[&u8])]};
|
||||
_1 = (*_2);
|
||||
StorageDead(_2);
|
||||
StorageDead(_1);
|
||||
@ -17,45 +17,45 @@ fn main() -> () {
|
||||
}
|
||||
}
|
||||
|
||||
ALLOC0 (static: FOO, size: 16, align: 8) {
|
||||
╾───────ALLOC1───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||
ALLOC9 (static: FOO, size: 16, align: 8) {
|
||||
╾ALLOC0╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||
}
|
||||
|
||||
ALLOC1 (size: 72, align: 8) {
|
||||
0x00 │ 00 00 00 00 __ __ __ __ ╾───────ALLOC2───────╼ │ ....░░░░╾──────╼
|
||||
ALLOC0 (size: 72, align: 8) {
|
||||
0x00 │ 00 00 00 00 __ __ __ __ ╾ALLOC1╼ │ ....░░░░╾──────╼
|
||||
0x10 │ 00 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ │ ............░░░░
|
||||
0x20 │ ╾───────ALLOC3───────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||
0x30 │ 01 00 00 00 2a 00 00 00 ╾───────ALLOC4───────╼ │ ....*...╾──────╼
|
||||
0x20 │ ╾ALLOC2╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
|
||||
0x30 │ 01 00 00 00 2a 00 00 00 ╾ALLOC3╼ │ ....*...╾──────╼
|
||||
0x40 │ 03 00 00 00 00 00 00 00 │ ........
|
||||
}
|
||||
|
||||
ALLOC2 (size: 0, align: 8) {}
|
||||
ALLOC1 (size: 0, align: 8) {}
|
||||
|
||||
ALLOC3 (size: 16, align: 8) {
|
||||
╾───────ALLOC5───────╼ ╾───────ALLOC6───────╼ │ ╾──────╼╾──────╼
|
||||
ALLOC2 (size: 16, align: 8) {
|
||||
╾ALLOC4╼ ╾ALLOC5╼ │ ╾──────╼╾──────╼
|
||||
}
|
||||
|
||||
ALLOC5 (size: 1, align: 1) {
|
||||
ALLOC4 (size: 1, align: 1) {
|
||||
05 │ .
|
||||
}
|
||||
|
||||
ALLOC6 (size: 1, align: 1) {
|
||||
ALLOC5 (size: 1, align: 1) {
|
||||
06 │ .
|
||||
}
|
||||
|
||||
ALLOC4 (size: 24, align: 8) {
|
||||
0x00 │ ╾─────ALLOC7+0x3─────╼ ╾───────ALLOC8───────╼ │ ╾──────╼╾──────╼
|
||||
0x10 │ ╾─────ALLOC9+0x2─────╼ │ ╾──────╼
|
||||
ALLOC3 (size: 24, align: 8) {
|
||||
0x00 │ ╾ALLOC6+0x3╼ ╾ALLOC7╼ │ ╾──────╼╾──────╼
|
||||
0x10 │ ╾ALLOC8+0x2╼ │ ╾──────╼
|
||||
}
|
||||
|
||||
ALLOC7 (size: 4, align: 1) {
|
||||
ALLOC6 (size: 4, align: 1) {
|
||||
2a 45 15 6f │ *E.o
|
||||
}
|
||||
|
||||
ALLOC8 (size: 1, align: 1) {
|
||||
ALLOC7 (size: 1, align: 1) {
|
||||
2a │ *
|
||||
}
|
||||
|
||||
ALLOC9 (size: 4, align: 1) {
|
||||
ALLOC8 (size: 4, align: 1) {
|
||||
2a 45 15 6f │ *E.o
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ fn main() -> () {
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
StorageLive(_2);
|
||||
_2 = const {ALLOC0: &&Packed};
|
||||
_2 = const {ALLOC4: &&Packed};
|
||||
_1 = (*_2);
|
||||
StorageDead(_2);
|
||||
StorageDead(_1);
|
||||
@ -17,31 +17,31 @@ fn main() -> () {
|
||||
}
|
||||
}
|
||||
|
||||
ALLOC0 (static: FOO, size: 4, align: 4) {
|
||||
╾─ALLOC1─╼ │ ╾──╼
|
||||
ALLOC4 (static: FOO, size: 4, align: 4) {
|
||||
╾ALLOC0╼ │ ╾──╼
|
||||
}
|
||||
|
||||
ALLOC1 (size: 168, align: 1) {
|
||||
ALLOC0 (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 ╾─ALLOC2──╼ │ ............╾──╼
|
||||
0x10 │ ab ab ab ab ab ab ab ab ab ab ab ab ╾ALLOC1╼ │ ............╾──╼
|
||||
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 ╾─ALLOC3──╼ 00 00 │ ..........╾──╼..
|
||||
0x90 │ ╾A4+0x63─╼ 00 00 00 00 00 00 00 00 00 00 00 00 │ ╾──╼............
|
||||
0x80 │ 00 00 00 00 00 00 00 00 00 00 ╾ALLOC2╼ 00 00 │ ..........╾──╼..
|
||||
0x90 │ ╾ALLOC3+0x63╼ 00 00 00 00 00 00 00 00 00 00 00 00 │ ╾──╼............
|
||||
0xa0 │ 00 00 00 00 00 00 00 00 │ ........
|
||||
}
|
||||
|
||||
ALLOC2 (size: 4, align: 4) {
|
||||
ALLOC1 (size: 4, align: 4) {
|
||||
2a 00 00 00 │ *...
|
||||
}
|
||||
|
||||
ALLOC3 (fn: main)
|
||||
ALLOC2 (fn: main)
|
||||
|
||||
ALLOC4 (size: 100, align: 1) {
|
||||
ALLOC3 (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 │ ................
|
||||
|
@ -8,7 +8,7 @@ fn main() -> () {
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
StorageLive(_2);
|
||||
_2 = const {ALLOC0: &&Packed};
|
||||
_2 = const {ALLOC2: &&Packed};
|
||||
_1 = (*_2);
|
||||
StorageDead(_2);
|
||||
StorageDead(_1);
|
||||
@ -17,13 +17,13 @@ fn main() -> () {
|
||||
}
|
||||
}
|
||||
|
||||
ALLOC0 (static: FOO, size: 8, align: 8) {
|
||||
╾───────ALLOC1───────╼ │ ╾──────╼
|
||||
ALLOC2 (static: FOO, size: 8, align: 8) {
|
||||
╾ALLOC0╼ │ ╾──────╼
|
||||
}
|
||||
|
||||
ALLOC1 (size: 180, align: 1) {
|
||||
ALLOC0 (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 ╾──ALLOC2── │ ............╾───
|
||||
0x10 │ ab ab ab ab ab ab ab ab ab ab ab ab ╾──ALLOC3── │ ............╾───
|
||||
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 @@ ALLOC1 (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 │ ─────ALLOC3─────╼ 00 00 ╾────ALLOC4+0x63─────╼ │ ─────╼..╾──────╼
|
||||
0x90 │ ─────ALLOC4─────╼ 00 00 ╾ALLOC1+0x63╼ │ ─────╼..╾──────╼
|
||||
0xa0 │ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
|
||||
0xb0 │ 00 00 00 00 │ ....
|
||||
}
|
||||
|
||||
ALLOC2 (size: 4, align: 4) {
|
||||
ALLOC3 (size: 4, align: 4) {
|
||||
2a 00 00 00 │ *...
|
||||
}
|
||||
|
||||
ALLOC3 (fn: main)
|
||||
ALLOC4 (fn: main)
|
||||
|
||||
ALLOC4 (size: 100, align: 1) {
|
||||
ALLOC1 (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 │ ................
|
||||
|
@ -43,7 +43,7 @@
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
StorageLive(_2);
|
||||
_2 = const {ALLOC0: &E};
|
||||
_2 = const {ALLOC1: &E};
|
||||
_1 = (*_2);
|
||||
StorageDead(_2);
|
||||
StorageLive(_3);
|
||||
@ -78,7 +78,7 @@
|
||||
bb4: {
|
||||
StorageLive(_7);
|
||||
StorageLive(_8);
|
||||
_8 = const {ALLOC1: &&E};
|
||||
_8 = const {ALLOC2: &&E};
|
||||
_7 = (*_8);
|
||||
StorageDead(_8);
|
||||
StorageLive(_9);
|
||||
@ -112,15 +112,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
ALLOC1 (static: RC, size: 4, align: 4) {
|
||||
╾─ALLOC2─╼ │ ╾──╼
|
||||
ALLOC2 (static: RC, size: 4, align: 4) {
|
||||
╾ALLOC0╼ │ ╾──╼
|
||||
}
|
||||
|
||||
ALLOC2 (size: 8, align: 4) {
|
||||
ALLOC0 (size: 8, align: 4) {
|
||||
01 00 00 00 04 00 00 00 │ ........
|
||||
}
|
||||
|
||||
ALLOC0 (static: statics::C, size: 8, align: 4) {
|
||||
ALLOC1 (static: statics::C, size: 8, align: 4) {
|
||||
00 00 00 00 00 00 00 00 │ ........
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
bb0: {
|
||||
StorageLive(_1);
|
||||
StorageLive(_2);
|
||||
_2 = const {ALLOC0: &E};
|
||||
_2 = const {ALLOC1: &E};
|
||||
_1 = (*_2);
|
||||
StorageDead(_2);
|
||||
StorageLive(_3);
|
||||
@ -78,7 +78,7 @@
|
||||
bb4: {
|
||||
StorageLive(_7);
|
||||
StorageLive(_8);
|
||||
_8 = const {ALLOC1: &&E};
|
||||
_8 = const {ALLOC2: &&E};
|
||||
_7 = (*_8);
|
||||
StorageDead(_8);
|
||||
StorageLive(_9);
|
||||
@ -112,15 +112,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
ALLOC1 (static: RC, size: 8, align: 8) {
|
||||
╾───────ALLOC2───────╼ │ ╾──────╼
|
||||
ALLOC2 (static: RC, size: 8, align: 8) {
|
||||
╾ALLOC0╼ │ ╾──────╼
|
||||
}
|
||||
|
||||
ALLOC2 (size: 8, align: 4) {
|
||||
ALLOC0 (size: 8, align: 4) {
|
||||
01 00 00 00 04 00 00 00 │ ........
|
||||
}
|
||||
|
||||
ALLOC0 (static: statics::C, size: 8, align: 4) {
|
||||
ALLOC1 (static: statics::C, size: 8, align: 4) {
|
||||
00 00 00 00 00 00 00 00 │ ........
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@
|
||||
+ _10 = const S(13_i32);
|
||||
StorageDead(_11);
|
||||
StorageLive(_16);
|
||||
_16 = const {ALLOC0: &&BigStruct};
|
||||
_16 = const {ALLOC1: &&BigStruct};
|
||||
_17 = deref_copy (*_16);
|
||||
StorageLive(_12);
|
||||
_18 = deref_copy (*_16);
|
||||
@ -119,11 +119,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
ALLOC0 (static: STAT, size: 4, align: 4) {
|
||||
╾─ALLOC1─╼ │ ╾──╼
|
||||
ALLOC1 (static: STAT, size: 4, align: 4) {
|
||||
╾ALLOC0╼ │ ╾──╼
|
||||
}
|
||||
|
||||
ALLOC1 (size: 16, align: 4) {
|
||||
ALLOC0 (size: 16, align: 4) {
|
||||
01 00 00 00 00 00 e0 40 0d 00 00 00 05 __ __ __ │ .......@.....░░░
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@
|
||||
+ _10 = const S(13_i32);
|
||||
StorageDead(_11);
|
||||
StorageLive(_16);
|
||||
_16 = const {ALLOC0: &&BigStruct};
|
||||
_16 = const {ALLOC1: &&BigStruct};
|
||||
_17 = deref_copy (*_16);
|
||||
StorageLive(_12);
|
||||
_18 = deref_copy (*_16);
|
||||
@ -119,11 +119,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
ALLOC0 (static: STAT, size: 8, align: 8) {
|
||||
╾───────ALLOC1───────╼ │ ╾──────╼
|
||||
ALLOC1 (static: STAT, size: 8, align: 8) {
|
||||
╾ALLOC0╼ │ ╾──────╼
|
||||
}
|
||||
|
||||
ALLOC1 (size: 16, align: 4) {
|
||||
ALLOC0 (size: 16, align: 4) {
|
||||
01 00 00 00 00 00 e0 40 0d 00 00 00 05 __ __ __ │ .......@.....░░░
|
||||
}
|
||||
|
||||
|
@ -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: ALLOC6 has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
|
||||
= note: out-of-bounds pointer arithmetic: ALLOC10 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
|
||||
|
@ -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) {
|
||||
╾─ALLOC0──╼ │ ╾──╼
|
||||
╾ALLOC0╼ │ ╾──╼
|
||||
}
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -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) {
|
||||
╾───────ALLOC0────────╼ │ ╾──────╼
|
||||
╾ALLOC0╼ │ ╾──────╼
|
||||
}
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -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 ALLOC16, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC17, 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 ALLOC18, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC19, 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 ALLOC21, 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: 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 ALLOC26, 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: 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) {
|
||||
╾A31+0x2─╼ 04 00 00 00 │ ╾──╼....
|
||||
╾ALLOC_ID+0x2╼ 04 00 00 00 │ ╾──╼....
|
||||
}
|
||||
|
||||
error[E0080]: it is undefined behavior to use this value
|
||||
|
@ -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 ALLOC16, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC17, 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 ALLOC18, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC19, 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 ALLOC21, 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: 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 ALLOC26, 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: 16, align: 8) {
|
||||
|
@ -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 ALLOC0, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC1, 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) {
|
||||
╾─ALLOC1──╼ ╾─ALLOC0──╼ │ ╾──╼╾──╼
|
||||
╾ALLOC0╼ ╾ALLOC1╼ │ ╾──╼╾──╼
|
||||
}
|
||||
|
||||
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 ALLOC2, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC3, 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) {
|
||||
╾─ALLOC3─╼ ╾─ALLOC2─╼ │ ╾──╼╾──╼
|
||||
╾ALLOC2╼ ╾ALLOC3╼ │ ╾──╼╾──╼
|
||||
}
|
||||
|
||||
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 ALLOC4, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC5, 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) {
|
||||
╾─ALLOC5─╼ ╾─ALLOC4─╼ │ ╾──╼╾──╼
|
||||
╾ALLOC4╼ ╾ALLOC5╼ │ ╾──╼╾──╼
|
||||
}
|
||||
|
||||
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 ALLOC6, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC7, 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) {
|
||||
╾─ALLOC7─╼ ╾─ALLOC6─╼ │ ╾──╼╾──╼
|
||||
╾ALLOC6╼ ╾ALLOC7╼ │ ╾──╼╾──╼
|
||||
}
|
||||
|
||||
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 ALLOC8, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC9, 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) {
|
||||
╾─ALLOC9─╼ ╾─ALLOC8─╼ │ ╾──╼╾──╼
|
||||
╾ALLOC8╼ ╾ALLOC9╼ │ ╾──╼╾──╼
|
||||
}
|
||||
|
||||
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) {
|
||||
╾─ALLOC10─╼ ╾─ALLOC11─╼ │ ╾──╼╾──╼
|
||||
╾ALLOC10╼ ╾ALLOC11╼ │ ╾──╼╾──╼
|
||||
}
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
@ -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 ALLOC0, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC1, 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) {
|
||||
╾───────ALLOC1────────╼ ╾───────ALLOC0────────╼ │ ╾──────╼╾──────╼
|
||||
╾ALLOC0╼ ╾ALLOC1╼ │ ╾──────╼╾──────╼
|
||||
}
|
||||
|
||||
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 ALLOC2, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC3, 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) {
|
||||
╾───────ALLOC3───────╼ ╾───────ALLOC2───────╼ │ ╾──────╼╾──────╼
|
||||
╾ALLOC2╼ ╾ALLOC3╼ │ ╾──────╼╾──────╼
|
||||
}
|
||||
|
||||
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 ALLOC4, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC5, 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) {
|
||||
╾───────ALLOC5───────╼ ╾───────ALLOC4───────╼ │ ╾──────╼╾──────╼
|
||||
╾ALLOC4╼ ╾ALLOC5╼ │ ╾──────╼╾──────╼
|
||||
}
|
||||
|
||||
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 ALLOC6, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC7, 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) {
|
||||
╾───────ALLOC7───────╼ ╾───────ALLOC6───────╼ │ ╾──────╼╾──────╼
|
||||
╾ALLOC6╼ ╾ALLOC7╼ │ ╾──────╼╾──────╼
|
||||
}
|
||||
|
||||
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 ALLOC8, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC9, 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) {
|
||||
╾───────ALLOC9───────╼ ╾───────ALLOC8───────╼ │ ╾──────╼╾──────╼
|
||||
╾ALLOC8╼ ╾ALLOC9╼ │ ╾──────╼╾──────╼
|
||||
}
|
||||
|
||||
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) {
|
||||
╾───────ALLOC10───────╼ ╾───────ALLOC11───────╼ │ ╾──────╼╾──────╼
|
||||
╾ALLOC10╼ ╾ALLOC11╼ │ ╾──────╼╾──────╼
|
||||
}
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
@ -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: ALLOC0 has size 1, so pointer to 255 bytes starting at offset 0 is out-of-bounds
|
||||
| ^^^^^^^^^ out-of-bounds pointer arithmetic: ALLOC1 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
|
||||
|
@ -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) {
|
||||
╾─ALLOC0──╼ ╾─ALLOC1──╼ │ ╾──╼╾──╼
|
||||
╾ALLOC0╼ ╾ALLOC1╼ │ ╾──╼╾──╼
|
||||
}
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -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) {
|
||||
╾───────ALLOC0────────╼ ╾───────ALLOC1────────╼ │ ╾──────╼╾──────╼
|
||||
╾ALLOC0╼ ╾ALLOC1╼ │ ╾──────╼╾──────╼
|
||||
}
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -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 ALLOC11, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC12, 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 ALLOC13, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC14, 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 ALLOC16, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC17, 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 ALLOC18, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC19, 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 ALLOC20, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: 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: $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 ALLOC22, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC23, 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 ALLOC27, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC28, 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 ALLOC30, but expected a vtable pointer
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC31, 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) {
|
||||
|
@ -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) {
|
||||
╾─ALLOC0──╼ │ ╾──╼
|
||||
╾ALLOC0╼ │ ╾──╼
|
||||
}
|
||||
|
||||
warning: skipping const checks
|
||||
|
@ -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) {
|
||||
╾───────ALLOC0────────╼ │ ╾──────╼
|
||||
╾ALLOC0╼ │ ╾──────╼
|
||||
}
|
||||
|
||||
warning: skipping const checks
|
||||
|
@ -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) {
|
||||
╾─ALLOC0──╼ │ ╾──╼
|
||||
╾ALLOC0╼ │ ╾──╼
|
||||
}
|
||||
|
||||
note: erroneous constant encountered
|
||||
|
@ -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) {
|
||||
╾───────ALLOC0────────╼ │ ╾──────╼
|
||||
╾ALLOC0╼ │ ╾──────╼
|
||||
}
|
||||
|
||||
note: erroneous constant encountered
|
||||
|
@ -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) {
|
||||
╾─ALLOC0──╼ ff ff ff ff │ ╾──╼....
|
||||
╾ALLOC0╼ ff ff ff ff │ ╾──╼....
|
||||
}
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -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) {
|
||||
╾───────ALLOC0────────╼ ff ff ff ff ff ff ff ff │ ╾──────╼........
|
||||
╾ALLOC0╼ ff ff ff ff ff ff ff ff │ ╾──────╼........
|
||||
}
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -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) {
|
||||
╾───────ALLOC0────────╼ ╾───────ALLOC1────────╼ │ ╾──────╼╾──────╼
|
||||
╾ALLOC0╼ ╾ALLOC1╼ │ ╾──────╼╾──────╼
|
||||
}
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -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) {
|
||||
╾─ALLOC0──╼ │ ╾──╼
|
||||
╾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) {
|
||||
╾─ALLOC1──╼ │ ╾──╼
|
||||
╾ALLOC1╼ │ ╾──╼
|
||||
}
|
||||
|
||||
warning: skipping const checks
|
||||
|
@ -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) {
|
||||
╾───────ALLOC0────────╼ │ ╾──────╼
|
||||
╾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) {
|
||||
╾───────ALLOC1────────╼ │ ╾──────╼
|
||||
╾ALLOC1╼ │ ╾──────╼
|
||||
}
|
||||
|
||||
warning: skipping const checks
|
||||
|
@ -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) {
|
||||
╾─ALLOC0──╼ │ ╾──╼
|
||||
╾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) {
|
||||
╾─ALLOC0──╼ │ ╾──╼
|
||||
╾ALLOC0╼ │ ╾──╼
|
||||
}
|
||||
|
||||
error: could not evaluate constant pattern
|
||||
|
@ -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) {
|
||||
╾───────ALLOC0────────╼ │ ╾──────╼
|
||||
╾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) {
|
||||
╾───────ALLOC0────────╼ │ ╾──────╼
|
||||
╾ALLOC0╼ │ ╾──────╼
|
||||
}
|
||||
|
||||
error: could not evaluate constant pattern
|
||||
|
@ -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) {
|
||||
╾─ALLOC0──╼ │ ╾──╼
|
||||
╾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) {
|
||||
╾─ALLOC1──╼ ╾─ALLOC2──╼ │ ╾──╼╾──╼
|
||||
╾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) {
|
||||
╾─ALLOC3─╼ │ ╾──╼
|
||||
╾ALLOC3╼ │ ╾──╼
|
||||
}
|
||||
|
||||
warning: skipping const checks
|
||||
|
@ -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) {
|
||||
╾───────ALLOC0────────╼ │ ╾──────╼
|
||||
╾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) {
|
||||
╾───────ALLOC1────────╼ ╾───────ALLOC2────────╼ │ ╾──────╼╾──────╼
|
||||
╾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) {
|
||||
╾───────ALLOC3───────╼ │ ╾──────╼
|
||||
╾ALLOC3╼ │ ╾──────╼
|
||||
}
|
||||
|
||||
warning: skipping const checks
|
||||
|
Loading…
Reference in New Issue
Block a user