Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/consteval.rs')
-rw-r--r--crates/hir-ty/src/consteval.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir-ty/src/consteval.rs b/crates/hir-ty/src/consteval.rs
index 14b9cd203f..f30ec839a0 100644
--- a/crates/hir-ty/src/consteval.rs
+++ b/crates/hir-ty/src/consteval.rs
@@ -342,10 +342,10 @@ pub(crate) fn eval_to_const(
return c;
}
}
- if let Ok(mir_body) = lower_to_mir(ctx.db, ctx.owner, ctx.body, &infer, expr) {
- if let Ok((Ok(result), _)) = interpret_mir(db, Arc::new(mir_body), true, None) {
- return result;
- }
+ if let Ok(mir_body) = lower_to_mir(ctx.db, ctx.owner, ctx.body, &infer, expr)
+ && let Ok((Ok(result), _)) = interpret_mir(db, Arc::new(mir_body), true, None)
+ {
+ return result;
}
unknown_const(infer[expr].clone())
}