]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/associated-types/associated-types-stream.rs
2 // Test references to the trait `Stream` in the bounds for associated
3 // types defined on `Stream`. Issue #20551.
4 // ignore-compare-mode-chalk
11 fn car(&self) -> Self::Car
;
12 fn cdr(self) -> Self::Cdr
;
18 fn car(&self) -> () { () }
19 fn cdr(self) -> () { self }
22 impl<T
,U
> Stream
for (T
, U
)
23 where T
: Clone
, U
: Stream
27 fn car(&self) -> T { self.0.clone() }
28 fn cdr(self) -> U { self.1 }
32 let p
= (22, (44, (66, ())));
33 assert_eq
!(p
.car(), 22);
36 assert_eq
!(p
.car(), 44);
39 assert_eq
!(p
.car(), 66);