From 596ea17eae592b68a16a7661bf26c10a5155da89 Mon Sep 17 00:00:00 2001 From: rami3l Date: Tue, 13 Jan 2026 21:05:44 +0100 Subject: [PATCH] fix(build-manifest): enable docs target fallback for `rustc-docs` --- src/tools/build-manifest/src/main.rs | 12 ++++++------ src/tools/build-manifest/src/versions.rs | 5 +---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index 4cec1b1f164b..58f7487a0fda 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -14,11 +14,11 @@ use crate::versions::{PkgType, Versions}; include!(concat!(env!("OUT_DIR"), "/targets.rs")); -/// This allows the manifest to contain rust-docs for hosts that don't build -/// docs. +/// This allows the manifest to contain rust-docs and rustc-docs for hosts +/// that don't build certain docs. /// /// Tuples of `(host_partial, host_instead)`. If the host does not have the -/// rust-docs component available, then if the host name contains +/// corresponding docs component available, then if the host name contains /// `host_partial`, it will use the docs from `host_instead` instead. /// /// The order here matters, more specific entries should be first. @@ -392,9 +392,9 @@ impl Builder { let t = Target::from_compressed_tar(self, &tarball_name!(fallback_target)); // Fallbacks should typically be available on 'production' builds // but may not be available for try builds, which only build one target by - // default. Ideally we'd gate this being a hard error on whether we're in a - // production build or not, but it's not information that's readily available - // here. + // default. It is also possible that `rust-docs` and `rustc-docs` differ in + // availability per target. Thus, we take the first available fallback we can + // find. if !t.available { eprintln!( "{:?} not available for fallback", diff --git a/src/tools/build-manifest/src/versions.rs b/src/tools/build-manifest/src/versions.rs index 6ef8a0e83de3..da887a66d98e 100644 --- a/src/tools/build-manifest/src/versions.rs +++ b/src/tools/build-manifest/src/versions.rs @@ -133,10 +133,7 @@ impl PkgType { /// Whether to package these target-specific docs for another similar target. pub(crate) fn use_docs_fallback(&self) -> bool { - match self { - PkgType::JsonDocs | PkgType::HtmlDocs => true, - _ => false, - } + matches!(self, PkgType::JsonDocs | PkgType::HtmlDocs | PkgType::RustcDocs) } }