]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/cannot-infer-type-for-const-param.rs
Auto merge of #65838 - estebank:resilient-recovery, r=Centril
[rust.git] / src / test / ui / const-generics / cannot-infer-type-for-const-param.rs
1 // build-pass (FIXME(62277): could be 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 }