Skip to content

ICE: can't type-check body of DefId #60049

Closed
@jgouly

Description

@jgouly

This short snippet crashes the nightly compiler:

enum Foo {
    Bar(usize),
}

fn main() {
    let i = Foo::Bar;
    assert_eq!(Foo::Bar, i);
}

Crashes with:

error: internal compiler error: src/librustc_typeck/check/mod.rs:825: can't type-check body of DefId(0/1:10 ~ lib[317d]::Foo[0]::Bar[0]::{{constructor}}[0])
 --> src/lib.rs:2:3
  |
2 |   Bar(usize),
  |   ^^^^^^^^^^

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:570:9

rustc 1.35.0-nightly (70f1309 2019-04-16) running on x86_64-apple-darwin
Seems to work on stable on the playground (don't have stable locally).

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions