]>
Commit | Line | Data |
---|---|---|
b7449926 XL |
1 | // run-pass |
2 | ||
f035d41b | 3 | #![feature(specialization)] //~ WARN the feature `specialization` is incomplete |
1a4d82fc | 4 | |
476ff2be SL |
5 | trait Iterator { |
6 | fn next(&self); | |
54a0048b SL |
7 | } |
8 | ||
476ff2be SL |
9 | trait WithAssoc { |
10 | type Item; | |
11 | } | |
12 | ||
13 | impl<'a> WithAssoc for &'a () { | |
14 | type Item = &'a u32; | |
15 | } | |
16 | ||
064997fb | 17 | struct Cloned<I>(#[allow(unused_tuple_struct_fields)] I); |
476ff2be SL |
18 | |
19 | impl<'a, I, T: 'a> Iterator for Cloned<I> | |
20 | where I: WithAssoc<Item=&'a T>, T: Clone | |
21 | { | |
22 | fn next(&self) {} | |
23 | } | |
24 | ||
25 | impl<'a, I, T: 'a> Iterator for Cloned<I> | |
26 | where I: WithAssoc<Item=&'a T>, T: Copy | |
27 | { | |
28 | ||
223e47cc LB |
29 | } |
30 | ||
31 | fn main() { | |
476ff2be | 32 | Cloned(&()).next(); |
223e47cc | 33 | } |