From 3bd58e3c899457c2d55c45268dcb8a65ae682d54 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Mon, 31 Jul 2023 10:51:40 +0200 Subject: [PATCH] ci: Use same nightly toolchain for docs that's used for other jobs --- xtask/src/ci.rs | 4 +--- xtask/src/doc.rs | 4 ++-- xtask/src/main.rs | 3 +++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/xtask/src/ci.rs b/xtask/src/ci.rs index 16031c49..62393655 100644 --- a/xtask/src/ci.rs +++ b/xtask/src/ci.rs @@ -6,15 +6,13 @@ use std::path::PathBuf; use clap::{Args, Subcommand}; use xshell::pushd; -use crate::{cmd, Metadata, Result}; +use crate::{cmd, Metadata, Result, NIGHTLY}; mod spec_links; use spec_links::check_spec_links; const MSRV: &str = "1.65"; -// Keep in sync with version in `rust-toolchain.toml` and `.github/workflows/ci.yml` -const NIGHTLY: &str = "nightly-2023-07-03"; #[derive(Args)] pub struct CiArgs { diff --git a/xtask/src/doc.rs b/xtask/src/doc.rs index 1e6bc36e..acc8328a 100644 --- a/xtask/src/doc.rs +++ b/xtask/src/doc.rs @@ -1,6 +1,6 @@ use clap::Args; -use crate::{cmd, Result}; +use crate::{cmd, Result, NIGHTLY}; #[derive(Args)] pub struct DocTask { @@ -20,7 +20,7 @@ impl DocTask { rustdocflags += " -Dwarnings"; } - let mut cmd = cmd!("rustup run nightly cargo doc --all-features --no-deps") + let mut cmd = cmd!("rustup run {NIGHTLY} cargo doc --all-features --no-deps") .env("RUSTDOCFLAGS", rustdocflags); if self.open { diff --git a/xtask/src/main.rs b/xtask/src/main.rs index d21a847f..0226bbb5 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -14,6 +14,9 @@ use clap::{Parser, Subcommand}; use serde::Deserialize; use serde_json::from_str as from_json_str; +// Keep in sync with version in `rust-toolchain.toml` and `.github/workflows/ci.yml` +const NIGHTLY: &str = "nightly-2023-07-03"; + #[cfg(feature = "default")] mod cargo; mod ci;