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.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir-ty/src/consteval.rs b/crates/hir-ty/src/consteval.rs
index 673d00d956..928396c63a 100644
--- a/crates/hir-ty/src/consteval.rs
+++ b/crates/hir-ty/src/consteval.rs
@@ -276,7 +276,7 @@ pub(crate) fn const_eval_discriminant_variant(
let def = variant_id.into();
let body = Body::of(db, def);
let loc = variant_id.lookup(db);
- if matches!(body[body.body_expr], Expr::Missing) {
+ if matches!(body[body.root_expr()], Expr::Missing) {
let prev_idx = loc.index.checked_sub(1);
let value = match prev_idx {
Some(prev_idx) => {