Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/mir/lower.rs')
| -rw-r--r-- | crates/hir-ty/src/mir/lower.rs | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/crates/hir-ty/src/mir/lower.rs b/crates/hir-ty/src/mir/lower.rs index ab7e6df3f5..a9bb7723d8 100644 --- a/crates/hir-ty/src/mir/lower.rs +++ b/crates/hir-ty/src/mir/lower.rs @@ -961,18 +961,12 @@ impl<'a, 'db> MirLowerCtx<'a, 'db> { } Expr::Await { .. } => not_supported!("await"), Expr::Yeet { .. } => not_supported!("yeet"), - &Expr::Const(_) => { - // let subst = self.placeholder_subst(); - // self.lower_const( - // id.into(), - // current, - // place, - // subst, - // expr_id.into(), - // self.expr_ty_without_adjust(expr_id), - // )?; - // Ok(Some(current)) - not_supported!("const block") + &Expr::Const(id) => { + // Inline const blocks (`const { .. }`) are stored with their inner expression in + // the same body (see inference, which infers the inner expression directly), so we + // lower that expression in place. Const-ness is irrelevant here: MIR evaluation + // already runs in a const context. + self.lower_expr_to_place(id, place, current) } Expr::Cast { expr, type_ref: _ } => { let Some((it, current)) = self.lower_expr_to_some_operand(*expr, current)? else { |