Closed
Description
Minimized as best I could:
fn main() {
let mut headers = Vec::new();
headers.extend_from_slice(&[("", ""); 3]);
}
With rustc 1.32.0-nightly (f4a421ee3 2018-12-13)
Full error:
ERROR 2018-12-14T02:46:10Z: rustc_mir::interpret::validity: Bits { size: 8, bits: 0 } is not aligned to Align { pow2: 0 }
error[E0080]: it is undefined behavior to use this value
--> src/main.rs:1:1
|
1 | / fn main() {
2 | | let mut headers = Vec::new();
3 | | headers.extend_from_slice(&[("", ""); 3]);
4 | | }
| |_^ type validation failed: encountered NULL reference at [2].0
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior