We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c43d03a commit e5017deCopy full SHA for e5017de
src/test/ui/issues/issue-50301.rs
@@ -0,0 +1,31 @@
1
+// Tests that HRTBs are correctly accepted -- https://github.com/rust-lang/rust/issues/50301
2
+// check-pass
3
+trait Trait
4
+where
5
+ for<'a> &'a Self::IntoIter: IntoIterator<Item = u32>,
6
+{
7
+ type IntoIter;
8
+ fn get(&self) -> Self::IntoIter;
9
+}
10
+
11
+struct Impl(Vec<u32>);
12
13
+impl Trait for Impl {
14
+ type IntoIter = ImplIntoIter;
15
+ fn get(&self) -> Self::IntoIter {
16
+ ImplIntoIter(self.0.clone())
17
+ }
18
19
20
+struct ImplIntoIter(Vec<u32>);
21
22
+impl<'a> IntoIterator for &'a ImplIntoIter {
23
+ type Item = <Self::IntoIter as Iterator>::Item;
24
+ type IntoIter = std::iter::Cloned<std::slice::Iter<'a, u32>>;
25
+ fn into_iter(self) -> Self::IntoIter {
26
+ (&self.0).into_iter().cloned()
27
28
29
30
+fn main() {
31
0 commit comments