Skip to content

Commit e846c52

Browse files
Add regression test for #84634
1 parent 79b6bad commit e846c52

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
}

0 commit comments

Comments
 (0)