From 4a0b67ab5009d2b23cb414e26da2b374289d8141 Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Tue, 6 Mar 2018 08:09:59 -0800 Subject: [PATCH] Require Rust 0.1.24 or higher. --- Cargo.toml | 2 +- build/version.rs | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9a6a770b..6001e3b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ bundled_sqlite3 = ["rusqlite/bundled"] members = ["tools/cli"] [build-dependencies] -rustc_version = "0.1.7" +rustc_version = "0.2" [dependencies] chrono = "0.4" diff --git a/build/version.rs b/build/version.rs index 6ad73157..66b38976 100644 --- a/build/version.rs +++ b/build/version.rs @@ -12,15 +12,20 @@ extern crate rustc_version; use std::io::{self, Write}; use std::process::exit; -use rustc_version::version_matches; +use rustc_version::{ + Version, + version, +}; /// MIN_VERSION should be changed when there's a new minimum version of rustc required /// to build the project. -static MIN_VERSION: &'static str = ">= 1.17.0"; +static MIN_VERSION: &'static str = "1.24.0"; fn main() { - if !version_matches(MIN_VERSION) { - writeln!(&mut io::stderr(), "Mentat requires rustc {}", MIN_VERSION).unwrap(); + let ver = version().unwrap(); + let min = Version::parse(MIN_VERSION).unwrap(); + if ver < min { + writeln!(&mut io::stderr(), "Mentat requires rustc {} or higher.", MIN_VERSION).unwrap(); exit(1); } }