Skip to content

Commit 2bb6aaf

Browse files
Merge pull request #697 from Mark-Simulacrum/skip-rustdoc-early
Skip doc build-kind on 1.45.0 and lower versions
2 parents a7c1347 + 597b774 commit 2bb6aaf

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

collector/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ where
9797
Ok(Option::deserialize(deserializer)?.unwrap_or(0.0))
9898
}
9999

100+
pub fn version_supports_doc(version_str: &str) -> bool {
101+
if let Some(version) = version_str.parse::<semver::Version>().ok() {
102+
version >= semver::Version::new(1, 46, 0)
103+
} else {
104+
assert!(version_str.starts_with("beta") || version_str.starts_with("master"));
105+
true
106+
}
107+
}
108+
100109
pub fn version_supports_incremental(version_str: &str) -> bool {
101110
if let Some(version) = version_str.parse::<semver::Version>().ok() {
102111
version >= semver::Version::new(1, 24, 0)

collector/src/main.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,14 @@ fn main_result() -> anyhow::Result<i32> {
646646
} else {
647647
RunKind::all_non_incr()
648648
};
649+
let build_kinds = if collector::version_supports_doc(toolchain) {
650+
BuildKind::all()
651+
} else {
652+
let mut all = BuildKind::all();
653+
let doc = all.iter().position(|bk| *bk == BuildKind::Doc).unwrap();
654+
all.remove(doc);
655+
all
656+
};
649657

650658
let which = |tool| {
651659
String::from_utf8(
@@ -672,7 +680,7 @@ fn main_result() -> anyhow::Result<i32> {
672680
&mut rt,
673681
conn,
674682
&ArtifactId::Artifact(toolchain.to_string()),
675-
&BuildKind::all(),
683+
&build_kinds,
676684
&run_kinds,
677685
Compiler {
678686
rustc: Path::new(rustc.trim()),

0 commit comments

Comments
 (0)