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"]
|
members = ["tools/cli"]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
rustc_version = "0.1.7"
|
rustc_version = "0.2"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue