gccrs: Handle `async` functions in traits
[official-gcc.git] / gcc / testsuite / rust / compile / traits3.rs
blob119132f80e88afd26aacf65f5803332ad7882f84
1 #[lang = "sized"]
2 pub trait Sized {}
4 trait Foo {
5     type A;
7     fn baz(a: Self::A) -> Self::A;
10 struct Bar<T>(T);
12 impl<T> Foo for Bar<T> {
13     type A = i32;
15     fn baz(a: f32) -> f32 {
16         // { dg-error "expected" "" { target *-*-* } .-1 }
17         // { dg-error "method .baz. has an incompatible type for trait .Foo." "" { target *-*-* } .-2 }
18         a
19     }
22 fn main() {
23     let a;
24     a = Bar::<i32>::baz(123f32);