Skip to content

Commit 24adf39

Browse files
taiki-enotgull
authored andcommitted
Always set #![no_std] to fix redundant import warning
``` error: the item `Box` is imported redundantly --> src/runnable.rs:9:5 | 9 | use alloc::boxed::Box; | ^^^^^^^^^^^^^^^^^ --> /rustc/5119208fd78a77547c705d1695428c88d6791263/library/std/src/prelude/mod.rs:125:13 | = note: the item `Box` is already defined here | = note: `-D unused-imports` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_imports)]` ```
1 parent c2122eb commit 24adf39

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
//! vanishes and only reappears when its [`Waker`][`core::task::Waker`] wakes the task, thus
6868
//! scheduling it to be run again.
6969
70-
#![cfg_attr(not(feature = "std"), no_std)]
70+
#![no_std]
7171
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
7272
#![doc(test(attr(deny(rust_2018_idioms, warnings))))]
7373
#![doc(test(attr(allow(unused_extern_crates, unused_variables))))]
@@ -79,6 +79,8 @@
7979
)]
8080

8181
extern crate alloc;
82+
#[cfg(feature = "std")]
83+
extern crate std;
8284

8385
/// We can't use `?` in const contexts yet, so this macro acts
8486
/// as a workaround.

src/runnable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ impl<M> Builder<M> {
420420

421421
#[inline]
422422
fn thread_id() -> ThreadId {
423-
thread_local! {
423+
std::thread_local! {
424424
static ID: ThreadId = thread::current().id();
425425
}
426426
ID.try_with(|id| *id)

0 commit comments

Comments
 (0)