Add regression test for #61422
This commit is contained in:
parent
5a2410a07c
commit
e82cd9528c
2 changed files with 21 additions and 0 deletions
15
src/test/ui/const-generics/issue-61422.rs
Normal file
15
src/test/ui/const-generics/issue-61422.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// run-pass
|
||||
|
||||
#![feature(const_generics)]
|
||||
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
|
||||
|
||||
use std::mem;
|
||||
|
||||
fn foo<const SIZE: usize>() {
|
||||
let arr: [u8; SIZE] = unsafe {
|
||||
let mut array: [u8; SIZE] = mem::uninitialized();
|
||||
array
|
||||
};
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
6
src/test/ui/const-generics/issue-61422.stderr
Normal file
6
src/test/ui/const-generics/issue-61422.stderr
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
|
||||
--> $DIR/issue-61422.rs:3:12
|
||||
|
|
||||
LL | #![feature(const_generics)]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue