Skip to content

Commit d1cbba6

Browse files
committed
Fix rust-docs in CI.
1 parent f79fe53 commit d1cbba6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

ci/azure-install-rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ steps:
55
rustup component remove --toolchain=$TOOLCHAIN rust-docs || echo "already removed"
66
rustup update --no-self-update $TOOLCHAIN
77
if [[ "$TOOLCHAIN" == "nightly"* ]]; then
8-
rustup component add --toolchain=$TOOLCHAIN rustc-dev llvm-tools-preview
8+
rustup component add --toolchain=$TOOLCHAIN rustc-dev llvm-tools-preview rust-docs
99
fi
1010
rustup default $TOOLCHAIN
1111
displayName: Install rust

tests/testsuite/rustdoc_extern_html.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,12 @@ fn std_docs() {
7878
// --extern-html-root-url is unstable
7979
return;
8080
}
81-
if !cargo::util::is_ci() {
82-
// For local developers, skip this test if docs aren't installed.
83-
let docs = std::path::Path::new(&paths::sysroot()).join("share/doc/rust/html");
84-
if !docs.exists() {
81+
// For local developers, skip this test if docs aren't installed.
82+
let docs = std::path::Path::new(&paths::sysroot()).join("share/doc/rust/html");
83+
if !docs.exists() {
84+
if cargo::util::is_ci() {
85+
panic!("std docs are not installed, check that the rust-docs component is installed");
86+
} else {
8587
eprintln!(
8688
"documentation not found at {}, \
8789
skipping test (run `rustdoc component add rust-docs` to install",

0 commit comments

Comments
 (0)