mirror of
https://github.com/saymrwulf/risc0-curve25519-dalek-source.git
synced 2026-09-04 20:03:40 +00:00
Get rid of the unused_unsafe warning on old versions of Rust.
This commit is contained in:
parent
996b1e9077
commit
738cfee020
2 changed files with 8 additions and 0 deletions
7
build.rs
7
build.rs
|
|
@ -27,6 +27,13 @@ fn main() {
|
|||
{
|
||||
println!("cargo:rustc-cfg=nightly");
|
||||
}
|
||||
|
||||
let rustc_version = rustc_version::version().expect("failed to detect rustc version");
|
||||
if rustc_version.major == 1 && rustc_version.minor <= 64 {
|
||||
// Old versions of Rust complain when you have an `unsafe fn` and you use `unsafe {}` inside,
|
||||
// so for those we want to apply the `#[allow(unused_unsafe)]` attribute to get rid of that warning.
|
||||
println!("cargo:rustc-cfg=allow_unused_unsafe");
|
||||
}
|
||||
}
|
||||
|
||||
// Deterministic cfg(curve25519_dalek_bits) when this is not explicitly set.
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
)]
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg, doc_cfg_hide))]
|
||||
#![cfg_attr(docsrs, doc(cfg_hide(docsrs)))]
|
||||
#![cfg_attr(allow_unused_unsafe, allow(unused_unsafe))]
|
||||
//------------------------------------------------------------------------
|
||||
// Documentation:
|
||||
//------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue