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 28, 2021
1 parent 61bd807 commit c4a6d6c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 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, version_meta, Channel, Version};

fn main() {
println!("cargo:rerun-if-changed=build.rs");
Expand All @@ -15,4 +15,10 @@ 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 c4a6d6c

Please sign in to comment.