]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/cannot-infer-type-for-const-param.rs
Auto merge of #79342 - CDirkx:ipaddr-const, r=oli-obk
[rust.git] / src / test / ui / const-generics / cannot-infer-type-for-const-param.rs
1 // check-pass
2 // revisions: full min
3 #![cfg_attr(full, feature(const_generics))]
4 #![cfg_attr(full, allow(incomplete_features))]
5 #![cfg_attr(min, feature(min_const_generics))]
6
7 // This test confirms that the types can be inferred correctly for this example with const
8 // generics. Previously this would ICE, and more recently error.
9
10 struct Foo<const NUM_BYTES: usize>(pub [u8; NUM_BYTES]);
11
12 fn main() {
13     let _ = Foo::<3>([1, 2, 3]);
14 }