summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_ast_pretty/src/pprust/state
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /compiler/rustc_ast_pretty/src/pprust/state
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_ast_pretty/src/pprust/state')
-rw-r--r--compiler/rustc_ast_pretty/src/pprust/state/expr.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
index 1142d4921..edbc35003 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
@@ -445,8 +445,8 @@ impl<'a> State<'a> {
self.ibox(0);
self.print_block_with_attrs(blk, attrs);
}
- ast::ExprKind::Async(capture_clause, blk) => {
- self.word_nbsp("async");
+ ast::ExprKind::Gen(capture_clause, blk, kind) => {
+ self.word_nbsp(kind.modifier());
self.print_capture_clause(*capture_clause);
// cbox/ibox in analogy to the `ExprKind::Block` arm above
self.cbox(0);
@@ -673,7 +673,7 @@ impl<'a> State<'a> {
fn print_capture_clause(&mut self, capture_clause: ast::CaptureBy) {
match capture_clause {
- ast::CaptureBy::Value => self.word_space("move"),
+ ast::CaptureBy::Value { .. } => self.word_space("move"),
ast::CaptureBy::Ref => {}
}
}
@@ -684,8 +684,8 @@ pub fn reconstruct_format_args_template_string(pieces: &[FormatArgsPiece]) -> St
for piece in pieces {
match piece {
FormatArgsPiece::Literal(s) => {
- for c in s.as_str().escape_debug() {
- template.push(c);
+ for c in s.as_str().chars() {
+ template.extend(c.escape_debug());
if let '{' | '}' = c {
template.push(c);
}