Skip to content

ICE: enum discriminant depends on generic arguments #64662

Closed
@Patryk27

Description

@Patryk27

Following code ICEs on today's nightly (97e58c0 2019-09-20):

enum Foo {
  A = foo(),
  B = foo(), // <- error: internal compiler error: src/librustc/ty/mod.rs:2400: enum discriminant depends on generic arguments
}

const fn foo<T>() -> isize {
   0
}

What's peculiar is that no ICE is shown when the Foo enum contains only one item:

enum Foo {
  A = foo(),
}

Metadata

Metadata

Assignees

Labels

A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions