aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/torture/traits17.rs
blob: 268c2bd50c55dd0a4dcab2387ecf83557f6fc2a8 (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
#[lang = "sized"]
pub trait Sized {}

trait A {
    fn a() -> i32 {
        123
    }
}

trait B: A {
    fn b() -> i32 {
        Self::a() + 456
    }
}

struct S;
impl A for S {}
impl B for S {}

fn main() {
    let a;
    a = S::a();

    let b;
    b = S::b();
}