rust: Gate new lint on Rust version The `unnecessary_transmutes` lint was added in Rust 1.88 and will warn when used unconditionally with prior Rust releases. This can break the build when downstream users treat warnings as errors (even if they shouldn't). Enabling this lint on Rust versions that supports it avoids triggering any new warnings or errors. Test: build bssl-sys with Rust 1.87 and 1.88; verify lack of warnings Change-Id: Id038e359a763dc608cd389a90829dc035d9232d3 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/80707 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/rust/bssl-sys/src/lib.rs b/rust/bssl-sys/src/lib.rs index 3502a69..c306e7a 100644 --- a/rust/bssl-sys/src/lib.rs +++ b/rust/bssl-sys/src/lib.rs
@@ -4,6 +4,8 @@ #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![allow(unnecessary_transmutes)] +#![feature(cfg_version)] +#![cfg_attr(version("1.88"), allow(unnecessary_transmutes))] use core::ffi::c_ulong;