Skip to content

Commit

Permalink
Add regression test for #84634
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jun 8, 2022
1 parent 79b6bad commit e846c52
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/test/rustdoc/anonymous-lifetime.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Regression test for https://github.com/rust-lang/rust/issues/84634
#![crate_name = "foo"]

use std::pin::Pin;
use std::task::Poll;

pub trait Stream {
type Item;

fn poll_next(mut self: Pin<&mut Self>) -> Poll<Option<Self::Item>>;
fn size_hint(&self) -> (usize, Option<usize>);
}

// @has 'foo/trait.Stream.html'
// @has - '//*[@class="code-header in-band"]' 'impl<S: ?Sized + Stream + Unpin> Stream for &mut S'
impl<S: ?Sized + Stream + Unpin> Stream for &mut S {
type Item = S::Item;

fn poll_next(
mut self: Pin<&mut Self>,
) -> Poll<Option<Self::Item>> {
S::poll_next(Pin::new(&mut **self), cx)
}

fn size_hint(&self) -> (usize, Option<usize>) {
(**self).size_hint()
}
}

0 comments on commit e846c52

Please sign in to comment.