Skip to content

Commit

Permalink
Update minimum rustc to 1.46.
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioBenitez committed Oct 22, 2020
1 parent bbfe2ba commit 17fd7f4
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions core/lib/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,15 @@
use yansi::{Paint, Color::{Red, Yellow}};

const MIN_VERSION: &'static str = "1.45.0";

macro_rules! err {
($version:expr, $msg:expr) => (
eprintln!("{} {}", Red.paint("Error:").bold(), Paint::new($msg).bold());
eprintln!("Installed version: {}", Yellow.paint(format!("{}", $version)));
eprintln!("Minimum required: {}", Yellow.paint(format!("{}", MIN_VERSION)));
)
}

fn main() {
const MIN_VERSION: &'static str = "1.46.0";

if let Some(version) = version_check::Version::read() {
if !version.at_least(MIN_VERSION) {
err!(version, "Rocket requires a more recent version of rustc.");
let msg = "Rocket requires a more recent version of rustc.";
eprintln!("{} {}", Red.paint("Error:").bold(), Paint::new(msg).bold());
eprintln!("Installed version: {}", Yellow.paint(format!("{}", version)));
eprintln!("Minimum required: {}", Yellow.paint(format!("{}", MIN_VERSION)));
panic!("Aborting compilation due to incompatible compiler.")
}
} else {
Expand Down

0 comments on commit 17fd7f4

Please sign in to comment.