Skip to content

Commit

Permalink
docs: fix broken and unresolvable links (#595)
Browse files Browse the repository at this point in the history
This commit fixes several RustDoc links which were either broken
(without references) or had unresolvable references.

It looks like nightly RustDoc has recently gotten much smarter about
finding links that were unresolvable. These had always been broken, but
they used to silently 404. Now, the nightly build of RustDoc will emit a
warning, which we deny, causing the build to fail. This should fix CI
(as well as actually fixing the wrong links).

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
  • Loading branch information
hawkw authored Feb 21, 2020
1 parent 30e2cfb commit b8a1d40
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 22 deletions.
11 changes: 7 additions & 4 deletions tracing-core/src/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,16 +477,19 @@ impl Dispatch {
/// `Dispatch` forwards to.
///
/// [`Subscriber`]: ../subscriber/trait.Subscriber.html
/// [`event`]: ../subscriber/trait.Subscriber.html#method.event
/// [`enter`]: ../subscriber/trait.Subscriber.html#method.enter
#[inline]
pub fn enter(&self, span: &span::Id) {
self.subscriber.enter(span);
}

/// Records that a span has been exited.
///
/// This calls the [`exit`](::Subscriber::exit) function on the `Subscriber`
/// that this `Dispatch` forwards to.
/// This calls the [`exit`] function on the [`Subscriber`] that this
/// `Dispatch` forwards to.
///
/// [`Subscriber`]: ../subscriber/trait.Subscriber.html
/// [`exit`]: ../subscriber/trait.Subscriber.html#method.exit
#[inline]
pub fn exit(&self, span: &span::Id) {
self.subscriber.exit(span);
Expand Down Expand Up @@ -526,7 +529,7 @@ impl Dispatch {
///
/// [span ID]: ../span/struct.Id.html
/// [`Subscriber`]: ../subscriber/trait.Subscriber.html
/// [`clone_span`]: ../subscriber/trait.Subscriber.html#method.clone_span
/// [`drop_span`]: ../subscriber/trait.Subscriber.html#method.drop_span
/// [`new_span`]: ../subscriber/trait.Subscriber.html#method.new_span
/// [`try_close`]: #method.try_close
#[inline]
Expand Down
2 changes: 1 addition & 1 deletion tracing-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ extern crate alloc;
///
/// [`Identifier`]: callsite/struct.Identifier.html
/// [`Callsite`]: callsite/trait.Callsite.html
/// [`Callsite`]: callsite/trait.Callsite.html#method.id
/// [`Callsite::id`]: callsite/trait.Callsite.html#method.id
#[macro_export]
macro_rules! identify_callsite {
($callsite:expr) => {
Expand Down
4 changes: 2 additions & 2 deletions tracing-core/src/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,8 @@ impl dyn Subscriber {
/// `Subscriber`s return an `Interest` from their [`register_callsite`] methods
/// in order to determine whether that span should be enabled or disabled.
///
/// [`Subscriber`] ../trait.Subscriber.html
/// [clone_span]: ../trait.Subscriber.html#method.register_callsite
/// [`Subscriber`]: ../trait.Subscriber.html
/// [`register_callsite`]: ../trait.Subscriber.html#method.register_callsite
#[derive(Clone, Debug)]
pub struct Interest(InterestKind);

Expand Down
2 changes: 1 addition & 1 deletion tracing-error/src/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ use tracing::{Metadata, Span};
/// [fields]: https://docs.rs/tracing/latest/tracing/field/index.html
/// [futures]: https://doc.rust-lang.org/std/future/trait.Future.html
/// [`tracing-futures`]: https://docs.rs/tracing-futures/
/// [`with_spans`] method: #method.with_spans.html
/// [`with_spans`]: #method.with_spans
#[derive(Clone)]
pub struct SpanTrace {
span: Span,
Expand Down
3 changes: 2 additions & 1 deletion tracing-error/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
//! [`SpanTrace`]: struct.SpanTrace.html
//! [`ErrorLayer`]: struct.ErrorLayer.html
//! [span]: https://docs.rs/tracing/latest/tracing/span/index.html
//! [event]: https://docs.rs/tracing/latest/tracing/struct.Event.html
//! [events]: https://docs.rs/tracing/latest/tracing/struct.Event.html
//! [`Subscriber`]: https://docs.rs/tracing/latest/tracing/trait.Subscriber.html
//! [subscriber layer]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/layer/trait.Layer.html
//! [`tracing`]: https://docs.rs/tracing
#![doc(html_root_url = "https://docs.rs/tracing-error/0.1.1")]
Expand Down
1 change: 1 addition & 0 deletions tracing-log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
//! [`tracing::Subscriber`]: https://docs.rs/tracing/latest/tracing/trait.Subscriber.html
//! [`Subscriber`]: https://docs.rs/tracing/latest/tracing/trait.Subscriber.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")]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![warn(
Expand Down
8 changes: 6 additions & 2 deletions tracing-log/src/trace_logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
//! [`Subscriber`]: https://docs.rs/tracing/0.1.7/tracing/subscriber/trait.Subscriber.html
//! [`TraceLogger`]: struct.TraceLogger.html
//! [`log::Record`]: https://docs.rs/log/0.4.8/log/struct.Record.html
//! [flags]: https://docs.rs/tracing/0.1.10/tracing/#crate-feature-flags
#![deprecated(since = "0.1.1", note = "use the `tracing` crate's \"log\" feature flag instead")]
//! [flags]: https://docs.rs/tracing/latest/tracing/#crate-feature-flags
#![deprecated(
since = "0.1.1",
note = "use the `tracing` crate's \"log\" feature flag instead"
)]
use crate::AsLog;
use std::{
cell::RefCell,
Expand All @@ -38,6 +41,7 @@ use tracing_core::{
/// flags][flags] on the `tracing` crate should be used instead.
///
/// [`Subscriber`]: https://docs.rs/tracing/0.1.7/tracing/subscriber/trait.Subscriber.html
/// [flags]: https://docs.rs/tracing/latest/tracing/#crate-feature-flags
pub struct TraceLogger {
settings: Builder,
spans: Mutex<HashMap<Id, SpanLineBuilder>>,
Expand Down
5 changes: 4 additions & 1 deletion tracing-subscriber/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,11 @@ impl CurrentSpan {
}
}

/// Returns the [`Id`](::Id) of the span in which the current thread is
/// Returns the [`Id`] of the span in which the current thread is
/// executing, or `None` if it is not inside of a span.
///
///
/// [`Id`]: https://docs.rs/tracing/latest/tracing/span/struct.Id.html
pub fn id(&self) -> Option<Id> {
self.current.with(|current| current.last().cloned())?
}
Expand Down
4 changes: 3 additions & 1 deletion tracing-subscriber/src/registry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ pub struct Parents<'a, R> {
/// An iterator over a span's parents, starting with the root of the trace
/// tree.
///
/// For additonal details, see [`Context::scope`].
/// For additonal details, see [`SpanRef::from_root`].
///
/// [`Span::from_root`]: struct.SpanRef.html#method.from_root
pub struct FromRoot<'a, R: LookupSpan<'a>> {
#[cfg(feature = "smallvec")]
inner: std::iter::Rev<smallvec::IntoIter<SpanRefVecArray<'a, R>>>,
Expand Down
16 changes: 7 additions & 9 deletions tracing/src/span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@
//! Spans are created using the [`span!`] macro. This macro is invoked with the
//! following arguments, in order:
//!
//! - The [`target`] and/or [`parent`](parent) attributes, if the user wishes to override
//! their default values.
//! - The [`target`] and/or [`parent`][parent] attributes, if the user wishes to
//! override their default values.
//! - The span's [verbosity level]
//! - A string literal providing the span's name.
//! - Finally, between zero and 32 arbitrary key/value fields.
//!
//! [parent]: #span-relationships
//! [`target`]: ../struct.Metadata.html#method.target
//!
//! For example:
Expand All @@ -47,12 +46,10 @@
//!
//! The [`Attributes`] type contains data associated with a span, and is
//! provided to the [`Subscriber`] when a new span is created. It contains
//! the span's metadata, the ID of [the span's parent] if one was explicitly set,
//! and any fields whose values were recorded when the span was constructed.
//! The subscriber, which is responsible for recording `tracing` data, can then
//! store or record these values.
//!
//! [the span's parent]: #span-relationships
//! the span's metadata, the ID of [the span's parent][parent] if one was
//! explicitly set, and any fields whose values were recorded when the span was
//! constructed. The subscriber, which is responsible for recording `tracing`
//! data, can then store or record these values.
//!
//! # The Span Lifecycle
//!
Expand Down Expand Up @@ -298,6 +295,7 @@
//! [`in_scope`]: struct.Span.html#method.in_scope
//! [`follows_from`]: struct.Span.html#method.follows_from
//! [guard]: struct.Entered.html
//! [parent]: #span-relationships
pub use tracing_core::span::{Attributes, Id, Record};

use crate::stdlib::{
Expand Down

0 comments on commit b8a1d40

Please sign in to comment.