Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions tracing-core/src/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,40 +318,40 @@ macro_rules! impl_values {

macro_rules! ty_to_nonzero {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this macro is only used internally; it's not publicly re-exported. i think it would be fine to continue using the prelude, or add a module-level import here?

(u8) => {
NonZeroU8
::core::num::NonZeroU8
};
(u16) => {
NonZeroU16
::core::num::NonZeroU16
};
(u32) => {
NonZeroU32
::core::num::NonZeroU32
};
(u64) => {
NonZeroU64
::core::num::NonZeroU64
};
(u128) => {
NonZeroU128
::core::num::NonZeroU128
};
(usize) => {
NonZeroUsize
::core::num::NonZeroUsize
};
(i8) => {
NonZeroI8
::core::num::NonZeroI8
};
(i16) => {
NonZeroI16
::core::num::NonZeroI16
};
(i32) => {
NonZeroI32
::core::num::NonZeroI32
};
(i64) => {
NonZeroI64
::core::num::NonZeroI64
};
(i128) => {
NonZeroI128
::core::num::NonZeroI128
};
(isize) => {
NonZeroIsize
::core::num::NonZeroIsize
};
}

Expand Down Expand Up @@ -950,7 +950,7 @@ macro_rules! impl_valid_len {
( $( $len:tt ),+ ) => {
$(
impl<'a> private::ValidLen<'a> for
[(&'a Field, Option<&'a (dyn Value + 'a)>); $len] {}
[(&'a Field, ::core::option::Option<&'a (dyn Value + 'a)>); $len] {}
)+
}
}
Expand Down
6 changes: 3 additions & 3 deletions tracing-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ macro_rules! metadata {
$name,
$target,
$level,
Some(file!()),
Some(line!()),
Some(module_path!()),
::core::option::Option::Some(file!()),
::core::option::Option::Some(line!()),
::core::option::Option::Some(module_path!()),
$crate::field::FieldSet::new($fields, $crate::identify_callsite!($callsite)),
$kind,
)
Expand Down
6 changes: 3 additions & 3 deletions tracing-log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@ macro_rules! log_cs {
"log event",
"log",
$level,
None,
None,
None,
::core::option::Option::None,
::core::option::Option::None,
::core::option::Option::None,
field::FieldSet::new(FIELD_NAMES, identify_callsite!(&$cs)),
Kind::EVENT,
);
Expand Down
2 changes: 1 addition & 1 deletion tracing-subscriber/src/filter/subscriber_filters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ macro_rules! filter_impl_body {
}

#[inline]
fn max_level_hint(&self) -> Option<LevelFilter> {
fn max_level_hint(&self) -> ::core::option::Option<LevelFilter> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this macro is only used internally; it's not publicly re-exported. i think it would be fine to continue using the prelude, or add a module-level import here?

self.deref().max_level_hint()
}
};
Expand Down
2 changes: 1 addition & 1 deletion tracing-subscriber/src/fmt/fmt_subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ macro_rules! with_event_from_span {
#[allow(unused)]
let mut iter = fs.iter();
let v = [$(
(&iter.next().unwrap(), Some(&$value as &dyn field::Value)),
(&iter.next().unwrap(), ::core::option::Option::Some(&$value as &dyn field::Value)),
)*];
let vs = fs.value_set(&v);
let $event = Event::new_child_of($id, meta, &vs);
Expand Down
2 changes: 1 addition & 1 deletion tracing-subscriber/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ macro_rules! try_lock {
try_lock!($lock, else return)
};
($lock:expr, else $els:expr) => {
if let Ok(l) = $lock {
if let ::core::result::Result::Ok(l) = $lock {
l
} else if std::thread::panicking() {
$els
Expand Down
4 changes: 2 additions & 2 deletions tracing-subscriber/src/subscribe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1723,13 +1723,13 @@ macro_rules! subscriber_impl_body {
}

#[inline]
fn max_level_hint(&self) -> Option<LevelFilter> {
fn max_level_hint(&self) -> ::core::option::Option<LevelFilter> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this macro is only used internally; it's not publicly re-exported. i think it would be fine to continue using the prelude, or add a module-level import here?

self.deref().max_level_hint()
}

#[doc(hidden)]
#[inline]
unsafe fn downcast_raw(&self, id: TypeId) -> Option<NonNull<()>> {
unsafe fn downcast_raw(&self, id: TypeId) -> ::core::option::Option<NonNull<()>> {
self.deref().downcast_raw(id)
}
};
Expand Down
40 changes: 20 additions & 20 deletions tracing/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2196,127 +2196,127 @@ macro_rules! valueset {
// };
(@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = ?$val:expr, $($rest:tt)*) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&debug(&$val) as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&debug(&$val) as &dyn Value)) },
$next,
$($rest)*
)
};
(@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = %$val:expr, $($rest:tt)*) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&display(&$val) as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&display(&$val) as &dyn Value)) },
$next,
$($rest)*
)
};
(@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = $val:expr, $($rest:tt)*) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&$val as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&$val as &dyn Value)) },
$next,
$($rest)*
)
};
(@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+, $($rest:tt)*) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&$($k).+ as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&$($k).+ as &dyn Value)) },
$next,
$($rest)*
)
};
(@ { $(,)* $($out:expr),* }, $next:expr, ?$($k:ident).+, $($rest:tt)*) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&debug(&$($k).+) as &dyn Value)) },
$next,
$($rest)*
)
};
(@ { $(,)* $($out:expr),* }, $next:expr, %$($k:ident).+, $($rest:tt)*) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&display(&$($k).+) as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&display(&$($k).+) as &dyn Value)) },
$next,
$($rest)*
)
};
(@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = ?$val:expr) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&debug(&$val) as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&debug(&$val) as &dyn Value)) },
$next,
)
};
(@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = %$val:expr) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&display(&$val) as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&display(&$val) as &dyn Value)) },
$next,
)
};
(@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+ = $val:expr) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&$val as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&$val as &dyn Value)) },
$next,
)
};
(@ { $(,)* $($out:expr),* }, $next:expr, $($k:ident).+) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&$($k).+ as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&$($k).+ as &dyn Value)) },
$next,
)
};
(@ { $(,)* $($out:expr),* }, $next:expr, ?$($k:ident).+) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&debug(&$($k).+) as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&debug(&$($k).+) as &dyn Value)) },
$next,
)
};
(@ { $(,)* $($out:expr),* }, $next:expr, %$($k:ident).+) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&display(&$($k).+) as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&display(&$($k).+) as &dyn Value)) },
$next,
)
};

// Handle literal names
(@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = ?$val:expr, $($rest:tt)*) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&debug(&$val) as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&debug(&$val) as &dyn Value)) },
$next,
$($rest)*
)
};
(@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = %$val:expr, $($rest:tt)*) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&display(&$val) as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&display(&$val) as &dyn Value)) },
$next,
$($rest)*
)
};
(@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = $val:expr, $($rest:tt)*) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&$val as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&$val as &dyn Value)) },
$next,
$($rest)*
)
};
(@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = ?$val:expr) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&debug(&$val) as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&debug(&$val) as &dyn Value)) },
$next,
)
};
(@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = %$val:expr) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&display(&$val) as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&display(&$val) as &dyn Value)) },
$next,
)
};
(@ { $(,)* $($out:expr),* }, $next:expr, $k:literal = $val:expr) => {
$crate::valueset!(
@ { $($out),*, (&$next, Some(&$val as &dyn Value)) },
@ { $($out),*, (&$next, ::core::option::Option::Some(&$val as &dyn Value)) },
$next,
)
};

// Remainder is unparsable, but exists --- must be format args!
(@ { $(,)* $($out:expr),* }, $next:expr, $($rest:tt)+) => {
$crate::valueset!(@ { (&$next, Some(&format_args!($($rest)+) as &dyn Value)), $($out),* }, $next, )
$crate::valueset!(@ { (&$next, ::core::option::Option::Some(&format_args!($($rest)+) as &dyn Value)), $($out),* }, $next, )
};

// === entry ===
Expand All @@ -2327,7 +2327,7 @@ macro_rules! valueset {
let mut iter = $fields.iter();
$fields.value_set($crate::valueset!(
@ { },
iter.next().expect("FieldSet corrupted (this is a bug)"),
::core::iter::Iterator::next(&mut iter).expect("FieldSet corrupted (this is a bug)"),
$($kvs)+
))
}
Expand Down
Loading