Skip to content

Commit

Permalink
Merge pull request #568 from Thomasdezeeuw/remove-rustversion-dep
Browse files Browse the repository at this point in the history
Remove rustversion dev-dependency
  • Loading branch information
KodrAus authored Jul 3, 2023
2 parents 84ddc30 + c175ad4 commit e9123d6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 30 deletions.
9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
54 changes: 25 additions & 29 deletions tests/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit e9123d6

Please sign in to comment.