Fix links to cargo-doc
authorDebian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Thu, 14 Jul 2022 11:17:39 +0000 (13:17 +0200)
committerFabian Grünbichler <debian@fabian.gruenbichler.email>
Tue, 21 Jan 2025 10:38:15 +0000 (11:38 +0100)
We package cargo docs in a slightly different location; also tweak linkchecker
to not fail these links.

Forwarded: not-needed

Gbp-Pq: Topic build
Gbp-Pq: Name d-bootstrap-cargo-doc-paths.patch

23 files changed:
compiler/rustc_error_codes/src/error_codes/E0460.md
compiler/rustc_error_codes/src/error_codes/E0461.md
compiler/rustc_error_codes/src/error_codes/E0462.md
compiler/rustc_error_codes/src/error_codes/E0514.md
compiler/rustc_error_codes/src/error_codes/E0519.md
src/doc/edition-guide/book.toml
src/doc/edition-guide/src/editions/advanced-migrations.md
src/doc/edition-guide/src/editions/transitioning-an-existing-project-to-a-new-edition.md
src/doc/edition-guide/src/rust-2021/default-cargo-resolver.md
src/doc/index.md
src/doc/reference/src/conditional-compilation.md
src/doc/reference/src/introduction.md
src/doc/reference/src/linkage.md
src/doc/reference/src/procedural-macros.md
src/doc/rustc/src/linker-plugin-lto.md
src/doc/rustc/src/platform-support/fuchsia.md
src/doc/rustc/src/targets/custom.md
src/doc/rustc/src/tests/index.md
src/doc/rustc/src/what-is-rustc.md
src/doc/unstable-book/src/compiler-flags/branch-protection.md
src/doc/unstable-book/src/compiler-flags/control-flow-guard.md
src/doc/unstable-book/src/compiler-flags/sanitizer.md
src/tools/linkchecker/main.rs

index 001678a9bce0625f359d3553c316bcf4fbdd67ce..e8b77bf53f95502c3b3ab4c502aab1137693f54d 100644 (file)
@@ -68,4 +68,4 @@ This error can be fixed by:
  * Recompiling crate `a` so that both crate `b` and `main` have a uniform
    version to depend on.
 
-[Cargo]: ../cargo/index.html
+[Cargo]: ../../../cargo/book/index.html
index 33105c43ccfe7391c48424c4ed6b387370141c7e..088833dd365641e9324ab04fb48729f77c137a65 100644 (file)
@@ -25,6 +25,6 @@ architectures. This issue also extends to any difference in target triples, as
 `std` is operating-system specific.
 
 This error can be fixed by:
- * Using [Cargo](../cargo/index.html), the Rust package manager, automatically
+ * Using [Cargo](../../../cargo/book/index.html), the Rust package manager, automatically
    fixing this issue.
  * Recompiling either crate so that they target a consistent target triple.
index 4509cc6fad2d4e9bde523b81f93778d0eae9652d..b0538b97dbe350947891608b2d2c1ba73810539d 100644 (file)
@@ -26,7 +26,7 @@ prefer `staticlib` for linking with C programs. Learn more about different
 `crate_type`s in [this section of the Reference](../reference/linkage.html).
 
 This error can be fixed by:
- * Using [Cargo](../cargo/index.html), the Rust package manager, automatically
+ * Using [Cargo](../../../cargo/book/index.html), the Rust package manager, automatically
    fixing this issue.
  * Recompiling the crate as a `rlib` or `dylib`; formats suitable for Rust
    linking.
index ce2bbc5c5056c4a3d5748b495b4890c1536c322c..0b2dab8a8a37696ef21d88e704e423e35fcf2903 100644 (file)
@@ -27,7 +27,7 @@ the compiler cannot be sure about *how* to call a function between compiler
 versions, and therefore this error occurs.
 
 This error can be fixed by:
- * Using [Cargo](../cargo/index.html), the Rust package manager and
+ * Using [Cargo](../../../cargo/book/index.html), the Rust package manager and
    [Rustup](https://rust-lang.github.io/rustup/), the Rust toolchain installer,
    automatically fixing this issue.
  * Recompiling the crates with a uniform `rustc` version.
index 12876e2ad75fcc92c34885a567292945b7335e78..09bd221822dd65f161e5f8dce74dd0aebc0a04a7 100644 (file)
@@ -34,7 +34,7 @@ The above example compiles two crates with exactly the same name and
 impossible for the compiler to distinguish between symbols (`pub` item names).
 
 This error can be fixed by:
- * Using [Cargo](../cargo/index.html), the Rust package manager, automatically
+ * Using [Cargo](../../../cargo/book/index.html), the Rust package manager, automatically
    fixing this issue.
  * Recompiling the crate with different metadata (different name/
    `crate_type`).
index 998a81771a2ae5203491a1311702b17d24d41c0e..9ca0dc7fe91ffeb2c724811977d937096f08d421 100644 (file)
@@ -55,15 +55,15 @@ search.use-boolean-and = true
 "/rust-2018/the-compiler/incremental-compilation-for-faster-compiles.html" = "https://blog.rust-lang.org/2018/02/15/Rust-1.24.html#incremental-compilation"
 "/rust-2018/the-compiler/an-attribute-for-deprecation.html" = "../../../reference/attributes/diagnostics.html#the-deprecated-attribute"
 "/rust-2018/rustup-for-managing-rust-versions.html" = "https://rust-lang.github.io/rustup/"
-"/rust-2018/cargo-and-crates-io/index.html" = "../../../cargo/index.html"
-"/rust-2018/cargo-and-crates-io/cargo-check-for-faster-checking.html" = "../../../cargo/commands/cargo-check.html"
-"/rust-2018/cargo-and-crates-io/cargo-install-for-easy-installation-of-tools.html" = "../../../cargo/commands/cargo-install.html"
+"/rust-2018/cargo-and-crates-io/index.html" = "../../../../../cargo/book/index.html"
+"/rust-2018/cargo-and-crates-io/cargo-check-for-faster-checking.html" = "../../../../../cargo/book/commands/cargo-check.html"
+"/rust-2018/cargo-and-crates-io/cargo-install-for-easy-installation-of-tools.html" = "../../../../../cargo/book/commands/cargo-install.html"
 "/rust-2018/cargo-and-crates-io/cargo-new-defaults-to-a-binary-project.html" = "https://blog.rust-lang.org/2018/03/29/Rust-1.25.html#cargo-features"
-"/rust-2018/cargo-and-crates-io/cargo-rustc-for-passing-arbitrary-flags-to-rustc.html" = "../../../cargo/commands/cargo-rustc.html"
-"/rust-2018/cargo-and-crates-io/cargo-workspaces-for-multi-package-projects.html" = "../../../cargo/reference/workspaces.html"
-"/rust-2018/cargo-and-crates-io/multi-file-examples.html" = "../../../cargo/guide/project-layout.html"
-"/rust-2018/cargo-and-crates-io/replacing-dependencies-with-patch.html" = "../../../cargo/reference/overriding-dependencies.html#the-patch-section"
-"/rust-2018/cargo-and-crates-io/cargo-can-use-a-local-registry-replacement.html" = "../../../cargo/reference/source-replacement.html"
+"/rust-2018/cargo-and-crates-io/cargo-rustc-for-passing-arbitrary-flags-to-rustc.html" = "../../../../../cargo/book/commands/cargo-rustc.html"
+"/rust-2018/cargo-and-crates-io/cargo-workspaces-for-multi-package-projects.html" = "../../../../../cargo/book/reference/workspaces.html"
+"/rust-2018/cargo-and-crates-io/multi-file-examples.html" = "../../../../../cargo/book/guide/project-layout.html"
+"/rust-2018/cargo-and-crates-io/replacing-dependencies-with-patch.html" = "../../../../../cargo/book/reference/overriding-dependencies.html#the-patch-section"
+"/rust-2018/cargo-and-crates-io/cargo-can-use-a-local-registry-replacement.html" = "../../../../../cargo/book/reference/source-replacement.html"
 "/rust-2018/cargo-and-crates-io/crates-io-disallows-wildcard-dependencies.html" = "https://blog.rust-lang.org/2016/01/21/Rust-1.6.html#cratesio-disallows-wildcards"
 "/rust-2018/documentation/index.html" = "../../../index.html"
 "/rust-2018/documentation/new-editions-of-the-book.html" = "../../../book/index.html"
@@ -96,4 +96,4 @@ search.use-boolean-and = true
 "/rust-next/future.html" = "../../std/future/trait.Future.html"
 "/rust-next/alloc.html" = "https://blog.rust-lang.org/2019/07/04/Rust-1.36.0.html#the-alloc-crate-is-stable"
 "/rust-next/maybe-uninit.html" = "https://blog.rust-lang.org/2019/07/04/Rust-1.36.0.html#maybeuninitt-instead-of-memuninitialized"
-"/rust-next/cargo-vendor.html" = "../../cargo/commands/cargo-vendor.html"
+"/rust-next/cargo-vendor.html" = "../../../../cargo/book/commands/cargo-vendor.html"
index d2f07b0e2cf9b7826d8de238292719b7da401641..ef52242ce695e8c1801e7afaf58764da6a5182d6 100644 (file)
@@ -186,18 +186,18 @@ Afterwards, the line with `extern crate rand;` in `src/lib.rs` will be removed.
 
 We're now more idiomatic, and we didn't have to fix our code manually!
 
-[`cargo check`]: ../../cargo/commands/cargo-check.html
-[`cargo fix`]: ../../cargo/commands/cargo-fix.html
+[`cargo check`]: ../../../../cargo/book/commands/cargo-check.html
+[`cargo fix`]: ../../../../cargo/book/commands/cargo-fix.html
 [`explicit-outlives-requirements`]:  ../../rustc/lints/listing/allowed-by-default.html#explicit-outlives-requirements
 [`keyword-idents`]: ../../rustc/lints/listing/allowed-by-default.html#keyword-idents
 [`rustfix`]: https://crates.io/crates/rustfix
 [`unused-extern-crates`]: ../../rustc/lints/listing/allowed-by-default.html#unused-extern-crates
-[Cargo features]: ../../cargo/reference/features.html
-[Cargo package]: ../../cargo/reference/manifest.html#the-package-section
-[Cargo targets]: ../../cargo/reference/cargo-targets.html
-[Cargo workspace]: ../../cargo/reference/workspaces.html
+[Cargo features]: ../../../../cargo/book/reference/features.html
+[Cargo package]: ../../../../cargo/book/reference/manifest.html#the-package-section
+[Cargo targets]: ../../../../cargo/book/reference/cargo-targets.html
+[Cargo workspace]: ../../../../cargo/book/reference/workspaces.html
 [CLI flag]: ../../rustc/lints/levels.html#via-compiler-flag
-[Code generation]: ../../cargo/reference/build-script-examples.html#code-generation
+[Code generation]: ../../../../cargo/book/reference/build-script-examples.html#code-generation
 [conditional compilation]: ../../reference/conditional-compilation.html
 [documentation tests]: ../../rustdoc/documentation-tests.html
 [JSON messages]: ../../rustc/json.html
index 9e22504810c2b325f9e640c5f36af001a173f194..5ba0dcc5c4b492c6b7d9fe57be4afd6a99d7289c 100644 (file)
@@ -101,8 +101,8 @@ The steps are roughly similar to the stable channel:
 > on nightly along with more information about their status.
 > A few months before the edition is stabilized, all of the new features should be fully implemented, and the [Rust Blog] will announce a call for testing.
 
-[`cargo fix`]: ../../cargo/commands/cargo-fix.html
-[`cargo test`]: ../../cargo/commands/cargo-test.html
+[`cargo fix`]: ../../../../cargo/book/commands/cargo-fix.html
+[`cargo test`]: ../../../../cargo/book/commands/cargo-test.html
 [Advanced migration strategies]: advanced-migrations.md
 [nightly channel]: ../../book/appendix-07-nightly-rust.html
 [Rust Blog]: https://blog.rust-lang.org/
index 5f6653dcd5476b9b50cb0b1a55f210e9ee9cc461..99332c32a3a9ec03fdf4812e263e6ea180f6fed5 100644 (file)
@@ -21,11 +21,11 @@ The new feature resolver no longer merges all requested features for
 crates that are depended on in multiple ways.
 See [the announcement of Rust 1.51][5] for details.
 
-[4]: ../../cargo/reference/resolver.html#feature-resolver-version-2
+[4]: ../../../../cargo/book/reference/resolver.html#feature-resolver-version-2
 [5]: https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver
-[workspace]: ../../cargo/reference/workspaces.html
-[virtual workspace]: ../../cargo/reference/workspaces.html#virtual-workspace
-[`resolver` field]: ../../cargo/reference/resolver.html#resolver-versions
+[workspace]: ../../../../cargo/book/reference/workspaces.html
+[virtual workspace]: ../../../../cargo/book/reference/workspaces.html#virtual-workspace
+[`resolver` field]: ../../../../cargo/book/reference/resolver.html#resolver-versions
 
 ## Migration
 
@@ -176,4 +176,4 @@ This snippet of output shows that the project `foo` depends on `bar` with the "d
 Then, `bar` depends on `bstr` as a build-dependency with the "default" feature.
 We can further see that `bstr`'s  "default" feature enables "unicode" (among other features).
 
-[`cargo tree`]: ../../cargo/commands/cargo-tree.html
+[`cargo tree`]: ../../../../cargo/book/commands/cargo-tree.html
index 8ad5b427b552ae941b1ea0c92408410c4ac8c854..f93d3da0a707a041ef10fc7a63c075387a72feec 100644 (file)
@@ -128,7 +128,7 @@ historical editions.
 
 ### The Cargo Book
 
-[The Cargo Book](cargo/index.html) is a guide to Cargo, Rust's build tool and
+[The Cargo Book](../../cargo/book/index.html) is a guide to Cargo, Rust's build tool and
 dependency manager.
 
 ### The Rustdoc Book
index 5255bb8d89d3e351a5fbbdf799c46b04f8b98a63..46a477bf6a0718e440a1f756de10554db93592ea 100644 (file)
@@ -483,6 +483,6 @@ println!("I'm running on a {} machine!", machine_kind);
 [`target_feature` attribute]: attributes/codegen.md#the-target_feature-attribute
 [attribute]: attributes.md
 [attributes]: attributes.md
-[cargo-feature]: ../cargo/reference/features.html
+[cargo-feature]: ../../../cargo/book/reference/features.html
 [crate type]: linkage.md
 [static C runtime]: linkage.md#static-and-dynamic-c-runtimes
index 4cd205b1b1546b70d18ed74c9321c77e2cc66a2e..25a7b49a7fa29283d288b98762cfc957db032449 100644 (file)
@@ -137,8 +137,8 @@ We also want the reference to be as normative as possible, so if you see anythin
 [the Rust Reference repository]: https://github.com/rust-lang/reference/
 [Unstable Book]: https://doc.rust-lang.org/nightly/unstable-book/
 [_Expression_]: expressions.md
-[cargo book]: ../cargo/index.html
-[cargo reference]: ../cargo/reference/index.html
+[cargo book]: ../../../cargo/book/index.html
+[cargo reference]: ../../../cargo/book/reference/index.html
 [expressions chapter]: expressions.html
 [file an issue]: https://github.com/rust-lang/reference/issues
 [lifetime of temporaries]: expressions.html#temporaries
index ff41a140f5b64f07f66920a0208b3b17a8d7a8a6..4d1b72e3ae1c02ff8b8f11847efb0949dc8a9f69 100644 (file)
@@ -242,7 +242,7 @@ fn main() {
 }
 ```
 
-[cargo]: ../cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts
+[cargo]: ../../../cargo/book/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts
 
 To use this feature locally, you typically will use the `RUSTFLAGS` environment
 variable to specify flags to the compiler through Cargo. For example to compile
index 0ae6e26d52c03246357a5e081788154b2f98d0c9..e6b61be9fb87ec5c779831a7a4b34b26b8228459 100644 (file)
@@ -381,7 +381,7 @@ Note that neither declarative nor procedural macros support doc comment tokens
 their equivalent `#[doc = r"str"]` attributes when passed to macros.
 
 [Attribute macros]: #attribute-macros
-[Cargo's build scripts]: ../cargo/reference/build-scripts.html
+[Cargo's build scripts]: ../../../cargo/book/reference/build-scripts.html
 [Derive macros]: #derive-macros
 [Function-like macros]: #function-like-procedural-macros
 [`Delimiter::None`]: proc_macro::Delimiter::None
index ab95aa2e5a193d39415361f02c5eccdc9293e8fe..8023f333c0dc97a58606b5dd0fa3ec3fec89feba 100644 (file)
@@ -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](../cargo/reference/config.html#buildrustflags)
+scripts and proc macros), see [cargo docs on rustflags](../../../cargo/book/reference/config.html#buildrustflags)
 
 If you have dependencies using the `cc` crate, you will need to set these
 environment variables:
index 489f46e1cb98d04f8ac3fc66ca6b94f680d914d4..8f299a91bcdc29dfd0779f9778f66b3c03996bbc 100644 (file)
@@ -925,7 +925,7 @@ attach and load any relevant debug symbols.
 [Fuchsia]: https://fuchsia.dev/
 [source tree]: https://fuchsia.dev/fuchsia-src/get-started/learn/build
 [rustup]: https://rustup.rs/
-[cargo]: ../../cargo/index.html
+[cargo]: ../../../../cargo/book/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
index a332d24c9f1fb7db88b270b7c3fa96e522213825..7725514e2f9ed6248f628ea0382e811712b40a60 100644 (file)
@@ -14,7 +14,7 @@ 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](../../cargo/reference/unstable.html#build-std) of `cargo`.
+To use a custom target, see the (unstable) [`build-std` feature](../../../../cargo/book/reference/unstable.html#build-std) of `cargo`.
 
 ## Custom Target Lookup Path
 
index 32baed9c94498bb8864af979b78959c79bfddb85..2c36c1d5d9d13c0650394d03a45f9b5ef7e95e0f 100644 (file)
@@ -301,7 +301,7 @@ Experimental support for using custom test harnesses is available on the
 [`--test` option]: ../command-line-arguments.md#option-test
 [`-Z panic-abort-tests`]: https://github.com/rust-lang/rust/issues/67650
 [`available_parallelism`]: ../../std/thread/fn.available_parallelism.html
-[`cargo test`]: ../../cargo/commands/cargo-test.html
+[`cargo test`]: ../../../../cargo/book/commands/cargo-test.html
 [`libtest`]: ../../test/index.html
 [`main` function]: ../../reference/crates-and-source-files.html#main-functions
 [`Result`]: ../../std/result/index.html
@@ -311,7 +311,7 @@ Experimental support for using custom test harnesses is available on the
 [attribute-should_panic]: ../../reference/attributes/testing.html#the-should_panic-attribute
 [attribute-test]: ../../reference/attributes/testing.html#the-test-attribute
 [bench-docs]: ../../unstable-book/library-features/test.html
-[Cargo]: ../../cargo/index.html
+[Cargo]: ../../../../cargo/book/index.html
 [crate type]: ../../reference/linkage.html
 [custom_test_frameworks documentation]: ../../unstable-book/language-features/custom-test-frameworks.html
 [nightly channel]: ../../book/appendix-07-nightly-rust.html
index 39a05cfe20534f2e2efdafeea18b303d9e9b1adf..7e450ae7fdf854c8da056234b57d68bb91fb87f9 100644 (file)
@@ -5,7 +5,7 @@ language, provided by the project itself. Compilers take your source code and
 produce binary code, either as a library or executable.
 
 Most Rust programmers don't invoke `rustc` directly, but instead do it through
-[Cargo](../cargo/index.html). It's all in service of `rustc` though! If you
+[Cargo](../../../cargo/book/index.html). It's all in service of `rustc` though! If you
 want to see how Cargo calls `rustc`, you can
 
 ```bash
index f0cc44a07f30d82cb3366bfb72bf90c33f42c0dc..bf92669d81866133d8072b73f50a0754a15fb15c 100644 (file)
@@ -20,4 +20,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](../../cargo/reference/unstable.html#build-std) feature.
+[build-std](../../../../cargo/book/reference/unstable.html#build-std) feature.
index dbb741422a87508534ddbb9507a4baba26326c15..73876b0f53b2b9e4252b4ca7010cc3a637b7a7f2 100644 (file)
@@ -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]: ../../cargo/reference/unstable.html#build-std
+[build-std]: ../../../../cargo/book/reference/unstable.html#build-std
 
 For example:
 ```cmd
index 4679acf0a6a15698da4bd03c006d283417ccc719..b6c3eb59e24021f62041070cfa8425edd421e59f 100644 (file)
@@ -882,7 +882,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]: ../../cargo/reference/unstable.html#build-std
+[build-std]: ../../../../cargo/book/reference/unstable.html#build-std
 
 # Working with other languages
 
index abaa1d2d75abcb533f1a8a23b7dbce619356b180..5a90ea4dedec3014fe2a1f7035b433226113b563 100644 (file)
@@ -297,6 +297,10 @@ impl Checker {
                         return;
                     }
                 }
+                if url.contains("../../cargo/book/") {
+                    // link to related cargo-doc, ok for our Debian build
+                    return;
+                }
                 if is_exception(file, &target_pretty_path) {
                     report.links_ignored_exception += 1;
                 } else {