diff --git a/Cargo.toml b/Cargo.toml index fa9ef428b..3ba01de0a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,9 +59,16 @@ sval_ref = { version = "2.1", optional = true, default-features = false } value-bag = { version = "1.4", optional = true, default-features = false } [dev-dependencies] -rustversion = "1.0" serde = { version = "1.0", features = ["derive"] } serde_test = "1.0" sval = { version = "2.1" } sval_derive = { version = "2.1" } value-bag = { version = "1.4", features = ["test"] } + +# NOTE: log doesn't actually depent on this crate. However our dependencies, +# serde and sval, dependent on version 1.0 of the crate, which has problem fixed +# in 1.0.60, specifically in the following commit +# https://github.com/dtolnay/proc-macro2/commit/e31d61910049e097afdd3d27c37786309082bdcb. +# By defining the crate as direct dependency we can increase it's minimal +# version making the minimal (crate) version CI happy. +proc-macro2 = { version = "1.0.63", default-features = false } diff --git a/tests/macros.rs b/tests/macros.rs index 08a09b7d7..228f1f5d6 100644 --- a/tests/macros.rs +++ b/tests/macros.rs @@ -157,49 +157,45 @@ fn kv_expr_context() { #[test] fn implicit_named_args() { - #[rustversion::since(1.58)] - fn _check() { - let world = "world"; + let world = "world"; - for lvl in log::Level::iter() { - log!(lvl, "hello {world}"); - log!(lvl, "hello {world}",); + for lvl in log::Level::iter() { + log!(lvl, "hello {world}"); + log!(lvl, "hello {world}",); - log!(target: "my_target", lvl, "hello {world}"); - log!(target: "my_target", lvl, "hello {world}",); + log!(target: "my_target", lvl, "hello {world}"); + log!(target: "my_target", lvl, "hello {world}",); - log!(lvl, "hello {world}"); - log!(lvl, "hello {world}",); - } + log!(lvl, "hello {world}"); + log!(lvl, "hello {world}",); + } - all_log_macros!("hello {world}"); - all_log_macros!("hello {world}",); + all_log_macros!("hello {world}"); + all_log_macros!("hello {world}",); - all_log_macros!(target: "my_target", "hello {world}"); - all_log_macros!(target: "my_target", "hello {world}",); + all_log_macros!(target: "my_target", "hello {world}"); + all_log_macros!(target: "my_target", "hello {world}",); - all_log_macros!(target = "my_target"; "hello {world}"); - all_log_macros!(target = "my_target"; "hello {world}",); - } + #[cfg(feature = "kv_unstable")] + all_log_macros!(target = "my_target"; "hello {world}"); + #[cfg(feature = "kv_unstable")] + all_log_macros!(target = "my_target"; "hello {world}",); } #[test] #[cfg(feature = "kv_unstable")] fn kv_implicit_named_args() { - #[rustversion::since(1.58)] - fn _check() { - let world = "world"; + let world = "world"; - for lvl in log::Level::iter() { - log!(target: "my_target", lvl, cat_1 = "chashu", cat_2 = "nori", cat_count = 2; "hello {world}"); - - log!(lvl, cat_1 = "chashu", cat_2 = "nori", cat_count = 2; "hello {world}"); - } + for lvl in log::Level::iter() { + log!(target: "my_target", lvl, cat_1 = "chashu", cat_2 = "nori", cat_count = 2; "hello {world}"); - all_log_macros!(target: "my_target", cat_1 = "chashu", cat_2 = "nori", cat_count = 2; "hello {world}"); - all_log_macros!(target = "my_target", cat_1 = "chashu", cat_2 = "nori", cat_count = 2; "hello {world}"); - all_log_macros!(cat_1 = "chashu", cat_2 = "nori", cat_count = 2; "hello {world}"); + log!(lvl, cat_1 = "chashu", cat_2 = "nori", cat_count = 2; "hello {world}"); } + + all_log_macros!(target: "my_target", cat_1 = "chashu", cat_2 = "nori", cat_count = 2; "hello {world}"); + all_log_macros!(target = "my_target", cat_1 = "chashu", cat_2 = "nori", cat_count = 2; "hello {world}"); + all_log_macros!(cat_1 = "chashu", cat_2 = "nori", cat_count = 2; "hello {world}"); } #[test]