summaryrefslogtreecommitdiffstats
path: root/tests/ui/associated-inherent-types/const-generics.rs
blob: 5b7c00bccba701be97d9e949a062c007160ef7bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Regression test for issue #109759.
// check-pass

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

struct Foo;

struct Bar<const X: usize>([(); X]);

impl<const X: usize> Bar<X> {
    pub fn new() -> Self {
        Self([(); X])
    }
}

impl Foo {
    type Bar<const X: usize> = Bar<X>;
}

fn main() {
    let _ = Foo::Bar::<10>::new();
}