Skip to content

Commit

Permalink
Add test for issue 36804
Browse files Browse the repository at this point in the history
  • Loading branch information
jackh726 committed Aug 8, 2019
1 parent 2d1a551 commit 322a7d6
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/test/ui/specialization/issue-36804.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// check-pass
#![feature(specialization)]

pub struct Cloned<I>(I);

impl<'a, I, T: 'a> Iterator for Cloned<I>
where
I: Iterator<Item = &'a T>,
T: Clone,
{
type Item = T;

fn next(&mut self) -> Option<T> {
unimplemented!()
}
}

impl<'a, I, T: 'a> Iterator for Cloned<I>
where
I: Iterator<Item = &'a T>,
T: Copy,
{
fn count(self) -> usize {
unimplemented!()
}
}

fn main() {
let a = [1,2,3,4];
Cloned(a.iter()).count();
}

0 comments on commit 322a7d6

Please sign in to comment.