aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-1019.rs
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/rust/compile/issue-1019.rs')
-rw-r--r--gcc/testsuite/rust/compile/issue-1019.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/issue-1019.rs b/gcc/testsuite/rust/compile/issue-1019.rs
new file mode 100644
index 0000000..aea86a8
--- /dev/null
+++ b/gcc/testsuite/rust/compile/issue-1019.rs
@@ -0,0 +1,19 @@
+trait A<T> {
+ type Output;
+
+ fn test(self, a: &T) -> &Self::Output;
+}
+
+struct Foo<T> {
+ // { dg-warning "struct is never constructed" "" { target *-*-* } .-1 }
+ start: T,
+ end: T,
+}
+
+impl<X> A<X> for Foo<usize> {
+ type Output = X;
+
+ fn test(self, a: &X) -> &Self::Output {
+ a
+ }
+}