Skip to content
Myr

Merge pull request #2737 from dtolnay/checkcfg

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Resolve unexpected_cfgs warning

authored by David Tolnay · committed by GitHub · parents 20306f4, 220ca0c · Browse files · 7 files+33 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

7 files+33 added−1 removed

  • tests:+0 added−1 removed
  • other:+33 added−0 removed

7 files+33 added−1 removed

modified:serde/build.rs+15 added
11 unmodified lines
12 Some(minor) => minor,13 None => return,14 };1516 if minor >= 77 {17 println!("cargo:rustc-check-cfg=cfg(doc_cfg)");18 println!("cargo:rustc-check-cfg=cfg(no_core_cstr)");19 println!("cargo:rustc-check-cfg=cfg(no_core_num_saturating)");20 println!("cargo:rustc-check-cfg=cfg(no_core_try_from)");21 println!("cargo:rustc-check-cfg=cfg(no_float_copysign)");22 println!("cargo:rustc-check-cfg=cfg(no_num_nonzero_signed)");23 println!("cargo:rustc-check-cfg=cfg(no_relaxed_trait_bounds)");24 println!("cargo:rustc-check-cfg=cfg(no_serde_derive)");25 println!("cargo:rustc-check-cfg=cfg(no_std_atomic)");26 println!("cargo:rustc-check-cfg=cfg(no_std_atomic64)");27 println!("cargo:rustc-check-cfg=cfg(no_systemtime_checked_add)");28 println!("cargo:rustc-check-cfg=cfg(no_target_has_atomic)");29 }3031 let target = env::var("TARGET").unwrap();32 let emscripten = target == "asmjs-unknown-emscripten" || target == "wasm32-unknown-emscripten";3334 // TryFrom, Atomic types, non-zero signed integers, and SystemTime::checked_add
83 unmodified lines
modified:serde_derive/src/lib.rs+1 added
12 unmodified lines
13//!14//! [https://serde.rs/derive.html]: https://serde.rs/derive.html1516#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.200")]17#![cfg_attr(not(check_cfg), allow(unexpected_cfgs))]18// Ignored clippy lints19#![allow(20 // clippy false positive: https://github.com/rust-lang/rust-clippy/issues/705421 clippy::branches_sharing_code,
81 unmodified lines
added:serde_derive/build.rs+7 added
1fn main() {2 // Warning: build.rs is not published to crates.io.34 println!("cargo:rustc-cfg=check_cfg");5 println!("cargo:rustc-check-cfg=cfg(check_cfg)");6 println!("cargo:rustc-check-cfg=cfg(exhaustive)");7}
modified:serde_derive/Cargo.toml+1 added
modified:serde_derive_internals/build.rs+8 added
1use std::path::Path;23fn main() {4 // Warning: build.rs is not published to crates.io.56 println!("cargo:rerun-if-changed=build.rs");7 println!("cargo:rerun-if-changed=src/mod.rs");89 println!("cargo:rustc-cfg=check_cfg");10 println!("cargo:rustc-check-cfg=cfg(check_cfg)");11 println!("cargo:rustc-check-cfg=cfg(exhaustive)");12 println!("cargo:rustc-check-cfg=cfg(serde_build_from_git)");13 println!("cargo:rustc-check-cfg=cfg(feature, values(\"deserialize_in_place\"))");1415 // Sometimes on Windows the git checkout does not correctly wire up the16 // symlink from serde_derive_internals/src to serde_derive/src/internals.17 // When this happens we'll just build based on relative paths within the git18 // repo.
5 unmodified lines
modified:serde_derive_internals/lib.rs+1 added
1#![doc(html_root_url = "https://docs.rs/serde_derive_internals/0.29.0")]2#![cfg_attr(not(check_cfg), allow(unexpected_cfgs))]3// Ignored clippy lints4#![allow(5 clippy::cognitive_complexity,6 // clippy bug: https://github.com/rust-lang/rust-clippy/issues/7575
44 unmodified lines
modified:test_suite/tests/test_de_error.rs-1 removed
1522 unmodified lines
1523 "overflow deserializing SystemTime epoch offset",1524 );1525}15261527#[cfg(not(no_systemtime_checked_add))]1527#[test]1528fn test_systemtime_overflow() {1529 assert_de_tokens_error::<SystemTime>(1530 &[
38 unmodified lines