aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/body.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def/src/body.rs')
-rw-r--r--crates/hir_def/src/body.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/hir_def/src/body.rs b/crates/hir_def/src/body.rs
index b1a3fe1cb..19c4eb521 100644
--- a/crates/hir_def/src/body.rs
+++ b/crates/hir_def/src/body.rs
@@ -28,11 +28,10 @@ use crate::{
28 db::DefDatabase, 28 db::DefDatabase,
29 expr::{Expr, ExprId, Label, LabelId, Pat, PatId}, 29 expr::{Expr, ExprId, Label, LabelId, Pat, PatId},
30 item_scope::BuiltinShadowMode, 30 item_scope::BuiltinShadowMode,
31 item_scope::ItemScope,
32 nameres::DefMap, 31 nameres::DefMap,
33 path::{ModPath, Path}, 32 path::{ModPath, Path},
34 src::HasSource, 33 src::HasSource,
35 AsMacroCall, DefWithBodyId, HasModule, LocalModuleId, Lookup, ModuleId, 34 AsMacroCall, BlockId, DefWithBodyId, HasModule, LocalModuleId, Lookup, ModuleId,
36}; 35};
37 36
38/// A subset of Expander that only deals with cfg attributes. We only need it to 37/// A subset of Expander that only deals with cfg attributes. We only need it to
@@ -226,7 +225,8 @@ pub struct Body {
226 pub params: Vec<PatId>, 225 pub params: Vec<PatId>,
227 /// The `ExprId` of the actual body expression. 226 /// The `ExprId` of the actual body expression.
228 pub body_expr: ExprId, 227 pub body_expr: ExprId,
229 pub item_scope: ItemScope, 228 /// Block expressions in this body that may contain inner items.
229 pub block_scopes: Vec<BlockId>,
230 _c: Count<Self>, 230 _c: Count<Self>,
231} 231}
232 232
@@ -295,7 +295,7 @@ impl Body {
295 } 295 }
296 }; 296 };
297 let expander = Expander::new(db, file_id, module); 297 let expander = Expander::new(db, file_id, module);
298 let (body, source_map) = Body::new(db, def, expander, params, body); 298 let (body, source_map) = Body::new(db, expander, params, body);
299 (Arc::new(body), Arc::new(source_map)) 299 (Arc::new(body), Arc::new(source_map))
300 } 300 }
301 301
@@ -305,12 +305,11 @@ impl Body {
305 305
306 fn new( 306 fn new(
307 db: &dyn DefDatabase, 307 db: &dyn DefDatabase,
308 def: DefWithBodyId,
309 expander: Expander, 308 expander: Expander,
310 params: Option<ast::ParamList>, 309 params: Option<ast::ParamList>,
311 body: Option<ast::Expr>, 310 body: Option<ast::Expr>,
312 ) -> (Body, BodySourceMap) { 311 ) -> (Body, BodySourceMap) {
313 lower::lower(db, def, expander, params, body) 312 lower::lower(db, expander, params, body)
314 } 313 }
315} 314}
316 315