File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,13 @@ fn main() {
2727 {
2828 println ! ( "cargo:rustc-cfg=nightly" ) ;
2929 }
30+
31+ let rustc_version = rustc_version:: version ( ) . expect ( "failed to detect rustc version" ) ;
32+ if rustc_version. major == 1 && rustc_version. minor <= 64 {
33+ // Old versions of Rust complain when you have an `unsafe fn` and you use `unsafe {}` inside,
34+ // so for those we want to apply the `#[allow(unused_unsafe)]` attribute to get rid of that warning.
35+ println ! ( "cargo:rustc-cfg=allow_unused_unsafe" ) ;
36+ }
3037}
3138
3239// Deterministic cfg(curve25519_dalek_bits) when this is not explicitly set.
Original file line number Diff line number Diff line change 2020) ]
2121#![ cfg_attr( docsrs, feature( doc_auto_cfg, doc_cfg, doc_cfg_hide) ) ]
2222#![ cfg_attr( docsrs, doc( cfg_hide( docsrs) ) ) ]
23+ #![ cfg_attr( allow_unused_unsafe, allow( unused_unsafe) ) ]
2324//------------------------------------------------------------------------
2425// Documentation:
2526//------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments