Skip to content

ICE when using struct constructor with explicit const generic arguments #60818

Closed
@jplatte

Description

@jplatte

This very simple example (Playground link):

#![feature(const_generics)]

struct Generic<const V: usize>;

fn main() {
    let _ = Generic::<0>;
}

results in: error: internal compiler error: src/librustc_typeck/collect.rs:1407: unexpected const parent path def Def(Ctor(Struct, Const), DefId(0:13 ~ playground[d52b]::Generic[0]::{{constructor}}[0])). Changing it to use curly braces around 0 does not help.

Metadata

Metadata

Assignees

Labels

A-const-genericsArea: const generics (parameters and arguments)C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️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