Use CreateParameter mode for closures too.
This commit is contained in:
parent
32af719b07
commit
7437136f0e
6 changed files with 83 additions and 65 deletions
|
@ -1932,6 +1932,7 @@ pub enum ExprKind<'hir> {
|
|||
/// `Option<Movability>`.
|
||||
Closure {
|
||||
capture_clause: CaptureBy,
|
||||
bound_generic_params: &'hir [GenericParam<'hir>],
|
||||
fn_decl: &'hir FnDecl<'hir>,
|
||||
body: BodyId,
|
||||
fn_decl_span: Span,
|
||||
|
@ -3480,7 +3481,7 @@ impl<'hir> Node<'hir> {
|
|||
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
|
||||
mod size_asserts {
|
||||
rustc_data_structures::static_assert_size!(super::Block<'static>, 48);
|
||||
rustc_data_structures::static_assert_size!(super::Expr<'static>, 56);
|
||||
rustc_data_structures::static_assert_size!(super::Expr<'static>, 64);
|
||||
rustc_data_structures::static_assert_size!(super::Pat<'static>, 88);
|
||||
rustc_data_structures::static_assert_size!(super::QPath<'static>, 24);
|
||||
rustc_data_structures::static_assert_size!(super::Ty<'static>, 72);
|
||||
|
|
|
@ -1169,12 +1169,16 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr<'v>)
|
|||
walk_list!(visitor, visit_arm, arms);
|
||||
}
|
||||
ExprKind::Closure {
|
||||
bound_generic_params,
|
||||
ref fn_decl,
|
||||
body,
|
||||
capture_clause: _,
|
||||
fn_decl_span: _,
|
||||
movability: _,
|
||||
} => visitor.visit_fn(FnKind::Closure, fn_decl, body, expression.span, expression.hir_id),
|
||||
} => {
|
||||
walk_list!(visitor, visit_generic_param, bound_generic_params);
|
||||
visitor.visit_fn(FnKind::Closure, fn_decl, body, expression.span, expression.hir_id)
|
||||
}
|
||||
ExprKind::Block(ref block, ref opt_label) => {
|
||||
walk_list!(visitor, visit_label, opt_label);
|
||||
visitor.visit_block(block);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue