1 // build-pass 2 3 #![allow(incomplete_features)] 4 #![feature(generic_const_exprs)] 5 6 pub trait Foo { 7 const SIZE: usize; 8 to_bytes(&self) -> [u8; Self::SIZE]9 fn to_bytes(&self) -> [u8; Self::SIZE]; 10 } 11 bar<G: Foo>(a: &G) -> u8 where [(); G::SIZE]: Sized,12pub fn bar<G: Foo>(a: &G) -> u8 13 where 14 [(); G::SIZE]: Sized, 15 { 16 deeper_bar(a) 17 } 18 deeper_bar<G: Foo>(a: &G) -> u8 where [(); G::SIZE]: Sized,19fn deeper_bar<G: Foo>(a: &G) -> u8 20 where 21 [(); G::SIZE]: Sized, 22 { 23 a.to_bytes()[0] 24 } 25 main()26fn main() {} 27