diff --git a/contrib/run_task.sh b/contrib/run_task.sh index 105dd0cc..f7aa21ac 100755 --- a/contrib/run_task.sh +++ b/contrib/run_task.sh @@ -148,8 +148,10 @@ loop_features() { # Lint the workspace then the individual crate examples. do_lint() { + need_nightly + # Use the current (recent/minimal) lock file. - local cargo="cargo +nightly --locked" + local cargo="cargo --locked" $cargo clippy --workspace -- -D warnings @@ -181,7 +183,8 @@ do_dup_deps() { # Build the docs with a nightly toolchain, in unison with the function # below this checks that we feature guarded docs imports correctly. build_docs_with_nightly_toolchain() { - local cargo="cargo +nightly --locked" + need_nightly + local cargo="cargo --locked" RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" $cargo doc --all-features } @@ -242,6 +245,13 @@ need_cmd() { fi } +need_nightly() { + cargo_ver=$(cargo --version) + if echo "$cargo_ver" | grep -q -v nightly; then + err "Need a nightly compiler; have $(cargo --version)" + fi +} + err() { echo "$1" >&2 exit 1