mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Allow storing defs in bodies
This commit is contained in:
parent
b2731ab78a
commit
5bd8de3f5e
@ -17,7 +17,7 @@ use crate::{
|
||||
nameres::{BuiltinShadowMode, CrateDefMap},
|
||||
path::{ModPath, Path},
|
||||
src::HasSource,
|
||||
DefWithBodyId, HasModule, Lookup, ModuleId,
|
||||
DefWithBodyId, HasModule, Lookup, ModuleDefId, ModuleId,
|
||||
};
|
||||
|
||||
struct Expander {
|
||||
@ -119,6 +119,7 @@ pub struct Body {
|
||||
pub params: Vec<PatId>,
|
||||
/// The `ExprId` of the actual body expression.
|
||||
pub body_expr: ExprId,
|
||||
pub defs: Vec<ModuleDefId>,
|
||||
}
|
||||
|
||||
pub type ExprPtr = Either<AstPtr<ast::Expr>, AstPtr<ast::RecordField>>;
|
||||
|
@ -41,6 +41,7 @@ pub(super) fn lower(
|
||||
pats: Arena::default(),
|
||||
params: Vec::new(),
|
||||
body_expr: ExprId::dummy(),
|
||||
defs: Vec::new(),
|
||||
},
|
||||
}
|
||||
.collect(params, body)
|
||||
|
Loading…
Reference in New Issue
Block a user