Closed
Description
#![feature(const_generics, box_syntax)]
#![allow(incomplete_features)]
fn main() {
fn foo<const N: usize>() {
box [0; N];
}
foo::<1>();
}
Compiled with:
rustc -Z mir-opt-level=3 bug.rs
Using:
rustc 1.47.0-nightly (09f4c9f50 2020-08-07) running on x86_64-pc-windows-gnu
Gives:
error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:3 ~ bug[317d]::main[0]), const_param_did: None }) (
encountered `Assign` statement with incompatible types:
left-hand side has type: [i32; 1]
right-hand side has type: [i32; N]
--> bug.rs:5:13
|
5 | box [0; N];
| ^^^^^^
|
= note: delayed at src\librustc_mir\transform\validate.rs:140:36
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src\librustc_errors\lib.rs:366:17
Metadata
Metadata
Assignees
Labels
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: const generics (parameters and arguments)Category: This is a bug.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.`#![feature(const_generics)]`Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Relevant to the compiler team, which will review and decide on the PR/issue.ICE tracked in rust-lang/glacier.This issue requires a nightly compiler in some way.