From 47d9ad8cbfae2f27e2e973f7110b548c7991fc7b Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:32:36 +0000 Subject: [PATCH] refactor(semantic): remove unused vars warning in release mode (#5803) Avoid an `unused_variables` warning in release mode for a variable which is only used in debug mode. --- crates/oxc_semantic/src/builder.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/oxc_semantic/src/builder.rs b/crates/oxc_semantic/src/builder.rs index 30605bd47..30d13d66d 100644 --- a/crates/oxc_semantic/src/builder.rs +++ b/crates/oxc_semantic/src/builder.rs @@ -267,6 +267,7 @@ impl<'a> SemanticBuilder<'a> { // Avoiding this growth produces up to 30% perf boost on our benchmarks. // // If user did not provide existing `Stats`, calculate them by visiting AST. + #[cfg_attr(not(debug_assertions), expect(unused_variables))] let (stats, check_stats) = if let Some(stats) = self.stats { (stats, None) } else {