Skip to content

Const generic parameters are allowed in the wrong position (causing ICEs). #68398

Closed
@eddyb

Description

@eddyb

Note the Array<N, ()> use, instead of Array<(), N>:

#![feature(const_generics)]

pub type Array<T, const N: usize> = [T; N];

pub fn foo<const N: usize>() -> Array<N, ()> {
    unimplemented!()
}

This currently results in cat_expr Errd and broken MIR ICEs.

cc @varkor @yodaldevoid @oli-obk

Metadata

Metadata

Assignees

Labels

A-const-genericsArea: const generics (parameters and arguments)C-bugCategory: This is a bug.F-const_generics`#![feature(const_generics)]`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.glacierICE tracked in rust-lang/glacier.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions