summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/associated-impl-trait-type-trivial.rs
blob: b5ea90bb0c7c6d527bc7d2631f39791551974197 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#![feature(impl_trait_in_assoc_type)]
// build-pass (FIXME(62277): could be check-pass?)

trait Bar {}
struct Dummy;
impl Bar for Dummy {}

trait Foo {
    type Assoc: Bar;
    fn foo() -> Self::Assoc;
}

impl Foo for i32 {
    type Assoc = impl Bar;
    fn foo() -> Self::Assoc {
        Dummy
    }
}

fn main() {}