aboutsummaryrefslogtreecommitdiff
path: root/build.rs
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-09 20:36:26 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-09 20:36:26 +0000
commit7348aca8dd386b92e4a540ff8d655145c2012da0 (patch)
tree91380375cadc4e0835f7e031ac39e9a33dce2c13 /build.rs
parent92ed66199eb5b1ef475b309262864e86071a3773 (diff)
parent6e1d8718fc5e3dbc97a6b030204ef46f4e0289dd (diff)
downloadserde_derive-7348aca8dd386b92e4a540ff8d655145c2012da0.tar.gz
Change-Id: I2a1ac929d982f179ab404ac7f82228da77ffbf13
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/build.rs b/build.rs
index 6e1b7b6..d0c827a 100644
--- a/build.rs
+++ b/build.rs
@@ -16,6 +16,12 @@ fn main() {
if minor >= 37 {
println!("cargo:rustc-cfg=underscore_consts");
}
+
+ // The ptr::addr_of! macro stabilized in Rust 1.51:
+ // https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#stabilized-apis
+ if minor >= 51 {
+ println!("cargo:rustc-cfg=ptr_addr_of");
+ }
}
fn rustc_minor_version() -> Option<u32> {