From 3f87b16d759e91386371ef0eb61df9a372ea8fec Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Mon, 19 Jun 2017 22:58:31 -0700 Subject: [PATCH] Update minimum nightly to '2017-06-19'. --- codegen/build.rs | 2 +- lib/build.rs | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/codegen/build.rs b/codegen/build.rs index ac0deddf..2fffad76 100644 --- a/codegen/build.rs +++ b/codegen/build.rs @@ -8,7 +8,7 @@ use yansi::Color::{Red, Yellow, Blue, White}; use version_check::{supports_features, is_min_version, is_min_date}; // Specifies the minimum nightly version needed to compile Rocket's codegen. -const MIN_DATE: &'static str = "2017-06-01"; +const MIN_DATE: &'static str = "2017-06-19"; const MIN_VERSION: &'static str = "1.19.0-nightly"; // Convenience macro for writing to stderr. diff --git a/lib/build.rs b/lib/build.rs index 726b3e97..b1e48ed0 100644 --- a/lib/build.rs +++ b/lib/build.rs @@ -5,9 +5,10 @@ extern crate yansi; extern crate version_check; use yansi::Color::{Red, Yellow, Blue, White}; -use version_check::{supports_features, is_min_version}; +use version_check::{supports_features, is_min_version, is_min_date}; // Specifies the minimum nightly version needed to compile Rocket. +const MIN_DATE: &'static str = "2017-06-19"; const MIN_VERSION: &'static str = "1.19.0-nightly"; // Convenience macro for writing to stderr. @@ -20,21 +21,25 @@ macro_rules! printerr { } fn main() { - let (ok_channel, ok_version) = (supports_features(), is_min_version(MIN_VERSION)); - let print_version_err = |version: &str| { + let ok_channel = supports_features(); + let ok_version = is_min_version(MIN_VERSION); + let ok_date = is_min_date(MIN_DATE); + let triple = (ok_channel, ok_version, ok_date); + + let print_version_err = |version: &str, date: &str| { printerr!("{} {}. {} {}.", White.paint("Installed version is:"), - Yellow.paint(version), + Yellow.paint(format!("{} ({})", version, date)), White.paint("Minimum required:"), - Yellow.paint(MIN_VERSION)); + Yellow.paint(format!("{} ({})", MIN_VERSION, MIN_DATE))); }; - if let (Some(ok_channel), Some((ok_version, version))) = (ok_channel, ok_version) { + if let (Some(ok_channel), Some((ok_version, version)), Some((ok_date, date))) = triple { if !ok_channel { printerr!("{} {}", Red.paint("Error:").bold(), White.paint("Rocket requires a nightly or dev version of Rust.")); - print_version_err(&*version); + print_version_err(&*version, &*date); printerr!("{}{}{}", Blue.paint("See the getting started guide ("), White.paint("https://rocket.rs/guide/getting-started/"), @@ -42,15 +47,15 @@ fn main() { panic!("Aborting compilation due to incompatible compiler.") } - if !ok_version { + if !ok_version || !ok_date { printerr!("{} {}", Red.paint("Error:").bold(), - White.paint("Rocket requires a newer version of rustc.")); + White.paint("Rocket requires a more recent version of rustc.")); printerr!("{}{}{}", Blue.paint("Use `"), White.paint("rustup update"), Blue.paint("` or your preferred method to update Rust.")); - print_version_err(&*version); + print_version_err(&*version, &*date); panic!("Aborting compilation due to incompatible compiler.") } } else {