From a08ce0d3e06d650361283dc87c8fe14b146df15d Mon Sep 17 00:00:00 2001 From: Marco Ieni <11428655+MarcoIeni@users.noreply.github.com> Date: Fri, 30 Apr 2021 13:25:50 +0200 Subject: [PATCH] ci: check docs of private items (#3715) --- .github/workflows/ci.yml | 2 +- tokio-stream/src/stream_map.rs | 2 +- tokio/src/io/driver/registration.rs | 7 ++++--- tokio/src/io/poll_evented.rs | 26 ++++++++++---------------- tokio/src/time/driver/entry.rs | 2 +- tokio/src/util/rand.rs | 2 +- 6 files changed, 18 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2806a6166..1c7839354 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -277,7 +277,7 @@ jobs: override: true - name: "doc --lib --all-features" - run: cargo doc --lib --no-deps --all-features + run: cargo doc --lib --no-deps --all-features --document-private-items env: RUSTDOCFLAGS: --cfg docsrs diff --git a/tokio-stream/src/stream_map.rs b/tokio-stream/src/stream_map.rs index 85b60cfea..d87e575b8 100644 --- a/tokio-stream/src/stream_map.rs +++ b/tokio-stream/src/stream_map.rs @@ -605,7 +605,7 @@ mod rand { /// Fast random number generate /// /// Implement xorshift64+: 2 32-bit xorshift sequences added together. - /// Shift triplet [17,7,16] was calculated as indicated in Marsaglia's + /// Shift triplet `[17,7,16]` was calculated as indicated in Marsaglia's /// Xorshift paper: https://www.jstatsoft.org/article/view/v008i14/xorshift.pdf /// This generator passes the SmallCrush suite, part of TestU01 framework: /// http://simul.iro.umontreal.ca/testu01/tu01.html diff --git a/tokio/src/io/driver/registration.rs b/tokio/src/io/driver/registration.rs index 8251fe68a..7350be634 100644 --- a/tokio/src/io/driver/registration.rs +++ b/tokio/src/io/driver/registration.rs @@ -14,8 +14,9 @@ cfg_io_driver! { /// that it will receive task notifications on readiness. This is the lowest /// level API for integrating with a reactor. /// - /// The association between an I/O resource is made by calling [`new`]. Once - /// the association is established, it remains established until the + /// The association between an I/O resource is made by calling + /// [`new_with_interest_and_handle`]. + /// Once the association is established, it remains established until the /// registration instance is dropped. /// /// A registration instance represents two separate readiness streams. One @@ -36,7 +37,7 @@ cfg_io_driver! { /// stream. The write readiness event stream is only for `Ready::writable()` /// events. /// - /// [`new`]: method@Self::new + /// [`new_with_interest_and_handle`]: method@Self::new_with_interest_and_handle /// [`poll_read_ready`]: method@Self::poll_read_ready` /// [`poll_write_ready`]: method@Self::poll_write_ready` #[derive(Debug)] diff --git a/tokio/src/io/poll_evented.rs b/tokio/src/io/poll_evented.rs index 47ae5583d..a31e6db7b 100644 --- a/tokio/src/io/poll_evented.rs +++ b/tokio/src/io/poll_evented.rs @@ -10,10 +10,10 @@ cfg_io_driver! { /// [`std::io::Write`] traits with the reactor that drives it. /// /// `PollEvented` uses [`Registration`] internally to take a type that - /// implements [`mio::Evented`] as well as [`std::io::Read`] and or + /// implements [`mio::event::Source`] as well as [`std::io::Read`] and or /// [`std::io::Write`] and associate it with a reactor that will drive it. /// - /// Once the [`mio::Evented`] type is wrapped by `PollEvented`, it can be + /// Once the [`mio::event::Source`] type is wrapped by `PollEvented`, it can be /// used from within the future's execution model. As such, the /// `PollEvented` type provides [`AsyncRead`] and [`AsyncWrite`] /// implementations using the underlying I/O resource as well as readiness @@ -40,13 +40,13 @@ cfg_io_driver! { /// [`poll_read_ready`] again will also indicate read readiness. /// /// When the operation is attempted and is unable to succeed due to the I/O - /// resource not being ready, the caller must call [`clear_read_ready`] or - /// [`clear_write_ready`]. This clears the readiness state until a new + /// resource not being ready, the caller must call `clear_read_ready` or + /// `clear_write_ready`. This clears the readiness state until a new /// readiness event is received. /// /// This allows the caller to implement additional functions. For example, /// [`TcpListener`] implements poll_accept by using [`poll_read_ready`] and - /// [`clear_read_ready`]. + /// `clear_read_ready`. /// /// ## Platform-specific events /// @@ -54,17 +54,11 @@ cfg_io_driver! { /// These events are included as part of the read readiness event stream. The /// write readiness event stream is only for `Ready::writable()` events. /// - /// [`std::io::Read`]: trait@std::io::Read - /// [`std::io::Write`]: trait@std::io::Write - /// [`AsyncRead`]: trait@AsyncRead - /// [`AsyncWrite`]: trait@AsyncWrite - /// [`mio::Evented`]: trait@mio::Evented - /// [`Registration`]: struct@Registration - /// [`TcpListener`]: struct@crate::net::TcpListener - /// [`clear_read_ready`]: method@Self::clear_read_ready - /// [`clear_write_ready`]: method@Self::clear_write_ready - /// [`poll_read_ready`]: method@Self::poll_read_ready - /// [`poll_write_ready`]: method@Self::poll_write_ready + /// [`AsyncRead`]: crate::io::AsyncRead + /// [`AsyncWrite`]: crate::io::AsyncWrite + /// [`TcpListener`]: crate::net::TcpListener + /// [`poll_read_ready`]: Registration::poll_read_ready + /// [`poll_write_ready`]: Registration::poll_write_ready pub(crate) struct PollEvented { io: Option, registration: Registration, diff --git a/tokio/src/time/driver/entry.rs b/tokio/src/time/driver/entry.rs index e630fa836..08edab31c 100644 --- a/tokio/src/time/driver/entry.rs +++ b/tokio/src/time/driver/entry.rs @@ -85,7 +85,7 @@ const STATE_MIN_VALUE: u64 = STATE_PENDING_FIRE; /// requires only the driver lock. pub(super) struct StateCell { /// Holds either the scheduled expiration time for this timer, or (if the - /// timer has been fired and is unregistered), [`u64::max_value()`]. + /// timer has been fired and is unregistered), `u64::max_value()`. state: AtomicU64, /// If the timer is fired (an Acquire order read on state shows /// `u64::max_value()`), holds the result that should be returned from diff --git a/tokio/src/util/rand.rs b/tokio/src/util/rand.rs index 5660103ed..70a97f23b 100644 --- a/tokio/src/util/rand.rs +++ b/tokio/src/util/rand.rs @@ -3,7 +3,7 @@ use std::cell::Cell; /// Fast random number generate /// /// Implement xorshift64+: 2 32-bit xorshift sequences added together. -/// Shift triplet [17,7,16] was calculated as indicated in Marsaglia's +/// Shift triplet `[17,7,16]` was calculated as indicated in Marsaglia's /// Xorshift paper: https://www.jstatsoft.org/article/view/v008i14/xorshift.pdf /// This generator passes the SmallCrush suite, part of TestU01 framework: /// http://simul.iro.umontreal.ca/testu01/tu01.html