gccrs: Handle `async` functions in traits
[official-gcc.git] / gcc / testsuite / rust / compile / generics6.rs
blob33093cf706b93cf464fd005f406fcff1f439a14d
1 #[lang = "sized"]
2 pub trait Sized {}
4 struct Foo<A> {
5     a: A,
8 impl Foo<isize> {
9     fn test() -> i32 { // { dg-error "possible candidate" "TODO" { xfail *-*-* } }
10         123
11     }
13     fn bar(self) -> isize {
14         self.a
15     }
18 impl Foo<f32> {
19     fn test() -> i32 { // { dg-error "possible candidate" "TODO" { xfail *-*-* } }
20         123
21     }
23     fn bar(self) -> f32 {
24         self.a
25     }
28 fn main() {
29     let a: i32 = Foo::test(); // { dg-error "multiple applicable items in scope for: .test." }
30     // { dg-error {Failed to resolve expression of function call} "" { target *-*-* } .-1 }