]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/cannot-infer-type-for-const-param.rs
Rollup merge of #71627 - ldm0:autoderefarg, r=Dylan-DPC
[rust.git] / src / test / ui / const-generics / cannot-infer-type-for-const-param.rs
1 // check-pass
2 #![feature(const_generics)]
3 //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
4
5 // This test confirms that the types can be inferred correctly for this example with const
6 // generics. Previously this would ICE, and more recently error.
7
8 struct Foo<const NUM_BYTES: usize>(pub [u8; NUM_BYTES]);
9
10 fn main() {
11     let _ = Foo::<3>([1, 2, 3]);
12 }