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