Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert even more intra-doc links #1077

Merged
merged 4 commits into from
Nov 2, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix ambiguities and typos
  • Loading branch information
jyn514 committed Nov 2, 2020
commit 38be9491fa46d83925600621b4165ae7d9d84a51
2 changes: 1 addition & 1 deletion tracing-appender/src/non_blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ pub struct WorkerGuard {
/// or with any other subscriber/layer implementation that uses the `MakeWriter` trait.
///
/// [make_writer]: tracing_subscriber::fmt::MakeWriter
/// [fmt]: tracing_subscriber::fmt
/// [fmt]: mod@tracing_subscriber::fmt
#[derive(Clone, Debug)]
pub struct NonBlocking {
error_counter: Arc<AtomicU64>,
Expand Down
5 changes: 3 additions & 2 deletions tracing-attributes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
//! ```
//!
//! [`tracing`]: https://crates.io/crates/tracing
//! [span]: tracing::span
//! [instrument]: macro@instrument
//! [span]: https://docs.rs/tracing/latest/tracing/span/index.html
//!
//! ## Supported Rust Versions
//!
Expand Down Expand Up @@ -250,7 +251,7 @@ use syn::{
/// Instead, you should manually rewrite any `Self` types as the type for
/// which you implement the trait: `#[instrument(fields(tmp = std::any::type_name::<Bar>()))]`.
///
/// [span]: tracing::span
/// [span]: https://docs.rs/tracing/latest/tracing/span/index.html
/// [`tracing`]: https://github.com/tokio-rs/tracing
/// [`fmt::Debug`]: https://doc.rust-lang.org/std/fmt/trait.Debug.html
#[proc_macro_attribute]
Expand Down
2 changes: 1 addition & 1 deletion tracing-core/src/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ pub trait Collect: 'static {
/// with the provided `TypeId`. Failure to ensure this will result in
/// undefined behaviour, so implementing `downcast_raw` is unsafe.
///
/// [`downcast_ref`]: Collect::downcast_ref()
/// [`downcast_ref`]: #method.downcast_ref
unsafe fn downcast_raw(&self, id: TypeId) -> Option<*const ()> {
if id == TypeId::of::<Self>() {
Some(self as *const Self as *const ())
Expand Down
4 changes: 2 additions & 2 deletions tracing-error/src/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ use tracing::{Metadata, Span};
///
/// [`tracing`]: https://docs.rs/tracing
/// [`Backtrace`]: https://doc.rust-lang.org/std/backtrace/struct.Backtrace.html
/// [span]: tracing::span
/// [parents]: tracing::span#span-relationships
/// [span]: mod@tracing::span
/// [parents]: mod@tracing::span#span-relationships
/// [fields]: tracing::field
/// [futures]: https://doc.rust-lang.org/std/future/trait.Future.html
/// [`tracing-futures`]: https://docs.rs/tracing-futures/
Expand Down
2 changes: 1 addition & 1 deletion tracing-error/src/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use tracing_subscriber::{
/// when formatting the fields of each span in a trace. When no formatter is
/// provided, the [default format] is used instead.
///
/// [subscriber]: tracing_subscriber::subscriber::Subscribe
/// [subscriber]: tracing_subscriber::subscribe::Subscribe
/// [`SpanTrace`]: super::SpanTrace
/// [field formatter]: tracing_subscriber::fmt::FormatFields
/// [default format]: tracing_subscriber::fmt::format::DefaultFields
Expand Down
4 changes: 2 additions & 2 deletions tracing-error/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@
//! ```
//!
//! [`in_current_span()`]: InstrumentResult::in_current_span
//! [span]: tracing::span
//! [span]: mod@tracing::span
//! [events]: tracing::Event
//! [collector]: tracing::Collect
//! [subscriber layer]: tracing_subscriber::layer::Layer
//! [subscriber layer]: tracing_subscriber::subscribe::Subscribe
//! [`tracing`]: https://docs.rs/tracing
//! [`std::error::Error`]: https://doc.rust-lang.org/stable/std/error/trait.Error.html
//!
Expand Down
2 changes: 1 addition & 1 deletion tracing-flame/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
//!
//! [`tracing`]: https://docs.rs/tracing
//! [`inferno`]: https://docs.rs/inferno
//! [`inferno-flamegraph`]: inferno#producing-a-flame-graph
//! [`inferno-flamegraph`]: https://docs.rs/inferno/0.9.5/inferno/index.html#producing-a-flame-graph
//!
//! ## Supported Rust Versions
//!
Expand Down
8 changes: 4 additions & 4 deletions tracing-futures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
//! The `tokio`, `std-future` and `std` features are enabled by default.
//!
//! [`tracing`]: https://crates.io/crates/tracing
//! [span]: tracing::span
//! [span]: mod@tracing::span
//! [collector]: tracing::collect
//! [`futures`]: https://crates.io/crates/futures
//!
Expand Down Expand Up @@ -118,7 +118,7 @@ pub mod executor;
/// Extension trait allowing futures, streams, sinks, and executors to be
/// instrumented with a `tracing` [span].
///
/// [span]: tracing::span
/// [span]: mod@tracing::span
pub trait Instrument: Sized {
/// Instruments this type with the provided `Span`, returning an
/// `Instrumented` wrapper.
Expand Down Expand Up @@ -206,7 +206,7 @@ pub trait WithCollector: Sized {
/// default for any futures spawned on that executor.
///
/// [collector]: tracing::collect::Collect
/// [default]: tracing::dispatcher#setting-the-default-subscriber
/// [default]: tracing::dispatch#setting-the-default-collector
fn with_collector<S>(self, collector: S) -> WithDispatch<Self>
where
S: Into<Dispatch>,
Expand All @@ -229,7 +229,7 @@ pub trait WithCollector: Sized {
/// spawning a new future.
///
/// [collector]: tracing::collect::Collect
/// [default]: tracing::dispatcher#setting-the-default-subscriber
/// [default]: tracing::dispatch#setting-the-default-collector
#[inline]
fn with_current_collector(self) -> WithDispatch<Self> {
WithDispatch {
Expand Down
2 changes: 1 addition & 1 deletion tracing-journald/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//!
//! [msrv]: #supported-rust-versions
//! [`tracing`]: https://crates.io/crates/tracing
//! [subscriber]: tracing_subscriber::subscriber::Subscriber
//! [subscriber]: tracing_subscriber::subscribe::Subscribe
//! [journald]: https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html
//!
//! ## Supported Rust Versions
Expand Down
5 changes: 3 additions & 2 deletions tracing-log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@
//! [`tracing`]: https://crates.io/crates/tracing
//! [`log`]: https://crates.io/crates/log
//! [`env_logger` crate]: https://crates.io/crates/env-logger
//! [`tracing::Collector`]: tracing::Collect
//! [`Collect`]: tracing::Collect
//! [`tracing::Collector`]: https://docs.rs/tracing/latest/tracing/trait.Collect.html
//! [`Collect`]: https://docs.rs/tracing/latest/tracing/trait.Collect.html
//! [`tracing::Event`]: https://docs.rs/tracing/latest/tracing/struct.Event.html
//! [flags]: https://docs.rs/tracing/latest/tracing/#crate-feature-flags
#![doc(html_root_url = "https://docs.rs/tracing-log/0.1.1")]
#![doc(
Expand Down
2 changes: 1 addition & 1 deletion tracing-subscriber/src/fmt/fmt_subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ where
/// this formatter; they will not be recorded by other `Collector`s or by
/// `Subscriber`s added to this subscriber.
///
/// [lifecycle]: tracing::span#the-span-lifecycle
/// [lifecycle]: mod@tracing::span#the-span-lifecycle
/// [time]: Subscriber::without_time()
pub fn with_span_events(self, kind: FmtSpan) -> Self {
Subscriber {
Expand Down
4 changes: 2 additions & 2 deletions tracing-subscriber/src/fmt/format/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ pub struct Pretty {

/// The [visitor] produced by [`Pretty`]'s [`MakeVisitor`] implementation.
///
/// [visitor]: super::super::field::Visit
/// [`MakeVisitor`]: super::super::field::MakeVisitor
/// [visitor]: field::Visit
/// [`MakeVisitor`]: crate::field::MakeVisitor
pub struct PrettyVisitor<'a> {
writer: &'a mut dyn Write,
is_empty: bool,
Expand Down
3 changes: 2 additions & 1 deletion tracing-subscriber/src/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ where
/// Note that using the `chrono` feature flag enables the
/// additional time formatters [`ChronoUtc`] and [`ChronoLocal`].
///
/// [`time`]: mod@time
/// [`timer`]: time::FormatTime
/// [`ChronoUtc`]: time::ChronoUtc
/// [`ChronoLocal`]: time::ChronoLocal
Expand Down Expand Up @@ -658,7 +659,7 @@ where
/// this formatter; they will not be recorded by other `Collector`s or by
/// `Subscriber`s added to this subscriber.
///
/// [lifecycle]: tracing::span#the-span-lifecycle
/// [lifecycle]: mod@tracing::span#the-span-lifecycle
/// [time]: CollectorBuilder::without_time()
pub fn with_span_events(self, kind: format::FmtSpan) -> Self {
CollectorBuilder {
Expand Down
2 changes: 2 additions & 0 deletions tracing-subscriber/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
//! supported compiler version is not considered a semver breaking change as
//! long as doing so complies with this policy.
//!
//! [`fmt`]: mod@fmt
//! [`registry`]: mod@registry
//! [`tracing`]: https://docs.rs/tracing/latest/tracing/
//! [`Collect`]: tracing_core::collect::Collect
//! [`EnvFilter`]: filter::EnvFilter
Expand Down
10 changes: 3 additions & 7 deletions tracing-subscriber/src/subscribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,14 @@ use std::{any::TypeId, marker::PhantomData};
/// [`register_callsite`]: Subscribe::register_callsite()
/// [`enabled`]: Subscribe::enabled()
/// [`on_enter`]: Subscribe::on_enter()
/// [`Interest::never()`]: tracing_core::subscriber::Interest::never()
pub trait Subscribe<C>
where
C: Collect,
Self: 'static,
{
/// Registers a new callsite with this subscriber, returning whether or not
/// the subscriber is interested in being notified about the callsite, similarly
/// to [`Collector::register_callsite`].
/// to [`Collect::register_callsite`].
///
/// By default, this returns [`Interest::always()`] if [`self.enabled`] returns
/// true, or [`Interest::never()`] if it returns false.
Expand All @@ -212,7 +211,7 @@ where
/// <div class="example-wrap" style="display:inline-block">
/// <pre class="ignore" style="white-space:normal;font:inherit;">
/// <strong>Note</strong>: This method (and <a href="#method.enabled">
/// <code>Subscriber::enabled</code></a>) determine whether a span or event is
/// <code>Subscribe::enabled</code></a>) determine whether a span or event is
/// globally enabled, <em>not</em> whether the individual subscriber will be
/// notified about that span or event. This is intended to be used
/// by subscribers that implement filtering for the entire stack. Subscribers which do
Expand All @@ -234,11 +233,8 @@ where
/// [`Interest::always()`].
///
/// [`Interest`]: tracing_core::Interest
/// [`Collector::register_callsite`]: tracing_core::Subscriber::register_callsite()
/// [`Interest::never()`]: tracing_core::subscriber::Interest::never()
/// [`Interest::always()`]: tracing_core::subscriber::Interest::always()
/// [`Collect::register_callsite`]: tracing_core::Collect::register_callsite()
/// [`self.enabled`]: Subscribe::enabled()
/// [`Subscriber::enabled`]: Subscribe::enabled()
/// [`on_event`]: Subscribe::on_event()
/// [`on_enter`]: Subscribe::on_enter()
/// [`on_exit`]: Subscribe::on_exit()
Expand Down
10 changes: 5 additions & 5 deletions tracing-subscriber/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use tracing_core::dispatch::{self, Dispatch};
/// `Collector`, may implement `Into<Dispatch>`, and will also receive an
/// implementation of this trait.
///
/// [default subscriber]: tracing::dispatcher#setting-the-default-subscriber
/// [trace dispatcher]: tracing::dispatcher
/// [default subscriber]: tracing::dispatch#setting-the-default-collector
/// [trace dispatcher]: tracing::dispatch
pub trait SubscriberInitExt
where
Self: Into<Dispatch>,
Expand All @@ -27,7 +27,7 @@ where
/// a [`log`] compatibility layer. This allows the subscriber to consume
/// `log::Record`s as though they were `tracing` `Event`s.
///
/// [default subscriber]: tracing::dispatcher#setting-the-default-subscriber
/// [default subscriber]: tracing::dispatch#setting-the-default-collector
/// [`log`]: https://crates.io/log
fn set_default(self) -> dispatch::DefaultGuard {
#[cfg(feature = "tracing-log")]
Expand All @@ -47,7 +47,7 @@ where
/// been set, or if a `log` logger has already been set (when the
/// "tracing-log" feature is enabled).
///
/// [global default subscriber]: tracing::dispatcher#setting-the-default-subscriber
/// [global default subscriber]: tracing::dispatch#setting-the-default-collector
/// [`log`]: https://crates.io/log
fn try_init(self) -> Result<(), TryInitError> {
#[cfg(feature = "tracing-log")]
Expand All @@ -69,7 +69,7 @@ where
/// or if a `log` logger has already been set (when the "tracing-log"
/// feature is enabled).
///
/// [global default subscriber]: tracing::dispatcher#setting-the-default-subscriber
/// [global default subscriber]: tracing::dispatch#setting-the-default-collector
/// [`log`]: https://crates.io/log
fn init(self) {
self.try_init()
Expand Down
1 change: 0 additions & 1 deletion tracing/src/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ where
///
/// [`Span`]: super::span::Span
/// [`Event`]: :../event/struct.Event.html
/// [`DefaultGuard`]: super::dispatcher::DefaultGuard
#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
#[must_use = "Dropping the guard unregisters the collector."]
Expand Down
1 change: 1 addition & 0 deletions tracing/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
//! currently default `Dispatch`. This is used primarily by `tracing`
//! instrumentation.
//!
//! [`Collect`]: tracing_core::Collect
#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub use tracing_core::dispatch::set_default;
Expand Down
4 changes: 2 additions & 2 deletions tracing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
//! # }
//!```
//!
//! The [`span` module][span]'s documentation provides further details on how to
//! The [`span` module][mod@span]'s documentation provides further details on how to
//! use spans.
//!
//! <div class="information">
Expand Down Expand Up @@ -868,7 +868,7 @@
//! [`tracing-timing`]: https://crates.io/crates/tracing-timing
//! [`tracing-appender`]: https://crates.io/crates/tracing-appender
//! [`env_logger`]: https://crates.io/crates/env_logger
//! [`FmtSubscriber`]: tracing_subscriber::fmt::Subscriber
//! [`FmtSubscriber`]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/struct.Subscriber.html
//! [static verbosity level]: level_filters#compile-time-filters
//! [instrument]: tracing_attributes::instrument
//! [flags]: #crate-feature-flags
Expand Down
Loading