Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/hir.rs')
-rw-r--r--crates/hir-def/src/hir.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/crates/hir-def/src/hir.rs b/crates/hir-def/src/hir.rs
index 1f4577629c..f531109cd8 100644
--- a/crates/hir-def/src/hir.rs
+++ b/crates/hir-def/src/hir.rs
@@ -26,7 +26,7 @@ use crate::{
builtin_type::{BuiltinFloat, BuiltinInt, BuiltinUint},
path::{GenericArgs, Path},
type_ref::{Mutability, Rawness, TypeRef},
- BlockId,
+ AnonymousConstId, BlockId,
};
pub use syntax::ast::{ArithOp, BinaryOp, CmpOp, LogicOp, Ordering, RangeOp, UnaryOp};
@@ -169,11 +169,7 @@ pub enum Expr {
statements: Box<[Statement]>,
tail: Option<ExprId>,
},
- Const {
- id: Option<BlockId>,
- statements: Box<[Statement]>,
- tail: Option<ExprId>,
- },
+ Const(AnonymousConstId),
Unsafe {
id: Option<BlockId>,
statements: Box<[Statement]>,
@@ -355,10 +351,10 @@ impl Expr {
Expr::Let { expr, .. } => {
f(*expr);
}
+ Expr::Const(_) => (),
Expr::Block { statements, tail, .. }
| Expr::Unsafe { statements, tail, .. }
- | Expr::Async { statements, tail, .. }
- | Expr::Const { statements, tail, .. } => {
+ | Expr::Async { statements, tail, .. } => {
for stmt in statements.iter() {
match stmt {
Statement::Let { initializer, else_branch, .. } => {