Skip to content

Commit 87f813c

Browse files
committed
Allow dead_code in all metric structs
Issue is being tracked in <rust-lang/rust#88900>. Basically the dead_code lint was changed to ignore derive fmt::Debug implementations, generally a good thing, but the metrics are only written to and then printed using the (derived) fmt::Debug implementations so they are actually read.
1 parent 3fa1c53 commit 87f813c

File tree

8 files changed

+9
-0
lines changed

8 files changed

+9
-0
lines changed

src/rt/coordinator.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pub(super) struct Coordinator {
4646

4747
/// Metrics for [`Coordinator`].
4848
#[derive(Debug)]
49+
#[allow(dead_code)] // https://github.com/rust-lang/rust/issues/88900.
4950
struct Metrics<'c, 'l> {
5051
heph_version: &'static str,
5152
os: &'c str,

src/rt/local/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,7 @@ pub(super) struct RuntimeInternals {
713713

714714
/// Metrics for [`RuntimeInternals`].
715715
#[derive(Debug)]
716+
#[allow(dead_code)] // https://github.com/rust-lang/rust/issues/88900.
716717
pub(crate) struct Metrics {
717718
id: NonZeroUsize,
718719
scheduler: scheduler::Metrics,

src/rt/local/scheduler/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ pub(crate) struct Scheduler {
3636

3737
/// Metrics for [`Scheduler`].
3838
#[derive(Debug)]
39+
#[allow(dead_code)] // https://github.com/rust-lang/rust/issues/88900.
3940
pub(crate) struct Metrics {
4041
ready: usize,
4142
inactive: usize,

src/rt/local/timers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ pub(crate) struct Timers {
8181

8282
/// Metrics for [`Timers`].
8383
#[derive(Debug)]
84+
#[allow(dead_code)] // https://github.com/rust-lang/rust/issues/88900.
8485
pub(crate) struct Metrics {
8586
timers: usize,
8687
next_timer: Option<Duration>,

src/rt/shared/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ pub(crate) struct RuntimeInternals {
9898

9999
/// Metrics for [`RuntimeInternals`].
100100
#[derive(Debug)]
101+
#[allow(dead_code)] // https://github.com/rust-lang/rust/issues/88900.
101102
pub(crate) struct Metrics {
102103
scheduler: scheduler::Metrics,
103104
timers: timers::Metrics,

src/rt/shared/scheduler/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ pub(super) struct Scheduler {
104104

105105
/// Metrics for [`Scheduler`].
106106
#[derive(Debug)]
107+
#[allow(dead_code)] // https://github.com/rust-lang/rust/issues/88900.
107108
pub(crate) struct Metrics {
108109
ready: usize,
109110
inactive: usize,

src/rt/shared/timers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ struct Epoch {
8989

9090
/// Metrics for [`Timers`].
9191
#[derive(Debug)]
92+
#[allow(dead_code)] // https://github.com/rust-lang/rust/issues/88900.
9293
pub(crate) struct Metrics {
9394
timers: usize,
9495
next_timer: Option<Duration>,

src/trace.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ pub(crate) struct CoordinatorLog {
169169

170170
/// Metrics for [`CoordinatorLog`].
171171
#[derive(Debug)]
172+
#[allow(dead_code)] // https://github.com/rust-lang/rust/issues/88900.
172173
pub(crate) struct CoordinatorMetrics<'l> {
173174
file: &'l File,
174175
counter: u32,
@@ -266,6 +267,7 @@ pub(crate) struct Log {
266267

267268
/// Metrics for [`Log`].
268269
#[derive(Debug)]
270+
#[allow(dead_code)] // https://github.com/rust-lang/rust/issues/88900.
269271
pub(crate) struct Metrics {
270272
counter: u32,
271273
}

0 commit comments

Comments
 (0)