Skip to content

ICE: ID not mapped to struct fields #21797

Closed
@nstoddard

Description

@nstoddard
enum E {
  A{x: i32}
}

fn main() {
  E::A{x: 5}.x;
}
<anon>:6:3: 6:15 error: attempted access of field `x` on type `E`, but no field with that name was found
<anon>:6   E::A{x: 5}.x;
           ^~~~~~~~~~~~
error: internal compiler error: ID not mapped to struct fields: enum E::E (id=4)
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:190

Metadata

Metadata

Assignees

No one assigned

    Labels

    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