summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/generic_const_exprs/issue-84669.rs
blob: 3933ff20a49c54362d6eb69a0eeaa7498c9f5d9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// build-pass

#![feature(generic_const_exprs)]
#![allow(incomplete_features)]

trait Foo {
    type Output;

    fn foo() -> Self::Output;
}

impl Foo for [u8; 3] {
    type Output = [u8; 1 + 2];

    fn foo() -> [u8; 3] {
        [1u8; 3]
    }
}

fn bug<const N: usize>()
where
    [u8; N]: Foo,
    <[u8; N] as Foo>::Output: AsRef<[u8]>,
{
    <[u8; N]>::foo().as_ref();
}

fn main() {
    bug::<3>();
}