ICE: const generic with default const expr specified before type generic causes compiler to crash #123954
Labels
A-const-generics
Area: const generics (parameters and arguments)
C-bug
Category: This is a bug.
F-generic_const_exprs
`#![feature(generic_const_exprs)]`
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
requires-incomplete-features
This issue requires the use of incomplete features.
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The order of terms does not seem to be checked before trying to make a well-formedness check on a struct if a const expr is present in the constants default value.
I tried this code:
And this code (which gave the right error message in rust-analyzer):
and both cause ICE's during compilation.
If the order of the parameters are switched, or the const expr for N is removed, then the compiler does not crash and either the expected error is reported, or successfully compiles.
Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: