summaryrefslogtreecommitdiffstats
path: root/tests/ui/associated-consts/associated-const-trait-bound.rs
blob: 403cdbd7ff330a2a95ff57a76e03240f7faec8a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// build-pass (FIXME(62277): could be check-pass?)

trait ConstDefault {
    const DEFAULT: Self;
}

trait Foo: Sized {}

trait FooExt: Foo {
    type T: ConstDefault;
}

trait Bar<F: FooExt> {
    const T: F::T;
}

impl<F: FooExt> Bar<F> for () {
    const T: F::T = <F::T as ConstDefault>::DEFAULT;
}

fn main() {}