From ebf74f2707e01d5179c091463eb62d0114df5fd1 Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Fri, 8 Apr 2022 15:01:39 -0700 Subject: [PATCH 1/3] kick ci From 22af7c703e1c37fff4fba4aa859309cd606cb50d Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Fri, 8 Apr 2022 15:15:09 -0700 Subject: [PATCH 2/3] tracing: fix warning on <=32-bit platforms This changes the "unregistered" interest state from `0xDEADFACED` to`0xDEAD`, which should fit in a `usize` even on 16-bit platforms. The actual value of this thing doesn't matter at all, it just has to be "not 0, 1, or 2", and it's good for it to be something weird to make it more obvious in the event of stuff going wrong. This should fix a warning being emitted when building for wasm (and other <=32-bit platforms) because the previous literal would be truncated. --- tracing/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracing/src/lib.rs b/tracing/src/lib.rs index 6a919d7bfb..33e33aa600 100644 --- a/tracing/src/lib.rs +++ b/tracing/src/lib.rs @@ -1005,7 +1005,7 @@ pub mod __macro_support { /// without warning. pub const fn new(meta: &'static Metadata<'static>) -> Self { Self { - interest: AtomicUsize::new(0xDEADFACED), + interest: AtomicUsize::new(0xDEAD), meta, registration: Once::new(), } From a8ff5a22da833d0970a8e518bb578a3f8cddf824 Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Fri, 8 Apr 2022 15:17:20 -0700 Subject: [PATCH 3/3] tracing: skip `macros_redefined_core` tests on wasm Apparently the wasm-bindgen test messes with these somehow, so just skip them. --- tracing/tests/macros_redefined_core.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/tracing/tests/macros_redefined_core.rs b/tracing/tests/macros_redefined_core.rs index 5932c06553..d830dcdb02 100644 --- a/tracing/tests/macros_redefined_core.rs +++ b/tracing/tests/macros_redefined_core.rs @@ -2,19 +2,16 @@ extern crate self as core; use tracing::{enabled, event, span, Level}; -#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[test] fn span() { span!(Level::DEBUG, "foo"); } -#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[test] fn event() { event!(Level::DEBUG, "foo"); } -#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)] #[test] fn enabled() { enabled!(Level::DEBUG);