]> git.proxmox.com Git - rustc.git/blame - src/test/ui/specialization/specialization-translate-projections-with-lifetimes.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / specialization / specialization-translate-projections-with-lifetimes.rs
CommitLineData
b7449926
XL
1// run-pass
2
f035d41b 3#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
1a4d82fc 4
476ff2be
SL
5trait Iterator {
6 fn next(&self);
54a0048b
SL
7}
8
476ff2be
SL
9trait WithAssoc {
10 type Item;
11}
12
13impl<'a> WithAssoc for &'a () {
14 type Item = &'a u32;
15}
16
064997fb 17struct Cloned<I>(#[allow(unused_tuple_struct_fields)] I);
476ff2be
SL
18
19impl<'a, I, T: 'a> Iterator for Cloned<I>
20 where I: WithAssoc<Item=&'a T>, T: Clone
21{
22 fn next(&self) {}
23}
24
25impl<'a, I, T: 'a> Iterator for Cloned<I>
26 where I: WithAssoc<Item=&'a T>, T: Copy
27{
28
223e47cc
LB
29}
30
31fn main() {
476ff2be 32 Cloned(&()).next();
223e47cc 33}