Add test for issue 36804
This commit is contained in:
parent
2d1a551e14
commit
322a7d6387
31
src/test/ui/specialization/issue-36804.rs
Normal file
31
src/test/ui/specialization/issue-36804.rs
Normal file
@ -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();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user