Skip to content

Commit

Permalink
Add a check for a minimum rustc version in ff
Browse files Browse the repository at this point in the history
  • Loading branch information
huitseeker committed Mar 27, 2021
1 parent 61bd807 commit 92f9fe9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ff/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extern crate rustc_version;
use rustc_version::{version_meta, Channel};
use rustc_version::{version_meta, version, Version, Channel};

fn main() {
println!("cargo:rerun-if-changed=build.rs");
Expand All @@ -15,4 +15,9 @@ fn main() {
if should_use_asm {
println!("cargo:rustc-cfg=use_asm");
}

// TODO: remove this once RFC 2495 ships
if version().expect("Installed rustc version unparseable!") < Version::parse("1.51.0").unwrap() {
panic!("This code base uses const generics and requires a Rust compiler version greater or equal to 1.51.0");
}
}

0 comments on commit 92f9fe9

Please sign in to comment.