File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Regression test for https://github.com/rust-lang/rust/issues/84634
2
+ #![ crate_name = "foo" ]
3
+
4
+ use std:: pin:: Pin ;
5
+ use std:: task:: Poll ;
6
+
7
+ pub trait Stream {
8
+ type Item ;
9
+
10
+ fn poll_next ( mut self : Pin < & mut Self > ) -> Poll < Option < Self :: Item > > ;
11
+ fn size_hint ( & self ) -> ( usize , Option < usize > ) ;
12
+ }
13
+
14
+ // @has 'foo/trait.Stream.html'
15
+ // @has - '//*[@class="code-header in-band"]' 'impl<S: ?Sized + Stream + Unpin> Stream for &mut S'
16
+ impl < S : ?Sized + Stream + Unpin > Stream for & mut S {
17
+ type Item = S :: Item ;
18
+
19
+ fn poll_next (
20
+ mut self : Pin < & mut Self > ,
21
+ ) -> Poll < Option < Self :: Item > > {
22
+ S :: poll_next ( Pin :: new ( & mut * * self ) , cx)
23
+ }
24
+
25
+ fn size_hint ( & self ) -> ( usize , Option < usize > ) {
26
+ ( * * self ) . size_hint ( )
27
+ }
28
+ }
You can’t perform that action at this time.
0 commit comments