Make ExprKind::Closure
a struct variant.
This commit is contained in:
parent
fa68e73e99
commit
3039cfeb6a
75 changed files with 251 additions and 216 deletions
|
@ -66,8 +66,8 @@ fn mir_build(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> Body<'_
|
|||
|
||||
// Figure out what primary body this item has.
|
||||
let (body_id, return_ty_span, span_with_body) = match tcx.hir().get(id) {
|
||||
Node::Expr(hir::Expr { kind: hir::ExprKind::Closure(_, decl, body_id, _, _), .. }) => {
|
||||
(*body_id, decl.output.span(), None)
|
||||
Node::Expr(hir::Expr { kind: hir::ExprKind::Closure { fn_decl, body, .. }, .. }) => {
|
||||
(*body, fn_decl.output.span(), None)
|
||||
}
|
||||
Node::Item(hir::Item {
|
||||
kind: hir::ItemKind::Fn(hir::FnSig { decl, .. }, _, body_id),
|
||||
|
|
|
@ -418,7 +418,7 @@ impl<'tcx> Cx<'tcx> {
|
|||
}
|
||||
},
|
||||
|
||||
hir::ExprKind::Closure(..) => {
|
||||
hir::ExprKind::Closure { .. } => {
|
||||
let closure_ty = self.typeck_results().expr_ty(expr);
|
||||
let (def_id, substs, movability) = match *closure_ty.kind() {
|
||||
ty::Closure(def_id, substs) => (def_id, UpvarSubsts::Closure(substs), None),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue