• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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,12 pub 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,19 fn deeper_bar<G: Foo>(a: &G) -> u8
20 where
21     [(); G::SIZE]: Sized,
22 {
23     a.to_bytes()[0]
24 }
25 
main()26 fn main() {}
27