rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
99.09k stars 12.79k forks source link

Pattern referring to nonexistent variant causes ICE on beta. #34929

Closed eddyb closed 8 years ago

eddyb commented 8 years ago
enum E { V { x: u8 } }

fn main() {
    match (E::V { x: 0 }) {
        E::V_Typoed { .. } => {}
    }
}

Produces, on beta:

error: internal compiler error: ../src/librustc/hir/def.rs:77: path not fully resolved:
PathResolution { base_def: Enum(DefId { krate: 0, node: DefIndex(4) => E }), depth: 1 }

On stable and nightly it triggers an appropriate resolution failure error. cc @petrochenkov

Aatch commented 8 years ago

Be nice to know what change fixed it again so we can backport it into beta.

petrochenkov commented 8 years ago

Be nice to know what change fixed it again so we can backport it into beta.

It's https://github.com/rust-lang/rust/pull/34365/commits/a397b60ebba531fb4de7e88111e0d489e44c549e, I'll extract the minimal fix for beta.

alexcrichton commented 8 years ago

Fixed in https://github.com/rust-lang/rust/pull/34964