Open chorman0773 opened 3 years ago
Yep, this is a more general issue (aside from the apparent fact that alloc relies on something unspecified, but that's not my area) since layout calculation (and therefore randomization) happens after whenever transmute size comparisons happen. which is what I'd assume would be the intended checker of this. Since nothing after layout calculation gets the randomized info, it just hits codegen where an assertion catches it.
Triage: I can't reproduce this. Am I doing some silly mistake perhaps?
$ RUSTFLAGS=-Zrandomize-layout cargo +nightly-2021-10-29 build -Z build-std --target x86_64-unknown-linux-gnu
[...]
Compiling repro v0.1.0 (/home/martin/src/bin)
Finished dev [unoptimized + debuginfo] target(s) in 12.05s
$ git ls-files | xargs bat
───────┬─────────────────────────────────────────────────────────────────────────────────────────
│ File: .gitignore
───────┼─────────────────────────────────────────────────────────────────────────────────────────
1 │ /target
───────┴─────────────────────────────────────────────────────────────────────────────────────────
───────┬─────────────────────────────────────────────────────────────────────────────────────────
│ File: Cargo.lock
───────┼─────────────────────────────────────────────────────────────────────────────────────────
1 │ # This file is automatically @generated by Cargo.
2 │ # It is not intended for manual editing.
3 │ version = 3
4 │
5 │ [[package]]
6 │ name = "repro"
7 │ version = "0.1.0"
───────┴─────────────────────────────────────────────────────────────────────────────────────────
───────┬─────────────────────────────────────────────────────────────────────────────────────────
│ File: Cargo.toml
───────┼─────────────────────────────────────────────────────────────────────────────────────────
1 │ [package]
2 │ name = "repro"
3 │ version = "0.1.0"
4 │ edition = "2021"
───────┴─────────────────────────────────────────────────────────────────────────────────────────
───────┬─────────────────────────────────────────────────────────────────────────────────────────
│ File: src/main.rs
───────┼─────────────────────────────────────────────────────────────────────────────────────────
1 │ fn main(){} // Should occur with any code as it happens in the standard library
───────┴─────────────────────────────────────────────────────────────────────────────────────────
Code
Occurs while compiling alloc using
-Z build-std
while-Z randomize-layout
is in effect.Meta
rustc --version --verbose
:Error output
CC: @Kixiron