Skip to content

Commit f33f15e

Browse files
authored
Use if cfg!(...) instead of #[cfg] (#12889)
Minor style follow-up from #12841
1 parent 4ad29c7 commit f33f15e

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

cranelift/codegen/build.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,20 +223,17 @@ fn run_compilation(compilation: &IsleCompilation) -> Result<(), Errors> {
223223
// threshold, because we cannot rely on rustc doing regalloc
224224
// on all of the local bindings to shrink the stack frame to a
225225
// reasonable size.
226-
#[cfg(not(debug_assertions))]
227-
{
226+
if cfg!(debug_assertions) {
227+
options.split_match_arms = true;
228+
options.match_arm_split_threshold = Some(4);
229+
} else {
228230
options.split_match_arms = std::env::var("CARGO_FEATURE_ISLE_SPLIT_MATCH").is_ok();
229231
if let Ok(value) = std::env::var("ISLE_SPLIT_MATCH_THRESHOLD") {
230232
options.match_arm_split_threshold = Some(value.parse().unwrap_or_else(|err| {
231233
panic!("invalid ISLE_SPLIT_MATCH_THRESHOLD value '{value}': {err}");
232234
}));
233235
}
234236
}
235-
#[cfg(debug_assertions)]
236-
{
237-
options.split_match_arms = true;
238-
options.match_arm_split_threshold = Some(4);
239-
}
240237

241238
if let Ok(out_dir) = std::env::var("OUT_DIR") {
242239
options.prefixes.push(isle::codegen::Prefix {

0 commit comments

Comments
 (0)