Skip to content

Commit c7e2864

Browse files
authored
Rollup merge of #151080 - dist/rustc-docs-target-fallback, r=clubby789
fix(build-manifest): enable docs target fallback for `rustc-docs`
2 parents 9b37157 + 596ea17 commit c7e2864

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

src/tools/build-manifest/src/main.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ use crate::versions::{PkgType, Versions};
1414

1515
include!(concat!(env!("OUT_DIR"), "/targets.rs"));
1616

17-
/// This allows the manifest to contain rust-docs for hosts that don't build
18-
/// docs.
17+
/// This allows the manifest to contain rust-docs and rustc-docs for hosts
18+
/// that don't build certain docs.
1919
///
2020
/// Tuples of `(host_partial, host_instead)`. If the host does not have the
21-
/// rust-docs component available, then if the host name contains
21+
/// corresponding docs component available, then if the host name contains
2222
/// `host_partial`, it will use the docs from `host_instead` instead.
2323
///
2424
/// The order here matters, more specific entries should be first.
@@ -392,9 +392,9 @@ impl Builder {
392392
let t = Target::from_compressed_tar(self, &tarball_name!(fallback_target));
393393
// Fallbacks should typically be available on 'production' builds
394394
// but may not be available for try builds, which only build one target by
395-
// default. Ideally we'd gate this being a hard error on whether we're in a
396-
// production build or not, but it's not information that's readily available
397-
// here.
395+
// default. It is also possible that `rust-docs` and `rustc-docs` differ in
396+
// availability per target. Thus, we take the first available fallback we can
397+
// find.
398398
if !t.available {
399399
eprintln!(
400400
"{:?} not available for fallback",

src/tools/build-manifest/src/versions.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,7 @@ impl PkgType {
133133

134134
/// Whether to package these target-specific docs for another similar target.
135135
pub(crate) fn use_docs_fallback(&self) -> bool {
136-
match self {
137-
PkgType::JsonDocs | PkgType::HtmlDocs => true,
138-
_ => false,
139-
}
136+
matches!(self, PkgType::JsonDocs | PkgType::HtmlDocs | PkgType::RustcDocs)
140137
}
141138
}
142139

0 commit comments

Comments
 (0)