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>
Wed, 20 Sep 2023 18:18:40 +0000 (19:18 +0100)
We package cargo docs in a slightly different location; also tweak linkchecker
to not fail these links.

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..6713c4bf8a617fe618a9a2e4813d953a20b3a9aa 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-doc/doc/index.html
index 33105c43ccfe7391c48424c4ed6b387370141c7e..c55efff8c9b757ae0c8d43ece387237f57b4fe70 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-doc/doc/index.html), the Rust package manager, automatically
    fixing this issue.
  * Recompiling either crate so that they target a consistent target triple.
index 4509cc6fad2d4e9bde523b81f93778d0eae9652d..1817e6155000407b9a6b7dd22c1655cbc25a8ca5 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-doc/doc/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..bb497cce573cb837fe5875a38a972d932055b291 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-doc/doc/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..a9cc906c4473c7a4ba572468e32037b8158b885e 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-doc/doc/index.html), the Rust package manager, automatically
    fixing this issue.
  * Recompiling the crate with different metadata (different name/
    `crate_type`).
index 7841b647d26b6ccfdd43a4950543b0f37c75f92a..e3827ec78730f573bed720fcf9310d76399719ca 100644 (file)
@@ -53,15 +53,15 @@ git-repository-url = "https://github.com/rust-lang/edition-guide"
 "/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-doc/doc/index.html"
+"/rust-2018/cargo-and-crates-io/cargo-check-for-faster-checking.html" = "../../../../cargo-doc/doc/commands/cargo-check.html"
+"/rust-2018/cargo-and-crates-io/cargo-install-for-easy-installation-of-tools.html" = "../../../../cargo-doc/doc/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-doc/doc/commands/cargo-rustc.html"
+"/rust-2018/cargo-and-crates-io/cargo-workspaces-for-multi-package-projects.html" = "../../../../cargo-doc/doc/reference/workspaces.html"
+"/rust-2018/cargo-and-crates-io/multi-file-examples.html" = "../../../../cargo-doc/doc/guide/project-layout.html"
+"/rust-2018/cargo-and-crates-io/replacing-dependencies-with-patch.html" = "../../../../cargo-doc/doc/reference/overriding-dependencies.html#the-patch-section"
+"/rust-2018/cargo-and-crates-io/cargo-can-use-a-local-registry-replacement.html" = "../../../../cargo-doc/doc/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"
@@ -93,4 +93,4 @@ git-repository-url = "https://github.com/rust-lang/edition-guide"
 "/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-doc/doc/commands/cargo-vendor.html"
index b804ae64410e26efa0eeeccfbf283855c7048a0c..b8136d7165ec172dcce9cc716345f1f91f8953bd 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-doc/doc/commands/cargo-check.html
+[`cargo fix`]: ../../../cargo-doc/doc/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://github.com/rust-lang/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-doc/doc/reference/features.html
+[Cargo package]: ../../../cargo-doc/doc/reference/manifest.html#the-package-section
+[Cargo targets]: ../../../cargo-doc/doc/reference/cargo-targets.html
+[Cargo workspace]: ../../../cargo-doc/doc/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-doc/doc/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 434352943b18f08b96433f43f5b1cac475aeee76..7f7f0b6164cfd2950c04e01331365699d3c47527 100644 (file)
@@ -83,7 +83,7 @@ If new warnings are issued, you may want to consider running `cargo fix` again (
 
 Congrats! Your code is now valid in both Rust 2015 and Rust 2018!
 
-[`cargo fix`]: ../../cargo/commands/cargo-fix.html
-[`cargo test`]: ../../cargo/commands/cargo-test.html
+[`cargo fix`]: ../../../cargo-doc/doc/commands/cargo-fix.html
+[`cargo test`]: ../../../cargo-doc/doc/commands/cargo-test.html
 [Advanced migration strategies]: advanced-migrations.md
 [nightly channel]: ../../book/appendix-07-nightly-rust.html
index 9abc5a6089e791a21daec14b4001568c289e8991..dff04a4acb0cba79864805c26c8edba085cfe484 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-doc/doc/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-manifest
-[`resolver` field]: ../../cargo/reference/resolver.html#resolver-versions
+[workspace]: ../../../cargo-doc/doc/reference/workspaces.html
+[virtual workspace]: ../../../cargo-doc/doc/reference/workspaces.html#virtual-manifest
+[`resolver` field]: ../../../cargo-doc/doc/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-doc/doc/commands/cargo-tree.html
index 7c97c16c20bdc0350bee6f8313837972a8126dbe..1d721f146a734c2672908f2ffcf0f213e8a87aa3 100644 (file)
@@ -130,7 +130,7 @@ their differences.
 
 ### The Cargo Book
 
-[The Cargo Book](cargo/index.html) is a guide to Cargo, Rust's build tool and
+[The Cargo Book](../../cargo-doc/doc/index.html) is a guide to Cargo, Rust's build tool and
 dependency manager.
 
 ### The Rustdoc Book
index 97840e4f66916c8676e711c739632f64c11c83c0..4de9df93df363560e7283f9a9c36786231c23dd6 100644 (file)
@@ -370,6 +370,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-doc/doc/reference/features.html
 [crate type]: linkage.md
 [static C runtime]: linkage.md#static-and-dynamic-c-runtimes
index 9038efd8d57e4931d2b5a797e6e6dc36d04c6ffd..dbfbd39ea183151920f9105abf9082d80c90522f 100644 (file)
@@ -135,8 +135,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-doc/doc/index.html
+[cargo reference]: ../../cargo-doc/doc/reference/index.html
 [expressions chapter]: expressions.html
 [file an issue]: https://github.com/rust-lang/reference/issues
 [lifetime of temporaries]: expressions.html#temporaries
index 82864b004d2ee4430e25e41c2df9cbba87351f73..0d0bbd35d77d6347944dd9a9c709c5a926903ac0 100644 (file)
@@ -201,7 +201,7 @@ fn main() {
 }
 ```
 
-[cargo]: ../cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts
+[cargo]: ../../cargo-doc/doc/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 31f029a633ba86841c69d412e278d741ec07c63d..cc495b38a951c989c2ea70bb2bd3e71c12578d1a 100644 (file)
@@ -331,7 +331,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-doc/doc/reference/build-scripts.html
 [Derive macros]: #derive-macros
 [Function-like macros]: #function-like-procedural-macros
 [`Delimiter::None`]: ../proc_macro/enum.Delimiter.html#variant.None
index 858b7bc79c4c86f12e9b82a0008b285319ab7bb8..bb898612de977b334eb11dd656004dfebbf645fe 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-doc/doc/reference/config.html#buildrustflags)
 
 If you have dependencies using the `cc` crate, you will need to set these
 environment variables:
index 4d97b8c6cb90b4d7c144a04498803cffe579ece9..f068a9bc2c57c2bdbe9d2630ee176779710b5177 100644 (file)
@@ -932,7 +932,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-doc/doc/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 a67cb10fc75a8b8b9d277ab50f7b4cb6acd52cd1..a2786948fbfab88e2811b435c0d83e31dbf687b8 100644 (file)
@@ -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](../../cargo/reference/unstable.html#build-std) of `cargo`.
+To use a custom target, see the (unstable) [`build-std` feature](../../../cargo-doc/doc/reference/unstable.html#build-std) of `cargo`.
index 32baed9c94498bb8864af979b78959c79bfddb85..53c97f8cda18feeee043e89a1dd7c5bee4368ad4 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-doc/doc/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-doc/doc/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..d10698685cf470b763f93d7f846cc34243f7b5fa 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-doc/doc/index.html). It's all in service of `rustc` though! If you
 want to see how Cargo calls `rustc`, you can
 
 ```bash
index ca5664835f26fbf55a8b5b352c67da799f82806a..09f0296058cdec8fc40ad3b10bf1046aa74222d6 100644 (file)
@@ -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](../../cargo/reference/unstable.html#build-std) feature.
+[build-std](../../../cargo-doc/doc/reference/unstable.html#build-std) feature.
index dbb741422a87508534ddbb9507a4baba26326c15..c6a563e9cbaa6f0e4a0dab26e7f2170d13c28154 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-doc/doc/reference/unstable.html#build-std
 
 For example:
 ```cmd
index b55348b7889c520fcb1545708739e7e3004e2338..1d7284fc20a3276a6a8cd05537295fea0d6a9b12 100644 (file)
@@ -709,7 +709,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-doc/doc/reference/unstable.html#build-std
 
 # Build scripts and procedural macros
 
index d7dcda7fa1ba86af2e9a2162f83eb960ca282686..6a1d0a63f65afed189538af89df1cfd722589a6f 100644 (file)
@@ -262,6 +262,12 @@ impl Checker {
                             return;
                         }
                     }
+                    if let Some(path_str) = path.to_str() {
+                        if path_str.contains("/cargo-doc/doc/") {
+                            // link to related cargo-doc, ok for our Debian build
+                            return;
+                        }
+                    }
                     if is_exception(file, &target_pretty_path) {
                         report.links_ignored_exception += 1;
                     } else {