Fix closures within inline const
This commit is contained in:
parent
4060ed7eff
commit
d0f59f6d65
1 changed files with 11 additions and 4 deletions
|
@ -148,11 +148,18 @@ impl<'a, 'tcx> Visitor<'tcx> for InferBorrowKindVisitor<'a, 'tcx> {
|
|||
}
|
||||
|
||||
fn visit_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) {
|
||||
if let hir::ExprKind::Closure(cc, _, body_id, _, _) = expr.kind {
|
||||
match expr.kind {
|
||||
hir::ExprKind::Closure(cc, _, body_id, _, _) => {
|
||||
let body = self.fcx.tcx.hir().body(body_id);
|
||||
self.visit_body(body);
|
||||
self.fcx.analyze_closure(expr.hir_id, expr.span, body_id, body, cc);
|
||||
}
|
||||
hir::ExprKind::ConstBlock(anon_const) => {
|
||||
let body = self.fcx.tcx.hir().body(anon_const.body);
|
||||
self.visit_body(body);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
intravisit::walk_expr(self, expr);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue