aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-2907.rs
blob: fdf1953fc8c1ed2323e25d4e47aba41b93dada9a (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
31
32
#![feature(lang_items)]

#[lang = "sized"]
pub trait Sized {}

pub trait Bar {}

pub trait Foo {
    type Ty;

    fn foo(self) -> Self::Ty;
}

impl<B: Bar> Foo for B {
    type Ty = u32;

    fn foo(self) -> Self::Ty {
        14
    }
}

struct Qux;

impl Bar for Qux {}

fn main() {
    let a = Qux;
    a.foo();

    let b = Qux;
    Foo::foo(b);
}