Skip to content

Commit 426a562

Browse files
rt: remove allow(dead_code) after JoinSet stabilization (#7826)
1 parent e3b89bb commit 426a562

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

tokio/src/runtime/task/core.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ pub(super) struct Trailer {
204204
/// Consumer task waiting on completion of this task.
205205
pub(super) waker: UnsafeCell<Option<Waker>>,
206206
/// Optional hooks needed in the harness.
207+
#[cfg_attr(not(tokio_unstable), allow(dead_code))] //TODO: remove when hooks are stabilized
207208
pub(super) hooks: TaskHarnessScheduleHooks,
208209
}
209210

tokio/src/runtime/task/list.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,11 @@ impl<S: 'static> OwnedTasks<S> {
193193
self.list.len()
194194
}
195195

196-
cfg_64bit_metrics! {
197-
pub(crate) fn spawned_tasks_count(&self) -> u64 {
198-
self.list.added()
196+
cfg_unstable_metrics! {
197+
cfg_64bit_metrics! {
198+
pub(crate) fn spawned_tasks_count(&self) -> u64 {
199+
self.list.added()
200+
}
199201
}
200202
}
201203

tokio/src/runtime/task/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,6 @@
178178
//! poll call will notice it when the poll finishes, and the task is cancelled
179179
//! at that point.
180180
181-
// Some task infrastructure is here to support `JoinSet`, which is currently
182-
// unstable. This should be removed once `JoinSet` is stabilized.
183-
#![cfg_attr(not(tokio_unstable), allow(dead_code))]
184-
185181
mod core;
186182
use self::core::Cell;
187183
use self::core::Header;

tokio/src/util/sharded_list.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,12 @@ impl<L: ShardedListItem> ShardedList<L, L::Target> {
107107
self.count.load(Ordering::Relaxed)
108108
}
109109

110-
cfg_64bit_metrics! {
111-
/// Gets the total number of elements added to this list.
112-
pub(crate) fn added(&self) -> u64 {
113-
self.added.load(Ordering::Relaxed)
110+
cfg_unstable_metrics! {
111+
cfg_64bit_metrics! {
112+
/// Gets the total number of elements added to this list.
113+
pub(crate) fn added(&self) -> u64 {
114+
self.added.load(Ordering::Relaxed)
115+
}
114116
}
115117
}
116118

0 commit comments

Comments
 (0)