diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2017-10-07 16:36:28 +0200 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2018-01-23 05:10:38 +0100 |
| commit | ccf0d8399e1ef3ed6bf7005650ce42aa646b5cc7 (patch) | |
| tree | 78166bd01ee1a24b9251e6cdf16dd631d3cf65e1 /src/libsyntax/print | |
| parent | 47a8eb7c4e24b61a8a9ab4eaff60ef65291aaa56 (diff) | |
| download | rust-ccf0d8399e1ef3ed6bf7005650ce42aa646b5cc7.tar.gz rust-ccf0d8399e1ef3ed6bf7005650ce42aa646b5cc7.zip | |
Adds support for immovable generators. Move checking of invalid borrows across suspension points to borrowck. Fixes #44197, #45259 and #45093.
Diffstat (limited to 'src/libsyntax/print')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index ff065b57b8d..345c592a011 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -2162,7 +2162,8 @@ impl<'a> State<'a> { } self.bclose_(expr.span, INDENT_UNIT)?; } - ast::ExprKind::Closure(capture_clause, ref decl, ref body, _) => { + ast::ExprKind::Closure(capture_clause, movability, ref decl, ref body, _) => { + self.print_movability(movability)?; self.print_capture_clause(capture_clause)?; self.print_fn_block_args(decl)?; @@ -2777,6 +2778,14 @@ impl<'a> State<'a> { } } + pub fn print_movability(&mut self, movability: ast::Movability) + -> io::Result<()> { + match movability { + ast::Movability::Static => self.word_space("static"), + ast::Movability::Movable => Ok(()), + } + } + pub fn print_capture_clause(&mut self, capture_clause: ast::CaptureBy) -> io::Result<()> { match capture_clause { |
