rustc: Implement functional record update for structs
This commit is contained in:
parent
1e3143b34e
commit
bff512a90f
10 changed files with 127 additions and 46 deletions
|
@ -478,8 +478,10 @@ fn noop_fold_expr(e: expr_, fld: ast_fold) -> expr_ {
|
|||
fld.fold_expr(e)),
|
||||
expr_assert(e) => expr_assert(fld.fold_expr(e)),
|
||||
expr_mac(mac) => expr_mac(fold_mac(mac)),
|
||||
expr_struct(path, fields) => {
|
||||
expr_struct(fld.fold_path(path), vec::map(fields, fold_field))
|
||||
expr_struct(path, fields, maybe_expr) => {
|
||||
expr_struct(fld.fold_path(path),
|
||||
vec::map(fields, fold_field),
|
||||
option::map(maybe_expr, |x| fld.fold_expr(x)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue