Skip to content

Commit 92fa6ce

Browse files
committed
chore: fix doc issues (#3292)
There are a few warnings when building the docs causing failures on CI. This change fixes those and adds `unsound_local_offset` as an unexpeced cfg.
1 parent 4deba4a commit 92fa6ce

File tree

3 files changed

+14
-20
lines changed

3 files changed

+14
-20
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ members = [
2222
# This will be ignored with Rust older than 1.74, but for now that's okay;
2323
# we're only using it to fix check-cfg issues that first appeared in Rust 1.80.
2424
[workspace.lints.rust]
25-
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(flaky_tests)", "cfg(tracing_unstable)"] }
25+
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(flaky_tests)", "cfg(tracing_unstable)", "cfg(unsound_local_offset)"] }

tracing-appender/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
//! ```
2222
//!
2323
//! This crate can be used in a few ways to record spans/events:
24-
//! - Using a [`RollingFileAppender`][rolling_struct] to perform writes to a log file. This will block on writes.
25-
//! - Using *any* type implementing [`std::io::Write`][write] in a non-blocking fashion.
26-
//! - Using a combination of [`NonBlocking`][non_blocking] and [`RollingFileAppender`][rolling_struct] to allow writes to a log file
24+
//! - Using a [`RollingFileAppender`] to perform writes to a log file. This will block on writes.
25+
//! - Using *any* type implementing [`std::io::Write`] in a non-blocking fashion.
26+
//! - Using a combination of [`NonBlocking`] and [`RollingFileAppender`] to allow writes to a log file
2727
//! without blocking.
2828
//!
2929
//! ## File Appender
@@ -48,7 +48,7 @@
4848
//! # }
4949
//! ```
5050
//!
51-
//! The file appender implements [`std::io::Write`][write]. To be used with
51+
//! The file appender implements [`std::io::Write`]. To be used with
5252
//! [`tracing_subscriber::FmtSubscriber`][fmt_subscriber], it must be combined with a
5353
//! [`MakeWriter`][make_writer] implementation to be able to record tracing spans/event.
5454
//!
@@ -68,12 +68,12 @@
6868
//! .init();
6969
//! # }
7070
//! ```
71-
//! **Note:** `_guard` is a [`WorkerGuard`][guard] which is returned by [`tracing_appender::non_blocking`][non_blocking]
71+
//! **Note:** `_guard` is a [`WorkerGuard`] which is returned by [`tracing_appender::non_blocking`][non_blocking]
7272
//! to ensure buffered logs are flushed to their output in the case of abrupt terminations of a process.
7373
//! See [`WorkerGuard` module][guard] for more details.
7474
//!
7575
//! The example below demonstrates the construction of a [`tracing_appender::non_blocking`][non_blocking]
76-
//! writer constructed with a [`std::io::Write`][write]:
76+
//! writer constructed with a [`std::io::Write`]:
7777
//!
7878
//! ```rust
7979
//! use std::io::Error;

tracing-appender/src/non_blocking.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@
3131
//! Unintentional drops of `WorkerGuard` remove the guarantee that logs will be flushed
3232
//! during a program's termination, in a panic or otherwise.
3333
//!
34-
//! See [`WorkerGuard`][worker_guard] for examples of using the guard.
35-
//!
36-
//! [worker_guard]: WorkerGuard
34+
//! See [`WorkerGuard`] for examples of using the guard.
3735
//!
3836
//! # Examples
3937
//!
@@ -60,12 +58,11 @@ use tracing_subscriber::fmt::MakeWriter;
6058

6159
/// The default maximum number of buffered log lines.
6260
///
63-
/// If [`NonBlocking`][non-blocking] is lossy, it will drop spans/events at capacity.
64-
/// If [`NonBlocking`][non-blocking] is _not_ lossy,
65-
/// backpressure will be exerted on senders, causing them to block their
66-
/// respective threads until there is available capacity.
61+
/// If [`NonBlocking`] is lossy, it will drop spans/events at capacity.
62+
/// If [`NonBlocking`] is _not_ lossy, backpressure will be exerted on
63+
/// senders, causing them to block their respective threads until there
64+
/// is available capacity.
6765
///
68-
/// [non-blocking]: NonBlocking
6966
/// Recommended to be a power of 2.
7067
pub const DEFAULT_BUFFERED_LINES_LIMIT: usize = 128_000;
7168

@@ -116,11 +113,10 @@ pub struct WorkerGuard {
116113
/// `NonBlocking` moves the writing out of an application's data path by sending spans and events
117114
/// to a dedicated logging thread.
118115
///
119-
/// This struct implements [`MakeWriter`][make_writer] from the `tracing-subscriber`
116+
/// This struct implements [`MakeWriter`] from the `tracing-subscriber`
120117
/// crate. Therefore, it can be used with the [`tracing_subscriber::fmt`][fmt] module
121118
/// or with any other subscriber/layer implementation that uses the `MakeWriter` trait.
122119
///
123-
/// [make_writer]: tracing_subscriber::fmt::MakeWriter
124120
/// [fmt]: mod@tracing_subscriber::fmt
125121
#[derive(Clone, Debug)]
126122
pub struct NonBlocking {
@@ -184,9 +180,7 @@ impl NonBlocking {
184180
}
185181
}
186182

187-
/// A builder for [`NonBlocking`][non-blocking].
188-
///
189-
/// [non-blocking]: NonBlocking
183+
/// A builder for [`NonBlocking`].
190184
#[derive(Debug)]
191185
pub struct NonBlockingBuilder {
192186
buffered_lines_limit: usize,

0 commit comments

Comments
 (0)