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 committed Aug 10, 2019
2 parents 6743ad6 + 322a7d6 commit 5ed195b
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 5ed195b

Please sign in to comment.