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

struct Foo<A> {
    a: A,
}

impl Foo<isize> {
    fn test() -> i32 { // { dg-error "possible candidate" "TODO" { xfail *-*-* } }
        123
    }

    fn bar(self) -> isize {
        self.a
    }
}

impl Foo<f32> {
    fn test() -> i32 { // { dg-error "possible candidate" "TODO" { xfail *-*-* } }
        123
    }

    fn bar(self) -> f32 {
        self.a
    }
}

fn main() {
    let a: i32 = Foo::test(); // { dg-error "multiple applicable items in scope for: .test." }
    // { dg-error {Failed to resolve expression of function call} "" { target *-*-* } .-1 }
}