Skip to content

type validation failed: encountered NULL reference at [2].0 #56800

Description

@saethlin

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions