-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Const generics out of range when substituting substs=[] #101036
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Some tweaks are required to make it ICE on nightly rustc 1.65.0-nightly (86c6ebe 2022-08-16): #![feature(generic_const_exprs)]
const fn t<const N: usize>() -> u8 {
N as u8
}
#[repr(u8)]
enum T<const N: u8 = { T::<0>::A as u8 + T::<0>::B as u8 }>
where
[(); N as usize]:
{
A = t::<N>() as u8, B
} |
#98429 might have solved the ICE in the first example. Will try to look into the second example on the weekend. |
#86580 Seems to be the cause of this. Didn't find a way to properly fix this, i.e. without causing the problem that that PR was trying to fix to re-occur. |
So this issue requires the |
Another repro for the same ICE msg: #![feature(generic_const_exprs)]
#![allow(incomplete_features)]
struct S<const N: usize = ()>()
where [(); N]: ;
fn main() {} |
closing in favor of #106994 |
Uh oh!
There was an error while loading. Please reload this page.
This issue does NOT occur on nightly, so perhaps it's a duplicate that has already been fixed, but I could not find a similar issue on github. Feel free to close if this has already been fixed :)
Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: