From 4cd30557809ac3107e9f0107695065779447a65a Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Thu, 16 Jun 2022 09:27:40 +0200 Subject: [PATCH] Bump minimum rustc toolchain --- Cargo.toml | 1 + src/main.rs | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2d3d060..7ac54bd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ edition = "2021" [dependencies] cargo_metadata = "0.14.0" rustc_version = "0.4.0" +semver = "1.0.10" serde = "1.0.111" serde_derive = "1.0.111" tee = "0.1.0" diff --git a/src/main.rs b/src/main.rs index b685d14..930f607 100644 --- a/src/main.rs +++ b/src/main.rs @@ -55,11 +55,11 @@ impl fmt::Display for CommitDate { } const MINIMUM_COMMIT_DATE: CommitDate = CommitDate { - year: 2021, - month: 10, - day: 1, + year: 2022, + month: 6, + day: 15, }; -const MINIMUM_RUSTC_VERSION: Version = Version::new(1, 56, 0); +const MINIMUM_RUSTC_VERSION: Version = Version::new(1, 63, 0); fn main() { check_rust_version(); @@ -307,8 +307,12 @@ fn check_rust_version() { process::exit(1); } - let old_version: bool = MINIMUM_RUSTC_VERSION > rustc_version.semver; - + let old_version = MINIMUM_RUSTC_VERSION > Version { + // Remove `-nightly` pre-release tag for comparison. + pre: semver::Prerelease::EMPTY, + ..rustc_version.semver.clone() + }; + let old_commit = match rustc_version.commit_date { None => false, Some(date) => {