Closed
Description
error: internal compiler error: src/librustc/ty/sty.rs:2311: expected constant usize, got Const {
ty: usize,
val: Param(
SIZE/#0,
),
}
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:637:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to previous error
#![feature(const_generics)]
use std::mem;
fn foo<const SIZE: usize>() {
let arr: [u8; SIZE] = unsafe {
let mut array: [u8; SIZE] = mem::uninitialized();
array // remove and removes error
};
}