summaryrefslogtreecommitdiffstats
path: root/tests/ui/generic-associated-types/issue-84931.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/generic-associated-types/issue-84931.rs')
-rw-r--r--tests/ui/generic-associated-types/issue-84931.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/generic-associated-types/issue-84931.rs b/tests/ui/generic-associated-types/issue-84931.rs
new file mode 100644
index 000000000..4123ce9d4
--- /dev/null
+++ b/tests/ui/generic-associated-types/issue-84931.rs
@@ -0,0 +1,21 @@
+// 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() {}