Require Rust 0.1.24 or higher.
This commit is contained in:
parent
9b23cf3945
commit
4a0b67ab50
2 changed files with 10 additions and 5 deletions
|
@ -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"
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue