Skip to content

ICE with mir-opt-level=2 in program with scalar pair value #67019

Closed
@osa1

Description

@osa1
fn test(this: ((u8, u8),)) {
    assert!((this.0).1 == 0);
}

fn main() {
    test(((1, 2),));
}

Build:

$ /home/omer/rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc --edition 2018 test2.rs -Zmir-opt-level=2

ICE:

thread 'rustc' panicked at 'index out of bounds: the len is 1 but the index is 1', src/librustc_mir/transform/const_prop.rs:648:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.41.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z mir-opt-level=2

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions