diff options
Diffstat (limited to 'gcc/testsuite/rust/compile/issue-3242.rs')
-rw-r--r-- | gcc/testsuite/rust/compile/issue-3242.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/issue-3242.rs b/gcc/testsuite/rust/compile/issue-3242.rs new file mode 100644 index 0000000..a4542aea0 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3242.rs @@ -0,0 +1,23 @@ +#[lang = "sized"] +pub trait Sized {} + +trait Foo<T> { + type A; + + fn test(a: Self::A) -> Self::A { + a + } +} + +struct Bar<T>(T); +impl<T> Foo<T> for Bar<i32> { + type A = T; +} + +fn main() { + let a; + a = Bar(123); + + let b; + b = Bar::test(a.0); +} |