From c650186a6479701597baa3fffe826233f53cb9ef Mon Sep 17 00:00:00 2001 From: "yuhaixin.hx" Date: Sun, 6 Feb 2022 21:13:29 +0800 Subject: [PATCH 1/2] metrics: fix build on mips --- tokio/src/runtime/metrics/worker.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tokio/src/runtime/metrics/worker.rs b/tokio/src/runtime/metrics/worker.rs index ec59ce04730..c9b85e48e4c 100644 --- a/tokio/src/runtime/metrics/worker.rs +++ b/tokio/src/runtime/metrics/worker.rs @@ -1,5 +1,5 @@ -use std::sync::atomic::Ordering::Relaxed; -use std::sync::atomic::{AtomicU64, AtomicUsize}; +use crate::loom::sync::atomic::Ordering::Relaxed; +use crate::loom::sync::atomic::{AtomicU64, AtomicUsize}; /// Retreive runtime worker metrics. /// From 578daea8b184bf35504d01fcecf794cbf33549e3 Mon Sep 17 00:00:00 2001 From: "yuhaixin.hx" Date: Mon, 7 Feb 2022 10:16:00 +0800 Subject: [PATCH 2/2] chore:disable metrics feature in loom tests --- tokio/src/macros/cfg.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tokio/src/macros/cfg.rs b/tokio/src/macros/cfg.rs index 3b8fd3a7890..3836aa78b9d 100644 --- a/tokio/src/macros/cfg.rs +++ b/tokio/src/macros/cfg.rs @@ -177,9 +177,9 @@ macro_rules! cfg_macros { macro_rules! cfg_metrics { ($($item:item)*) => { $( - // For now, metrics is always enabled. When stabilized, it might - // have a dedicated feature flag. - #[cfg(tokio_unstable)] + // For now, metrics is only disabled in loom tests. + // When stabilized, it might have a dedicated feature flag. + #[cfg(all(tokio_unstable, not(loom)))] #[cfg_attr(docsrs, doc(cfg(tokio_unstable)))] $item )* @@ -189,7 +189,7 @@ macro_rules! cfg_metrics { macro_rules! cfg_not_metrics { ($($item:item)*) => { $( - #[cfg(not(tokio_unstable))] + #[cfg(not(all(tokio_unstable, not(loom))))] $item )* }