Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tokio/src/runtime/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,11 @@ impl Builder {
/// Configuration methods can be chained on the return value.
///
/// To spawn non-`Send` tasks on the resulting runtime, combine it with a
/// [`LocalSet`].
/// [`LocalSet`], or call [`build_local`] to create a [`LocalRuntime`] (unstable).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to test that (unstable) is not used as a target for [LocalRuntime] - it is not! All good here!

But "[LocalRuntime]: crate::runtime::LocalRuntime" and "[build_local]: crate::runtime::Builder::build_local" below are broken for me.

Image

cargo doc reports many broken items:

 cargo doc
warning: unresolved link to `task::Builder`
   --> tokio/src/lib.rs:357:9
    |
357 | //! - [`task::Builder`]
    |         ^^^^^^^^^^^^^ no item named `Builder` in module `task`
    |
    = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default

warning: unresolved link to `runtime::Builder::on_task_spawn`
   --> tokio/src/lib.rs:360:9
    |
360 | //! - [`runtime::Builder::on_task_spawn`]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the struct `Builder` has no field or associated item named `on_task_spawn`

warning: unresolved link to `runtime::Builder::on_task_terminate`
   --> tokio/src/lib.rs:361:9
    |
361 | //! - [`runtime::Builder::on_task_terminate`]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the struct `Builder` has no field or associated item named `on_task_terminate`

warning: unresolved link to `runtime::Builder::unhandled_panic`
   --> tokio/src/lib.rs:362:9
    |
362 | //! - [`runtime::Builder::unhandled_panic`]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the struct `Builder` has no field or associated item named `unhandled_panic`

warning: public documentation for `tokio` links to private item `runtime::TaskMeta`
   --> tokio/src/lib.rs:363:9
    |
363 | //! - [`runtime::TaskMeta`]
    |         ^^^^^^^^^^^^^^^^^ this item is private
    |
    = note: this link will resolve properly if you pass `--document-private-items`
    = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default

warning: unresolved link to `windows::named_pipe`
  --> tokio/src/net/mod.rs:28:42
   |
28 | //! [`tokio::net::windows::named_pipe`]: windows::named_pipe
   |                                          ^^^^^^^^^^^^^^^^^^^ no item named `windows` in scope

warning: public documentation for `runtime` links to private item `crate::runtime::Builder::disable_lifo_slot`
   --> tokio/src/runtime/mod.rs:366:35
    |
366 | //! [the lifo slot optimization]: crate::runtime::Builder::disable_lifo_slot
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this item is private
    |
    = note: this link will resolve properly if you pass `--document-private-items`

warning: unresolved link to `crate::runtime::RuntimeMetrics::worker_mean_poll_time`
   --> tokio/src/runtime/mod.rs:368:32
    |
368 | //! [`worker_mean_poll_time`]: crate::runtime::RuntimeMetrics::worker_mean_poll_time
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the struct `RuntimeMetrics` has no field or associated item named `worker_mean_poll_time`

warning: public documentation for `runtime` links to private item `crate::runtime::Builder::disable_lifo_slot`
   --> tokio/src/runtime/mod.rs:365:28
    |
365 | //! [`disable_lifo_slot`]: crate::runtime::Builder::disable_lifo_slot
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this item is private
    |
    = note: this link will resolve properly if you pass `--document-private-items`

warning: unresolved link to `crate::runtime::Builder::build_local`
   --> tokio/src/runtime/builder.rs:245:26
    |
245 |     /// [`build_local`]: crate::runtime::Builder::build_local
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the struct `Builder` has no field or associated item named `build_local`

warning: unresolved link to `crate::runtime::LocalRuntime`
   --> tokio/src/runtime/builder.rs:244:27
    |
244 |     /// [`LocalRuntime`]: crate::runtime::LocalRuntime
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `LocalRuntime` in module `runtime`

warning: unresolved link to `crate::runtime::LocalRuntime`
   --> tokio/src/task/local.rs:395:27
    |
395 |     /// [`LocalRuntime`]: struct@crate::runtime::LocalRuntime
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `LocalRuntime` in module `runtime`

warning: unresolved link to `crate::runtime::LocalRuntime`
   --> tokio/src/task/join_set.rs:183:27
    |
183 |     /// [`LocalRuntime`]: crate::runtime::LocalRuntime
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `LocalRuntime` in module `runtime`

warning: `tokio` (lib doc) generated 13 warnings
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.10s
   Generated /home/martin/git/rust/tokio/target/doc/tests_build/index.html and 7 other files

@Darksonn Maybe these should be fixed for 1.49.0 ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs should be built with unstable features enabled. I suspect the links are not broken in that case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right! Thanks!

With --cfg tokio_unstable only two links are not resolved:

$ RUSTDOCFLAGS="--cfg tokio_unstable" cargo doc --open
...
warning: unresolved link to `task::Builder`
   --> tokio/src/lib.rs:357:9
    |
357 | //! - [`task::Builder`]
    |         ^^^^^^^^^^^^^ no item named `Builder` in module `task`
    |
    = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default

warning: unresolved link to `windows::named_pipe`
  --> tokio/src/net/mod.rs:28:42
   |
28 | //! [`tokio::net::windows::named_pipe`]: windows::named_pipe
   |                                          ^^^^^^^^^^^^^^^^^^^ no item named `windows` in scope

warning: `tokio` (lib doc) generated 2 warnings

Let me compare it with the CI job to see what else I might be missing!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

///
/// [`LocalSet`]: crate::task::LocalSet
/// [`LocalRuntime`]: crate::runtime::LocalRuntime
/// [`build_local`]: crate::runtime::Builder::build_local
pub fn new_current_thread() -> Builder {
#[cfg(loom)]
const EVENT_INTERVAL: u32 = 4;
Expand Down