Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
eddyb opened this issue Jan 20, 2020 · 0 comments · Fixed by #68434
Closed

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

eddyb opened this issue Jan 20, 2020 · 0 comments · Fixed by #68434
Assignees
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-const_generics `#![feature(const_generics)]` glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@eddyb
Copy link
Member

eddyb commented Jan 20, 2020

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

@jonas-schievink jonas-schievink added A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-const_generics `#![feature(const_generics)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 20, 2020
@varkor varkor self-assigned this Jan 20, 2020
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Jan 21, 2020
@bors bors closed this as completed in 6d69cab Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-const_generics `#![feature(const_generics)]` glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
4 participants