Skip to content

Unexpected panic when compiling nested slices in debug mode #26301

Closed
@ppedrot

Description

@ppedrot

There seems to be similar bugs already reported in the bugtracker, but I do not know if they are instances of the same issue, so I report it just in case.

The following code:

enum Value<'a> {
  Sum(&'static str, usize, &'a [[Value<'a>]]),
}

fn visit_object<'a>(root : &'a Value<'a>) {
}

fn main() {
}

when compiled with rustc -g (version 1.0), raises the following anomaly.

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: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'assertion failed: slice_layout_is_correct(cx, &member_llvm_types[..], element_type)', /home/rustbuild/src/rust-buildbot/slave/stable-dist-rustc-linux/build/src/librustc_trans/trans/debuginfo.rs:2810

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions