• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // build-pass
2 
3 #![feature(generic_const_exprs)]
4 #![allow(incomplete_features)]
5 
6 trait Foo {
7     type Output;
8 
foo() -> Self::Output9     fn foo() -> Self::Output;
10 }
11 
12 impl Foo for [u8; 3] {
13     type Output = [u8; 1 + 2];
14 
foo() -> [u8; 3]15     fn foo() -> [u8; 3] {
16         [1u8; 3]
17     }
18 }
19 
bug<const N: usize>() where [u8; N]: Foo, <[u8; N] as Foo>::Output: AsRef<[u8]>,20 fn bug<const N: usize>()
21 where
22     [u8; N]: Foo,
23     <[u8; N] as Foo>::Output: AsRef<[u8]>,
24 {
25     <[u8; N]>::foo().as_ref();
26 }
27 
main()28 fn main() {
29     bug::<3>();
30 }
31