diff options
Diffstat (limited to 'gcc/testsuite/rust/compile/issue-1773.rs')
-rw-r--r-- | gcc/testsuite/rust/compile/issue-1773.rs | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/gcc/testsuite/rust/compile/issue-1773.rs b/gcc/testsuite/rust/compile/issue-1773.rs index 468497a..41c82f0 100644 --- a/gcc/testsuite/rust/compile/issue-1773.rs +++ b/gcc/testsuite/rust/compile/issue-1773.rs @@ -1,8 +1,4 @@ -#[lang = "sized"] -// { dg-skip-if "" { *-*-* } } -pub trait Sized {} - -trait Foo<T> { +trait Foo { type A; fn test(a: Self::A) -> Self::A { @@ -10,9 +6,14 @@ trait Foo<T> { } } -struct Bar<T>(T); -impl<T> Foo<T> for Bar<i32> { - type A = T; +struct Bar(i32); +impl Foo for Bar { + type A = i32; +} + +struct Baz(f32); +impl Foo for Baz { + type A = f32; } fn main() { @@ -21,4 +22,10 @@ fn main() { let b; b = Bar::test(a.0); + + let c; + c = Baz(123f32); + + let d; + d = Baz::test(c.0); } |