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.
This commit is contained in:
overlookmotel 2024-09-16 15:32:36 +00:00
parent bb95306efd
commit 47d9ad8cbf

View file

@ -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 {