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 {
516
516
#[ cfg( feature = "std" ) ]
517
517
mod dispatchers {
518
518
use crate :: { dispatcher, lazy:: Lazy } ;
519
+ use alloc:: vec:: Vec ;
519
520
use std:: sync:: {
520
521
atomic:: { AtomicBool , Ordering } ,
521
522
RwLock , RwLockReadGuard , RwLockWriteGuard ,
Original file line number Diff line number Diff line change 122
122
//! [`get_default`] function, which executes a closure with a reference to the
123
123
//! currently default `Dispatch`. This is used primarily by `tracing`
124
124
//! instrumentation.
125
- //!
125
+
126
126
use core:: ptr:: addr_of;
127
127
128
128
use crate :: {
@@ -182,7 +182,7 @@ enum Kind<T> {
182
182
}
183
183
184
184
#[ cfg( feature = "std" ) ]
185
- thread_local ! {
185
+ std :: thread_local! {
186
186
static CURRENT_STATE : State = const {
187
187
State {
188
188
default : RefCell :: new( None ) ,
Original file line number Diff line number Diff line change @@ -1120,6 +1120,9 @@ mod private {
1120
1120
1121
1121
#[ cfg( test) ]
1122
1122
mod test {
1123
+ use alloc:: boxed:: Box ;
1124
+ use std:: format;
1125
+
1123
1126
use super :: * ;
1124
1127
use crate :: metadata:: { Kind , Level , Metadata } ;
1125
1128
use crate :: stdlib:: { borrow:: ToOwned , string:: String } ;
Original file line number Diff line number Diff line change 116
116
//! [`Dispatch`]: dispatcher::Dispatch
117
117
//! [`tokio-rs/tracing`]: https://github.com/tokio-rs/tracing
118
118
//! [`tracing`]: https://crates.io/crates/tracing
119
+
120
+ #![ no_std]
119
121
#![ doc(
120
122
html_logo_url = "https://raw.githubusercontent.com/tokio-rs/tracing/main/assets/logo-type.png" ,
121
123
issue_tracker_base_url = "https://github.com/tokio-rs/tracing/issues/"
122
124
) ]
123
- #![ cfg_attr( not( feature = "std" ) , no_std) ]
124
125
#![ cfg_attr( docsrs, feature( doc_cfg) , deny( rustdoc:: broken_intra_doc_links) ) ]
125
126
#![ warn(
126
127
missing_debug_implementations,
144
145
unused_parens,
145
146
while_true
146
147
) ]
147
- # [ cfg ( not ( feature = "std" ) ) ]
148
+
148
149
extern crate alloc;
149
150
151
+ #[ cfg( feature = "std" ) ]
152
+ extern crate std;
153
+
150
154
#[ doc( hidden) ]
151
155
pub mod __macro_support {
152
156
// Re-export the `core` functions that are used in macros. This allows
You can’t perform that action at this time.
0 commit comments