about summary refs log tree commit diff
path: root/tests/ui/associated-consts/associated-const-trait-bound.rs
blob: 6dfdbff85c03ae2696cb267974f06d2ea48e4c4f (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() {}