diff --git a/tracing-core/src/field.rs b/tracing-core/src/field.rs index a134e0dc2f..2d6ec13cde 100644 --- a/tracing-core/src/field.rs +++ b/tracing-core/src/field.rs @@ -1102,8 +1102,9 @@ mod test { use crate::metadata::{Kind, Level, Metadata}; use crate::stdlib::{borrow::ToOwned, string::String}; - struct TestCallsite1; - static TEST_CALLSITE_1: TestCallsite1 = TestCallsite1; + // Make sure TEST_CALLSITE_* have non-zero size, so they can't be located at the same address. + struct TestCallsite1(u8); + static TEST_CALLSITE_1: TestCallsite1 = TestCallsite1(0); static TEST_META_1: Metadata<'static> = metadata! { name: "field_test1", target: module_path!(), @@ -1123,8 +1124,8 @@ mod test { } } - struct TestCallsite2; - static TEST_CALLSITE_2: TestCallsite2 = TestCallsite2; + struct TestCallsite2(u8); + static TEST_CALLSITE_2: TestCallsite2 = TestCallsite2(0); static TEST_META_2: Metadata<'static> = metadata! { name: "field_test2", target: module_path!(),