Adds support for immovable generators. Move checking of invalid borrows across suspension points to borrowck. Fixes #44197, #45259 and #45093.

This commit is contained in:
John Kåre Alsaker
2017-10-07 16:36:28 +02:00
parent 47a8eb7c4e
commit ccf0d8399e
60 changed files with 863 additions and 213 deletions

View File

@@ -1235,8 +1235,9 @@ pub fn noop_fold_expr<T: Folder>(Expr {id, node, span, attrs}: Expr, folder: &mu
ExprKind::Match(folder.fold_expr(expr),
arms.move_map(|x| folder.fold_arm(x)))
}
ExprKind::Closure(capture_clause, decl, body, span) => {
ExprKind::Closure(capture_clause, movability, decl, body, span) => {
ExprKind::Closure(capture_clause,
movability,
folder.fold_fn_decl(decl),
folder.fold_expr(body),
folder.new_span(span))