-
Notifications
You must be signed in to change notification settings - Fork 13k
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
ICE on let mut [N]
when N is a generic parameter
#82610
Comments
Actually, even more simply, this triggers the ICE: fn demo<const N: usize>() {
let mut [u32; N] = todo!();
} The error is the same (modulo the Unit Struct shadowing error) |
I've tried bisecting, here's the results (I'm afraid not really useful):
bisect command: |
Slightly smaller (this doesn't have anything to do with the diverging expression): fn f<const N: usize>() {
let mut [N];
} |
todo!()
and Const Genericslet mut [N] = [0]
when N is a generic parameter
let mut [N] = [0]
when N is a generic parameterlet mut [N]
when N is a generic parameter
Assigning @rustbot label -I-prioritize +P-medium |
Seems this also repo the bug: fn f<const N:usize>() {
mut N
} |
A duplicate. impl<const N: usize> ArrayWindowsExample {
fn next() {
let mut N;
}
} |
Issue: rust-lang/rust#82610
Fixed by #85478 |
Code
Meta
This ICE is present on the current stable (1.50), beta (1.51), and nightly (
rust version 1.52.0-nightly (9c09c1f7c 2021-02-26)
)Error output
Backtrace
I don't expect this code to compile (I was mid- writing something else and hit this ICE on a
cargo watch
invocation), but also wouldn't expect it to ICE.The text was updated successfully, but these errors were encountered: