File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -516,6 +516,7 @@ mod private {
516516#[ cfg( feature = "std" ) ]
517517mod dispatchers {
518518 use crate :: { dispatcher, lazy:: Lazy } ;
519+ use alloc:: vec:: Vec ;
519520 use std:: sync:: {
520521 atomic:: { AtomicBool , Ordering } ,
521522 RwLock , RwLockReadGuard , RwLockWriteGuard ,
Original file line number Diff line number Diff line change 122122//! [`get_default`] function, which executes a closure with a reference to the
123123//! currently default `Dispatch`. This is used primarily by `tracing`
124124//! instrumentation.
125- //!
125+
126126use core:: ptr:: addr_of;
127127
128128use crate :: {
@@ -182,7 +182,7 @@ enum Kind<T> {
182182}
183183
184184#[ cfg( feature = "std" ) ]
185- thread_local ! {
185+ std :: thread_local! {
186186 static CURRENT_STATE : State = const {
187187 State {
188188 default : RefCell :: new( None ) ,
Original file line number Diff line number Diff line change @@ -1120,6 +1120,9 @@ mod private {
11201120
11211121#[ cfg( test) ]
11221122mod test {
1123+ use alloc:: boxed:: Box ;
1124+ use std:: format;
1125+
11231126 use super :: * ;
11241127 use crate :: metadata:: { Kind , Level , Metadata } ;
11251128 use crate :: stdlib:: { borrow:: ToOwned , string:: String } ;
Original file line number Diff line number Diff line change 116116//! [`Dispatch`]: dispatcher::Dispatch
117117//! [`tokio-rs/tracing`]: https://github.com/tokio-rs/tracing
118118//! [`tracing`]: https://crates.io/crates/tracing
119+
120+ #![ no_std]
119121#![ doc(
120122 html_logo_url = "https://raw.githubusercontent.com/tokio-rs/tracing/main/assets/logo-type.png" ,
121123 issue_tracker_base_url = "https://github.com/tokio-rs/tracing/issues/"
122124) ]
123- #![ cfg_attr( not( feature = "std" ) , no_std) ]
124125#![ cfg_attr( docsrs, feature( doc_cfg) , deny( rustdoc:: broken_intra_doc_links) ) ]
125126#![ warn(
126127 missing_debug_implementations,
144145 unused_parens,
145146 while_true
146147) ]
147- # [ cfg ( not ( feature = "std" ) ) ]
148+
148149extern crate alloc;
149150
151+ #[ cfg( feature = "std" ) ]
152+ extern crate std;
153+
150154#[ doc( hidden) ]
151155pub mod __macro_support {
152156 // Re-export the `core` functions that are used in macros. This allows
You can’t perform that action at this time.
0 commit comments