Require Rust 0.1.24 or higher.

This commit is contained in:
Richard Newman 2018-03-06 08:09:59 -08:00
parent 9b23cf3945
commit 4a0b67ab50
2 changed files with 10 additions and 5 deletions

View file

@ -23,7 +23,7 @@ bundled_sqlite3 = ["rusqlite/bundled"]
members = ["tools/cli"] members = ["tools/cli"]
[build-dependencies] [build-dependencies]
rustc_version = "0.1.7" rustc_version = "0.2"
[dependencies] [dependencies]
chrono = "0.4" chrono = "0.4"

View file

@ -12,15 +12,20 @@ extern crate rustc_version;
use std::io::{self, Write}; use std::io::{self, Write};
use std::process::exit; 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 /// MIN_VERSION should be changed when there's a new minimum version of rustc required
/// to build the project. /// to build the project.
static MIN_VERSION: &'static str = ">= 1.17.0"; static MIN_VERSION: &'static str = "1.24.0";
fn main() { fn main() {
if !version_matches(MIN_VERSION) { let ver = version().unwrap();
writeln!(&mut io::stderr(), "Mentat requires rustc {}", MIN_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); exit(1);
} }
} }