From 6436524ff1e3e65fefde7d01c663f3b7d427cc4c Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:33:57 +0000 Subject: [PATCH] refactor(semantic): fix dead code warning in release mode (#5728) `Counts::assert_accurate` is only used in debug mode. Silence the dead code warning in release mode. --- crates/oxc_semantic/src/counter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/oxc_semantic/src/counter.rs b/crates/oxc_semantic/src/counter.rs index e7994a08c2517..4c160b6959100 100644 --- a/crates/oxc_semantic/src/counter.rs +++ b/crates/oxc_semantic/src/counter.rs @@ -30,7 +30,7 @@ impl Counts { counts } - #[cfg(debug_assertions)] + #[cfg_attr(not(debug_assertions), expect(dead_code))] pub fn assert_accurate(actual: &Self, estimated: &Self) { assert_eq!(actual.nodes, estimated.nodes, "nodes count mismatch"); assert_eq!(actual.scopes, estimated.scopes, "scopes count mismatch");