ICE const generic with where clause #87964
Labels
A-const-generics
Area: const generics (parameters and arguments)
C-bug
Category: This is a bug.
F-const_generics
`#![feature(const_generics)]`
F-generic_const_exprs
`#![feature(generic_const_exprs)]`
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.
I found a compiler bug when trying out const generics on the nightly compiler. The key part here seems to be the
where [(); T::LENGTH]: Sized
addition as removing that allows it to build with no issues (the where clause is there so theContainer
struct can have a field that takesT::LENGTH
as a type parameter). I also managed to replicate this in the Rust Playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=65d8aa6be2347f0b9af2e5afb6e7d5c9.Interestingly, by adding
'static +
to both theT
definitions a different error message appears, although I'm not sure if they're directly related or not. When I try to add that to<details>
sections it seems to break GitHub Markdown, but you can find that in this Playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=45a573b960365ffa48a56e0f246a43a8. If it would be better to open a separate issue for that I can do so as well.Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: