Skip to content

Commit 322a7d6

Browse files
committed
Add test for issue 36804
1 parent 2d1a551 commit 322a7d6

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// check-pass
2+
#![feature(specialization)]
3+
4+
pub struct Cloned<I>(I);
5+
6+
impl<'a, I, T: 'a> Iterator for Cloned<I>
7+
where
8+
I: Iterator<Item = &'a T>,
9+
T: Clone,
10+
{
11+
type Item = T;
12+
13+
fn next(&mut self) -> Option<T> {
14+
unimplemented!()
15+
}
16+
}
17+
18+
impl<'a, I, T: 'a> Iterator for Cloned<I>
19+
where
20+
I: Iterator<Item = &'a T>,
21+
T: Copy,
22+
{
23+
fn count(self) -> usize {
24+
unimplemented!()
25+
}
26+
}
27+
28+
fn main() {
29+
let a = [1,2,3,4];
30+
Cloned(a.iter()).count();
31+
}

0 commit comments

Comments
 (0)