]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/const_evaluatable_checked/impl-bounds.rs
visit impl self ty + trait
[rust.git] / src / test / ui / const-generics / const_evaluatable_checked / impl-bounds.rs
1 // check-pass
2 #![feature(const_generics, const_evaluatable_checked)]
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() {}