Add const-types test
This commit is contained in:
parent
5cf45bc27a
commit
67176f751b
2 changed files with 22 additions and 0 deletions
16
src/test/ui/const-generics/const-types.rs
Normal file
16
src/test/ui/const-generics/const-types.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// run-pass
|
||||
|
||||
#![feature(const_generics)]
|
||||
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
|
||||
|
||||
#[allow(dead_code)]
|
||||
|
||||
struct ConstArray<T, const LEN: usize> {
|
||||
array: [T; LEN],
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let arr = ConstArray::<i32, 8> {
|
||||
array: [0; 8],
|
||||
};
|
||||
}
|
||||
6
src/test/ui/const-generics/const-types.stderr
Normal file
6
src/test/ui/const-generics/const-types.stderr
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
warning: the feature `const_generics` is incomplete and may cause the compiler to crash
|
||||
--> $DIR/const-types.rs:3:12
|
||||
|
|
||||
LL | #![feature(const_generics)]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue