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
generics-related ICE: 'called Option::unwrap()
on a None
value'
#87603
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-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
MCVE is here: https://users.rust-lang.org/t/1-56-nightly-change-in-const-evaluatable-checked/62865/11?u=johntitor lib.rs: #![feature(const_generics)]
#![feature(const_evaluatable_checked)]
pub struct S<T: Copy + Default, const N: usize>
where
[T; N*2]: Sized,
{
pub s: [T; N * 2],
}
impl<T: Default + Copy, const N: usize> S<T, N>
where
[T; N * 2]: Sized,
{
pub fn test() -> Self {
S {
s: [T::default(); N * 2],
}
}
} main.rs: const N: usize = 2;
let x: S<u8, N> = S::test(); Backtrace
|
JohnTitor
added
C-bug
Category: This is a bug.
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
Jul 29, 2021
JohnTitor
changed the title
const_evaluatable_checked?
generics-related ICE: 'called Jul 29, 2021
Option::unwrap()
on a None
value'
JohnTitor
added
the
requires-nightly
This issue requires a nightly compiler in some way.
label
Jul 29, 2021
camelid
added
A-const-generics
Area: const generics (parameters and arguments)
F-generic_const_exprs
`#![feature(generic_const_exprs)]`
labels
Jul 29, 2021
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-generic_const_exprs
`#![feature(generic_const_exprs)]`
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
having a struct field depending on an a const expression (field: [T; N * 2]) using const_evaluatable_checked and a corresponding where [T; N * 2]: Sized. Think this was working before 1.56 nightly.. Getting called Option::unwrap() on a None value, compiler/rustc_metadata/src/rmeta/decoder.rs:914:54 when importing lib.rs, but, everything works when that same lib is in main.rs. Also any suggestions for using const_evaluatable_checked. https://users.rust-lang.org/t/1-56-nightly-change-in-const-evaluatable-checked/62865
The text was updated successfully, but these errors were encountered: