Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invert build.rs cfgs in serde_test #2253

Merged
merged 1 commit into from Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions serde_test/build.rs
Expand Up @@ -13,8 +13,8 @@ fn main() {

// #[track_caller] stabilized in Rust 1.46:
// https://blog.rust-lang.org/2020/08/27/Rust-1.46.0.html#track_caller
if minor >= 46 {
println!("cargo:rustc-cfg=track_caller");
if minor < 46 {
println!("cargo:rustc-cfg=no_track_caller");
}
}

Expand Down
10 changes: 5 additions & 5 deletions serde_test/src/assert.rs
Expand Up @@ -28,7 +28,7 @@ use std::fmt::Debug;
/// Token::StructEnd,
/// ]);
/// ```
#[cfg_attr(track_caller, track_caller)]
#[cfg_attr(not(no_track_caller), track_caller)]
pub fn assert_tokens<'de, T>(value: &T, tokens: &'de [Token])
where
T: Serialize + Deserialize<'de> + PartialEq + Debug,
Expand Down Expand Up @@ -59,7 +59,7 @@ where
/// Token::StructEnd,
/// ]);
/// ```
#[cfg_attr(track_caller, track_caller)]
#[cfg_attr(not(no_track_caller), track_caller)]
pub fn assert_ser_tokens<T: ?Sized>(value: &T, tokens: &[Token])
where
T: Serialize,
Expand Down Expand Up @@ -112,7 +112,7 @@ where
/// assert_ser_tokens_error(&example, expected, error);
/// }
/// ```
#[cfg_attr(track_caller, track_caller)]
#[cfg_attr(not(no_track_caller), track_caller)]
pub fn assert_ser_tokens_error<T: ?Sized>(value: &T, tokens: &[Token], error: &str)
where
T: Serialize,
Expand Down Expand Up @@ -150,7 +150,7 @@ where
/// Token::StructEnd,
/// ]);
/// ```
#[cfg_attr(track_caller, track_caller)]
#[cfg_attr(not(no_track_caller), track_caller)]
pub fn assert_de_tokens<'de, T>(value: &T, tokens: &'de [Token])
where
T: Deserialize<'de> + PartialEq + Debug,
Expand Down Expand Up @@ -203,7 +203,7 @@ where
/// "unknown field `x`, expected `a` or `b`",
/// );
/// ```
#[cfg_attr(track_caller, track_caller)]
#[cfg_attr(not(no_track_caller), track_caller)]
pub fn assert_de_tokens_error<'de, T>(tokens: &'de [Token], error: &str)
where
T: Deserialize<'de>,
Expand Down