summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_ast_pretty/src/pprust/state
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /compiler/rustc_ast_pretty/src/pprust/state
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+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.rs5
-rw-r--r--compiler/rustc_ast_pretty/src/pprust/state/item.rs28
2 files changed, 20 insertions, 13 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
index 87c32ffce..609920180 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
@@ -537,6 +537,11 @@ impl<'a> State<'a> {
self.print_expr_maybe_paren(expr, parser::PREC_JUMP);
}
}
+ ast::ExprKind::Become(result) => {
+ self.word("become");
+ self.word(" ");
+ self.print_expr_maybe_paren(result, parser::PREC_JUMP);
+ }
ast::ExprKind::InlineAsm(a) => {
// FIXME: This should have its own syntax, distinct from a macro invocation.
self.word("asm!");
diff --git a/compiler/rustc_ast_pretty/src/pprust/state/item.rs b/compiler/rustc_ast_pretty/src/pprust/state/item.rs
index c465f8c94..5c01b7ea7 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state/item.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state/item.rs
@@ -623,19 +623,8 @@ impl<'a> State<'a> {
pub fn print_where_predicate(&mut self, predicate: &ast::WherePredicate) {
match predicate {
- ast::WherePredicate::BoundPredicate(ast::WhereBoundPredicate {
- bound_generic_params,
- bounded_ty,
- bounds,
- ..
- }) => {
- self.print_formal_generic_params(bound_generic_params);
- self.print_type(bounded_ty);
- self.word(":");
- if !bounds.is_empty() {
- self.nbsp();
- self.print_type_bounds(bounds);
- }
+ ast::WherePredicate::BoundPredicate(where_bound_predicate) => {
+ self.print_where_bound_predicate(where_bound_predicate);
}
ast::WherePredicate::RegionPredicate(ast::WhereRegionPredicate {
lifetime,
@@ -658,6 +647,19 @@ impl<'a> State<'a> {
}
}
+ pub fn print_where_bound_predicate(
+ &mut self,
+ where_bound_predicate: &ast::WhereBoundPredicate,
+ ) {
+ self.print_formal_generic_params(&where_bound_predicate.bound_generic_params);
+ self.print_type(&where_bound_predicate.bounded_ty);
+ self.word(":");
+ if !where_bound_predicate.bounds.is_empty() {
+ self.nbsp();
+ self.print_type_bounds(&where_bound_predicate.bounds);
+ }
+ }
+
fn print_use_tree(&mut self, tree: &ast::UseTree) {
match &tree.kind {
ast::UseTreeKind::Simple(rename) => {