From 8faa503a6b1a02cd66d2517187b0b501a02a4905 Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Fri, 21 Oct 2016 00:49:47 +0100 Subject: [PATCH] Fix a few links in the docs --- src/libcore/convert.rs | 6 +++--- src/libcore/macros.rs | 7 ++++--- src/libcore/marker.rs | 4 ++-- src/libcore/ops.rs | 6 +++--- src/libstd/error.rs | 4 +++- src/libstd/io/cursor.rs | 4 ++-- src/libstd/path.rs | 1 + 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs index 5f16a4f2435f8..830bbc079ad1e 100644 --- a/src/libcore/convert.rs +++ b/src/libcore/convert.rs @@ -145,7 +145,7 @@ pub trait AsMut { /// /// # Generic Impls /// -/// - `[From][From] for U` implies `Into for T` +/// - [`From`][From]` for U` implies `Into for T` /// - [`into()`] is reflexive, which means that `Into for T` is implemented /// /// [`TryInto`]: trait.TryInto.html @@ -178,14 +178,14 @@ pub trait Into: Sized { /// ``` /// # Generic impls /// -/// - `From for U` implies `[Into] for T` +/// - `From for U` implies [`Into`]` for T` /// - [`from()`] is reflexive, which means that `From for T` is implemented /// /// [`TryFrom`]: trait.TryFrom.html /// [`Option`]: ../../std/option/enum.Option.html /// [`Result`]: ../../std/result/enum.Result.html /// [`String`]: ../../std/string/struct.String.html -/// [Into]: trait.Into.html +/// [`Into`]: trait.Into.html /// [`from()`]: trait.From.html#tymethod.from #[stable(feature = "rust1", since = "1.0.0")] pub trait From: Sized { diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index 6e08abd346143..d5b65d27a5a84 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -42,12 +42,13 @@ macro_rules! panic { /// Unsafe code relies on `assert!` to enforce run-time invariants that, if /// violated could lead to unsafety. /// -/// Other use-cases of `assert!` include -/// [testing](https://doc.rust-lang.org/book/testing.html) and enforcing -/// run-time invariants in safe code (whose violation cannot result in unsafety). +/// Other use-cases of `assert!` include [testing] and enforcing run-time +/// invariants in safe code (whose violation cannot result in unsafety). /// /// This macro has a second version, where a custom panic message can be provided. /// +/// [testing]: ../book/testing.html +/// /// # Examples /// /// ``` diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index 03d8af1563d6d..bdb0dd8e7d1a9 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -241,8 +241,8 @@ pub trait Unsize { /// compile-time error. Specifically, with structs you'll get [E0204] and with enums you'll get /// [E0205]. /// -/// [E0204]: https://doc.rust-lang.org/error-index.html#E0204 -/// [E0205]: https://doc.rust-lang.org/error-index.html#E0205 +/// [E0204]: ../../error-index.html#E0204 +/// [E0205]: ../../error-index.html#E0205 /// /// ## When *should* my type be `Copy`? /// diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index 72e951a7c347c..0349f113762eb 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -182,11 +182,11 @@ pub trait Drop { /// After this function is over, the memory of `self` will be deallocated. /// /// This function cannot be called explicitly. This is compiler error - /// [0040]. However, the [`std::mem::drop`] function in the prelude can be + /// [E0040]. However, the [`std::mem::drop`] function in the prelude can be /// used to call the argument's `Drop` implementation. /// - /// [0040]: https://doc.rust-lang.org/error-index.html#E0040 - /// [`std::mem::drop`]: https://doc.rust-lang.org/std/mem/fn.drop.html + /// [E0040]: ../../error-index.html#E0040 + /// [`std::mem::drop`]: ../../std/mem/fn.drop.html /// /// # Panics /// diff --git a/src/libstd/error.rs b/src/libstd/error.rs index a1909b0f95789..454fa47cfbc99 100644 --- a/src/libstd/error.rs +++ b/src/libstd/error.rs @@ -69,7 +69,9 @@ pub trait Error: Debug + Display { /// It should not contain newlines or sentence-ending punctuation, /// to facilitate embedding in larger user-facing strings. /// For showing formatted error messages with more information see - /// [Display](https://doc.rust-lang.org/std/fmt/trait.Display.html). + /// [`Display`]. + /// + /// [`Display`]: ../fmt/trait.Display.html /// /// # Examples /// diff --git a/src/libstd/io/cursor.rs b/src/libstd/io/cursor.rs index ca9452ffe3eca..1fed061292b8e 100644 --- a/src/libstd/io/cursor.rs +++ b/src/libstd/io/cursor.rs @@ -23,7 +23,7 @@ use io::{self, SeekFrom, Error, ErrorKind}; /// /// The standard library implements some I/O traits on various types which /// are commonly used as a buffer, like `Cursor<`[`Vec`]`>` and -/// `Cursor<`[`&[u8]`]`>`. +/// `Cursor<`[`&[u8]`][bytes]`>`. /// /// # Examples /// @@ -35,7 +35,7 @@ use io::{self, SeekFrom, Error, ErrorKind}; /// [`Read`]: ../../std/io/trait.Read.html /// [`Write`]: ../../std/io/trait.Write.html /// [`Vec`]: ../../std/vec/struct.Vec.html -/// [`&[u8]`]: ../../std/primitive.slice.html +/// [bytes]: ../../std/primitive.slice.html /// [`File`]: ../fs/struct.File.html /// /// ```no_run diff --git a/src/libstd/path.rs b/src/libstd/path.rs index d6a5dfe551800..34d1ed9e00a3f 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -914,6 +914,7 @@ impl<'a> cmp::Ord for Components<'a> { /// [`Path`]: struct.Path.html /// [`push`]: struct.PathBuf.html#method.push /// [`set_extension`]: struct.PathBuf.html#method.set_extension +/// [`Deref`]: ../ops/trait.Deref.html /// /// More details about the overall approach can be found in /// the module documentation.