diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-06-08 18:15:04 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-08 18:15:04 +0200 |
| commit | d11ab8528cb5e54f351f3afb0589fb78aec98f04 (patch) | |
| tree | 71bc9ef5dba2122d51744c6f7a1aa131b252a850 | |
| parent | 8a2aedc6e3c5a3a5b8ff6d8936a631f48b772ca7 (diff) | |
| parent | e846c523e4604aef5ce8085c583622f1444bda39 (diff) | |
| download | rust-d11ab8528cb5e54f351f3afb0589fb78aec98f04.tar.gz rust-d11ab8528cb5e54f351f3afb0589fb78aec98f04.zip | |
Rollup merge of #97878 - GuillaumeGomez:regression-test-84634, r=notriddle
Add regression test for anonymous lifetimes Fixes #84634. Seems like this issue was already solved. I added a regression test just in case so we can close it with peace in mind. r? `@notriddle`
| -rw-r--r-- | src/test/rustdoc/anonymous-lifetime.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/test/rustdoc/anonymous-lifetime.rs b/src/test/rustdoc/anonymous-lifetime.rs new file mode 100644 index 00000000000..f5a7d225847 --- /dev/null +++ b/src/test/rustdoc/anonymous-lifetime.rs @@ -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() + } +} |
