]>
Commit | Line | Data |
---|---|---|
1b1a35ee | 1 | // check-pass |
94222f64 | 2 | #![feature(generic_const_exprs)] |
1b1a35ee XL |
3 | #![allow(incomplete_features)] |
4 | ||
5 | use std::mem::size_of; | |
6 | ||
7 | struct Foo<T, const N: usize>(T); | |
8 | ||
9 | impl<T> Foo<T, { size_of::<T>() }> { | |
10 | fn test() { | |
11 | let _: [u8; std::mem::size_of::<T>()]; | |
12 | } | |
13 | } | |
14 | ||
15 | trait Bar<const N: usize> { | |
16 | fn test_me(); | |
17 | } | |
18 | ||
19 | impl<T> Bar<{ size_of::<T>() }> for Foo<T, 3> { | |
20 | fn test_me() { | |
21 | let _: [u8; std::mem::size_of::<T>()]; | |
22 | } | |
23 | } | |
24 | ||
25 | fn main() {} |