From 9ea3550a269429118d2a875ae9cad2cd0c1da7e3 Mon Sep 17 00:00:00 2001 From: Ezra Shaw Date: Fri, 16 Dec 2022 10:27:03 +1300 Subject: [PATCH] remove relative links from `rustc-book` and `unstable-book` Co-authored-by: Joshua Nelson --- src/doc/rustc/src/exploit-mitigations.md | 12 ++++++------ src/doc/rustc/src/linker-plugin-lto.md | 2 +- src/doc/rustc/src/platform-support/android.md | 2 +- .../src/platform-support/armv6k-nintendo-3ds.md | 2 +- src/doc/rustc/src/platform-support/fuchsia.md | 4 ++-- src/doc/rustc/src/targets/custom.md | 2 +- .../src/compiler-flags/branch-protection.md | 2 +- .../src/compiler-flags/control-flow-guard.md | 2 +- .../unstable-book/src/compiler-flags/sanitizer.md | 6 +++--- .../compiler-flags/virtual-function-elimination.md | 2 +- .../src/language-features/auto-traits.md | 4 ++-- .../src/language-features/unboxed-closures.md | 2 +- .../src/library-features/default-free-fn.md | 2 +- .../unstable-book/src/library-features/fn-traits.md | 2 +- 14 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/doc/rustc/src/exploit-mitigations.md b/src/doc/rustc/src/exploit-mitigations.md index fa38dd54d60..98b49e07171 100644 --- a/src/doc/rustc/src/exploit-mitigations.md +++ b/src/doc/rustc/src/exploit-mitigations.md @@ -217,7 +217,7 @@ It is recommended that explicit wrapping methods such as `wrapping_add` be used when wrapping semantics are intended, and that explicit checking and wrapping methods always be used when using Unsafe Rust. -2\. See +2\. See [the `u32` docs](../std/primitive.u32.html) for more information on the checked, overflowing, saturating, and wrapping methods (using u32 as an example). @@ -575,17 +575,17 @@ defaults (unrelated to `READ_IMPLIES_EXEC`). . 3. S. Klabnik and C. Nichols. “What Is Ownership?.” The Rust Programming - Language. . + Language. [https://doc.rust-lang.org/book/ch04-01-what-is-ownership.html](../book/ch04-01-what-is-ownership.html). 4. S. Klabnik and C. Nichols. “References and Borrowing.” The Rust Programming Language. - . + [https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html](../book/ch04-02-references-and-borrowing.html). 5. S. Klabnik and C. Nichols. “The Slice Type.” The Rust Programming - Language. . + Language. [https://doc.rust-lang.org/book/ch04-03-slices.html](../book/ch04-03-slices.html). 6. S. Klabnik and C. Nichols. “Unsafe Rust.” The Rust Programming Language. - . + [https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html](../book/ch19-01-unsafe-rust.html). 7. S. Davidoff. “How Rust’s standard library was vulnerable for years and nobody noticed.” Medium. @@ -696,4 +696,4 @@ defaults (unrelated to `READ_IMPLIES_EXEC`). for Rust #89653.” GitHub. . 41. “ControlFlowIntegrity.” The Rust Unstable Book. - . + [https://doc.rust-lang.org/unstable-book/compiler-flags/sanitizer.html#controlflowintegrity](../unstable-book/compiler-flags/sanitizer.html#controlflowintegrity). diff --git a/src/doc/rustc/src/linker-plugin-lto.md b/src/doc/rustc/src/linker-plugin-lto.md index 9272b9ac9b2..858b7bc79c4 100644 --- a/src/doc/rustc/src/linker-plugin-lto.md +++ b/src/doc/rustc/src/linker-plugin-lto.md @@ -112,7 +112,7 @@ targeting Windows-like targets This is fixed if you explicitly set the target, for example `cargo build --target x86_64-pc-windows-msvc` Without an explicit --target the flags will be passed to all compiler invocations (including build -scripts and proc macros), see [cargo docs on rustflags](https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags) +scripts and proc macros), see [cargo docs on rustflags](../cargo/reference/config.html#buildrustflags) If you have dependencies using the `cc` crate, you will need to set these environment variables: diff --git a/src/doc/rustc/src/platform-support/android.md b/src/doc/rustc/src/platform-support/android.md index b2c8e5d4df7..e351cfaf89c 100644 --- a/src/doc/rustc/src/platform-support/android.md +++ b/src/doc/rustc/src/platform-support/android.md @@ -42,4 +42,4 @@ edition of the [Android NDK]. Supported Android targets are: [Android NDK]: https://developer.android.com/ndk/downloads A list of all supported targets can be found -[here](https://doc.rust-lang.org/rustc/platform-support.html) +[here](../platform-support.html) diff --git a/src/doc/rustc/src/platform-support/armv6k-nintendo-3ds.md b/src/doc/rustc/src/platform-support/armv6k-nintendo-3ds.md index 215290e3898..2ce0ccb7876 100644 --- a/src/doc/rustc/src/platform-support/armv6k-nintendo-3ds.md +++ b/src/doc/rustc/src/platform-support/armv6k-nintendo-3ds.md @@ -111,7 +111,7 @@ to an SD card to be inserted in the device. The `cargo-3ds` tool mentioned in [Building Rust programs](#building-rust-programs) supports the use of `3dslink` with `cargo 3ds run`. The default Rust test runner is not supported, but -[custom test frameworks](https://doc.rust-lang.org/beta/unstable-book/language-features/custom-test-frameworks.html) +[custom test frameworks](../../unstable-book/language-features/custom-test-frameworks.html) can be used with `cargo 3ds test` to run unit tests on a device. The Rust test suite for `library/std` is not yet supported. diff --git a/src/doc/rustc/src/platform-support/fuchsia.md b/src/doc/rustc/src/platform-support/fuchsia.md index fbf999f9715..cc4ee2e67b1 100644 --- a/src/doc/rustc/src/platform-support/fuchsia.md +++ b/src/doc/rustc/src/platform-support/fuchsia.md @@ -90,7 +90,7 @@ rustup target add aarch64-fuchsia After installing our Fuchsia targets, we can now compile a Rust binary that targets Fuchsia. -To create our Rust project, we can issue a standard `cargo` command as follows: +To create our Rust project, we can use [`cargo`][cargo] as follows: **From base working directory** ```sh @@ -867,7 +867,7 @@ ${SDK_PATH}/tools/${ARCH}/ffx debug connect -- \ [Fuchsia]: https://fuchsia.dev/ [source tree]: https://fuchsia.dev/fuchsia-src/get-started/learn/build [rustup]: https://rustup.rs/ -[cargo]: https://doc.rust-lang.org/cargo/ +[cargo]: ../../cargo/index.html [Fuchsia SDK]: https://chrome-infra-packages.appspot.com/p/fuchsia/sdk/core [overview of CML]: https://fuchsia.dev/fuchsia-src/concepts/components/v2/component_manifests [reference for the file format]: https://fuchsia.dev/reference/cml diff --git a/src/doc/rustc/src/targets/custom.md b/src/doc/rustc/src/targets/custom.md index 27ef2f49eee..a67cb10fc75 100644 --- a/src/doc/rustc/src/targets/custom.md +++ b/src/doc/rustc/src/targets/custom.md @@ -14,4 +14,4 @@ To see it for a different target, add the `--target` flag: rustc +nightly -Z unstable-options --target=wasm32-unknown-unknown --print target-spec-json ``` -To use a custom target, see the (unstable) [`build-std` feature](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std) of `cargo`. +To use a custom target, see the (unstable) [`build-std` feature](../../cargo/reference/unstable.html#build-std) of `cargo`. diff --git a/src/doc/unstable-book/src/compiler-flags/branch-protection.md b/src/doc/unstable-book/src/compiler-flags/branch-protection.md index 85403748e1d..33b1e223c22 100644 --- a/src/doc/unstable-book/src/compiler-flags/branch-protection.md +++ b/src/doc/unstable-book/src/compiler-flags/branch-protection.md @@ -15,4 +15,4 @@ For example, `-Z branch-protection=bti,pac-ret,leaf` is valid, but Rust's standard library does not ship with BTI or pointer authentication enabled by default. In Cargo projects the standard library can be recompiled with pointer authentication using the nightly -[build-std](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std) feature. +[build-std](../../cargo/reference/unstable.html#build-std) feature. diff --git a/src/doc/unstable-book/src/compiler-flags/control-flow-guard.md b/src/doc/unstable-book/src/compiler-flags/control-flow-guard.md index 08c16d95f46..dbb741422a8 100644 --- a/src/doc/unstable-book/src/compiler-flags/control-flow-guard.md +++ b/src/doc/unstable-book/src/compiler-flags/control-flow-guard.md @@ -39,7 +39,7 @@ It is strongly recommended to also enable CFG checks for all linked libraries, i To enable CFG in the standard library, use the [cargo `-Z build-std` functionality][build-std] to recompile the standard library with the same configuration options as the main program. -[build-std]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std +[build-std]: ../../cargo/reference/unstable.html#build-std For example: ```cmd diff --git a/src/doc/unstable-book/src/compiler-flags/sanitizer.md b/src/doc/unstable-book/src/compiler-flags/sanitizer.md index 9bbf9e28fff..a9616c34bff 100644 --- a/src/doc/unstable-book/src/compiler-flags/sanitizer.md +++ b/src/doc/unstable-book/src/compiler-flags/sanitizer.md @@ -420,8 +420,8 @@ flow using an indirect branch/call to a function with different return and parameter types than the return type expected and arguments intended/passed in the call/branch site, the execution is also terminated (see Fig. 9). -[rust-book-ch19-05]: https://doc.rust-lang.org/book/ch19-05-advanced-functions-and-closures.html -[rust-book]: https://doc.rust-lang.org/book/title-page.html +[rust-book-ch19-05]: ../../book/ch19-05-advanced-functions-and-closures.html +[rust-book]: ../../book/title-page.html # HWAddressSanitizer @@ -691,7 +691,7 @@ It is strongly recommended to combine sanitizers with recompiled and instrumented standard library, for example using [cargo `-Zbuild-std` functionality][build-std]. -[build-std]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std +[build-std]: ../../cargo/reference/unstable.html#build-std # Build scripts and procedural macros diff --git a/src/doc/unstable-book/src/compiler-flags/virtual-function-elimination.md b/src/doc/unstable-book/src/compiler-flags/virtual-function-elimination.md index c6516d838dd..5cb9758409a 100644 --- a/src/doc/unstable-book/src/compiler-flags/virtual-function-elimination.md +++ b/src/doc/unstable-book/src/compiler-flags/virtual-function-elimination.md @@ -36,4 +36,4 @@ optimized out, if unused. However, with `make_foo` you can produce a wrapped to inlining of `f`, `Foo::foo` can then be called from a foreign crate. This can lead to miscompilations. -[Clto]: https://doc.rust-lang.org/rustc/codegen-options/index.html#lto +[Clto]: ../../rustc/codegen-options/index.html#lto diff --git a/src/doc/unstable-book/src/language-features/auto-traits.md b/src/doc/unstable-book/src/language-features/auto-traits.md index f967c11fc4d..014e15d1ada 100644 --- a/src/doc/unstable-book/src/language-features/auto-traits.md +++ b/src/doc/unstable-book/src/language-features/auto-traits.md @@ -13,8 +13,8 @@ that are automatically implemented for every type, unless the type, or a type it has explicitly opted out via a negative impl. (Negative impls are separately controlled by the `negative_impls` feature.) -[`Send`]: https://doc.rust-lang.org/std/marker/trait.Send.html -[`Sync`]: https://doc.rust-lang.org/std/marker/trait.Sync.html +[`Send`]: ../../std/marker/trait.Send.html +[`Sync`]: ../../std/marker/trait.Sync.html ```rust,ignore (partial-example) impl !Trait for Type {} diff --git a/src/doc/unstable-book/src/language-features/unboxed-closures.md b/src/doc/unstable-book/src/language-features/unboxed-closures.md index e4113d72d09..3609e7f52f8 100644 --- a/src/doc/unstable-book/src/language-features/unboxed-closures.md +++ b/src/doc/unstable-book/src/language-features/unboxed-closures.md @@ -12,7 +12,7 @@ The `unboxed_closures` feature allows you to write functions using the `"rust-ca required for implementing the [`Fn*`] family of traits. `"rust-call"` functions must have exactly one (non self) argument, a tuple representing the argument list. -[`Fn*`]: https://doc.rust-lang.org/std/ops/trait.Fn.html +[`Fn*`]: ../../std/ops/trait.Fn.html ```rust #![feature(unboxed_closures)] diff --git a/src/doc/unstable-book/src/library-features/default-free-fn.md b/src/doc/unstable-book/src/library-features/default-free-fn.md index d40a27dddf3..bafc9ac4d0d 100644 --- a/src/doc/unstable-book/src/library-features/default-free-fn.md +++ b/src/doc/unstable-book/src/library-features/default-free-fn.md @@ -10,7 +10,7 @@ Adds a free `default()` function to the `std::default` module. This function just forwards to [`Default::default()`], but may remove repetition of the word "default" from the call site. -[`Default::default()`]: https://doc.rust-lang.org/nightly/std/default/trait.Default.html#tymethod.default +[`Default::default()`]: ../../std/default/trait.Default.html#tymethod.default Here is an example: diff --git a/src/doc/unstable-book/src/library-features/fn-traits.md b/src/doc/unstable-book/src/library-features/fn-traits.md index 29a8aecee6c..180184146d1 100644 --- a/src/doc/unstable-book/src/library-features/fn-traits.md +++ b/src/doc/unstable-book/src/library-features/fn-traits.md @@ -11,7 +11,7 @@ See Also: [`unboxed_closures`](../language-features/unboxed-closures.md) The `fn_traits` feature allows for implementation of the [`Fn*`] traits for creating custom closure-like types. -[`Fn*`]: https://doc.rust-lang.org/std/ops/trait.Fn.html +[`Fn*`]: ../../std/ops/trait.Fn.html ```rust #![feature(unboxed_closures)]