summaryrefslogtreecommitdiffstats
path: root/src/test/ui/generic-associated-types/issue-84931.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/generic-associated-types/issue-84931.rs')
-rw-r--r--src/test/ui/generic-associated-types/issue-84931.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/ui/generic-associated-types/issue-84931.rs b/src/test/ui/generic-associated-types/issue-84931.rs
new file mode 100644
index 000000000..9e247de16
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-84931.rs
@@ -0,0 +1,22 @@
+#![feature(generic_associated_types)]
+// check-fail
+
+trait StreamingIter {
+ type Item<'a> where Self: 'a;
+ fn next<'a>(&'a mut self) -> Option<Self::Item::<'a>>;
+}
+
+struct StreamingSliceIter<'a, T> {
+ idx: usize,
+ data: &'a mut [T],
+}
+
+impl<'b, T: 'b> StreamingIter for StreamingSliceIter<'b, T> {
+ type Item<'a> = &'a mut T;
+ //~^ the parameter type
+ fn next(&mut self) -> Option<&mut T> {
+ loop {}
+ }
+}
+
+fn main() {}