Skip to content

Commit 9966cfe

Browse files
hlbarberkaffarell
authored andcommitted
tracing: use fully qualified names in macros for items exported from std prelude (tokio-rs#2621)
Currently, in many places, macros do not use fully qualified names for items exported from the prelude. This means that naming collisions (`struct Some`) or the removal of the std library prelude will cause compilation errors. - Identify and use fully qualified names in macros were we previously assumed the Rust std prelude. We use `::core` rather than `::std`. - Add [`no_implicit_prelude`](https://doc.rust-lang.org/reference/names/preludes.html#the-no_implicit_prelude-attribute) to `tracing/tests/macros.rs`. I'm unsure if this is giving us good coverage - can we improve on this approach? I'm not confident I've caught everything.
1 parent c64fedb commit 9966cfe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tracing-subscriber/src/fmt/fmt_layer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ macro_rules! with_event_from_span {
775775
#[allow(unused)]
776776
let mut iter = fs.iter();
777777
let v = [$(
778-
(&iter.next().unwrap(), Some(&$value as &dyn field::Value)),
778+
(&iter.next().unwrap(), ::core::option::Option::Some(&$value as &dyn field::Value)),
779779
)*];
780780
let vs = fs.value_set(&v);
781781
let $event = Event::new_child_of($id, meta, &vs);

0 commit comments

Comments
 (0)