Skip to content

Commit

Permalink
Rollup merge of rust-lang#63394 - jackh726:issue-36804, r=jonas-schie…
Browse files Browse the repository at this point in the history
…vink

Add test for issue 36804

I slightly reduced the repro that ICEs on nightly-2017-01-20.

Closes rust-lang#36804
  • Loading branch information
Centril authored Aug 9, 2019
2 parents f4beab3 + 322a7d6 commit 8453b43
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 8453b43

Please sign in to comment.