Skip to content

Commit 2edee66

Browse files
committed
Fix macro hygiene
`concat!` -> `$crate::__macro_support::concat!`
1 parent af254a1 commit 2edee66

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

tracing/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,7 @@ pub mod subscriber;
931931
#[doc(hidden)]
932932
pub mod __macro_support {
933933
pub use crate::callsite::Callsite;
934+
pub use crate::stdlib::concat;
934935
use crate::stdlib::{
935936
fmt,
936937
sync::atomic::{AtomicUsize, Ordering},

tracing/src/macros.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ macro_rules! event {
592592
if $crate::level_enabled!($lvl) {
593593
use $crate::__macro_support::*;
594594
static CALLSITE: $crate::__macro_support::MacroCallsite = $crate::callsite2! {
595-
name: concat!(
595+
name: $crate::__macro_support::concat!(
596596
"event ",
597597
file!(),
598598
":",
@@ -639,7 +639,7 @@ macro_rules! event {
639639
if $crate::level_enabled!($lvl) {
640640
use $crate::__macro_support::*;
641641
static CALLSITE: $crate::__macro_support::MacroCallsite = $crate::callsite2! {
642-
name: concat!(
642+
name: $crate::__macro_support::concat!(
643643
"event ",
644644
file!(),
645645
":",
@@ -2171,7 +2171,7 @@ macro_rules! __tracing_log {
21712171
macro_rules! __mk_format_string {
21722172
// === base case ===
21732173
(@ { $(,)* $($out:expr),* $(,)* } $(,)*) => {
2174-
concat!( $($out),*)
2174+
$crate::__macro_support::concat!( $($out),*)
21752175
};
21762176

21772177
// === recursive case (more tts), ===

tracing/src/stdlib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ pub(crate) use std::*;
1313
#[cfg(not(feature = "std"))]
1414
pub(crate) use self::no_std::*;
1515

16+
pub use core::concat;
17+
1618
#[cfg(not(feature = "std"))]
1719
mod no_std {
1820
// We pre-emptively export everything from libcore/liballoc, (even modules

0 commit comments

Comments
 (0)