Skip to content

Commit 8738590

Browse files
committed
tracing: Switch to unconditional no_std
… and remove stdlib module.
1 parent 8e5bdf6 commit 8738590

File tree

3 files changed

+10
-64
lines changed

3 files changed

+10
-64
lines changed

tracing/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,8 @@
912912
//! [static verbosity level]: level_filters#compile-time-filters
913913
//! [instrument]: https://docs.rs/tracing-attributes/latest/tracing_attributes/attr.instrument.html
914914
//! [flags]: #crate-feature-flags
915-
#![cfg_attr(not(feature = "std"), no_std)]
915+
916+
#![no_std]
916917
#![cfg_attr(docsrs, feature(doc_cfg), deny(rustdoc::broken_intra_doc_links))]
917918
#![doc(
918919
html_logo_url = "https://raw.githubusercontent.com/tokio-rs/tracing/main/assets/logo-type.png",
@@ -941,8 +942,8 @@
941942
while_true
942943
)]
943944

944-
#[cfg(not(feature = "std"))]
945-
extern crate alloc;
945+
#[cfg(feature = "std")]
946+
extern crate std;
946947

947948
// Somehow this `use` statement is necessary for us to re-export the `core`
948949
// macros on Rust 1.26.0. I'm not sure how this makes it work, but it does.
@@ -980,7 +981,6 @@ pub mod field;
980981
pub mod instrument;
981982
pub mod level_filters;
982983
pub mod span;
983-
pub(crate) mod stdlib;
984984
pub mod subscriber;
985985

986986
#[doc(hidden)]

tracing/src/span.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,19 +317,20 @@
317317
//! [`follows_from`]: Span::follows_from()
318318
//! [guard]: Entered
319319
//! [parent]: #span-relationships
320+
320321
pub use tracing_core::span::{Attributes, Id, Record};
321322

322-
use crate::stdlib::{
323+
use crate::{
324+
dispatcher::{self, Dispatch},
325+
field, Metadata,
326+
};
327+
use core::{
323328
cmp, fmt,
324329
hash::{Hash, Hasher},
325330
marker::PhantomData,
326331
mem,
327332
ops::Deref,
328333
};
329-
use crate::{
330-
dispatcher::{self, Dispatch},
331-
field, Metadata,
332-
};
333334

334335
/// Trait implemented by types which have a span `Id`.
335336
pub trait AsId: crate::sealed::Sealed {

tracing/src/stdlib.rs

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)