2 // Test references to the trait `Stream` in the bounds for associated
3 // types defined on `Stream`. Issue #20551.
10 fn car(&self) -> Self::Car;
11 fn cdr(self) -> Self::Cdr;
17 fn car(&self) -> () { () }
18 fn cdr(self) -> () { self }
21 impl<T,U> Stream for (T, U)
22 where T : Clone, U : Stream
26 fn car(&self) -> T { self.0.clone() }
27 fn cdr(self) -> U { self.1 }
31 let p = (22, (44, (66, ())));
32 assert_eq!(p.car(), 22);
35 assert_eq!(p.car(), 44);
38 assert_eq!(p.car(), 66);