mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
34 lines
533 B
Rust
34 lines
533 B
Rust
// run-pass
|
|
|
|
#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
|
|
|
|
trait Iterator {
|
|
fn next(&self);
|
|
}
|
|
|
|
trait WithAssoc {
|
|
type Item;
|
|
}
|
|
|
|
impl<'a> WithAssoc for &'a () {
|
|
type Item = &'a u32;
|
|
}
|
|
|
|
struct Cloned<I>(#[allow(unused_tuple_struct_fields)] I);
|
|
|
|
impl<'a, I, T: 'a> Iterator for Cloned<I>
|
|
where I: WithAssoc<Item=&'a T>, T: Clone
|
|
{
|
|
fn next(&self) {}
|
|
}
|
|
|
|
impl<'a, I, T: 'a> Iterator for Cloned<I>
|
|
where I: WithAssoc<Item=&'a T>, T: Copy
|
|
{
|
|
|
|
}
|
|
|
|
fn main() {
|
|
Cloned(&()).next();
|
|
}
|