Closed
Description
#![feature(const_generics)]
#![allow(incomplete_features)]
fn foo<const LEN: usize, const DATA: [u8; LEN]>() {}
fn main() {
const DATA: [u8; 4] = *b"ABCD";
foo::<4, DATA>();
}
Gives:
error: internal compiler error: src\librustc_middle\ty\subst.rs:613: const parameter `LEN/#0` (Const { ty: usize, val: Param(LEN/#0) }/0) out of range when substituting substs=[]
thread 'rustc' panicked at 'Box<Any>', /rustc/edc02580e4e80476ac1ded2cc1008eaf8b8400e6\src\libstd\macros.rs:13:23
...
note: rustc 1.44.0-nightly (edc02580e 2020-04-14) running on x86_64-pc-windows-gnu
query stack during panic:
#0 [resolve_instance] resolving instance `DefId(0:11 ~ const_text_test[317d]::main[0]::{{constant}}[1])` `[]` with ParamEnv { caller_bounds: [], reveal: All, def_id: None }
#1 [typeck_tables_of] type-checking `main`
#2 [typeck_item_bodies] type-checking all item bodies
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error
Metadata
Metadata
Assignees
Labels
Area: const generics (parameters and arguments)Category: This is a bug.`#![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.