about summary refs log tree commit diff
path: root/compiler/rustc_ast_pretty
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-09-13 14:00:10 -0400
committerMichael Goulet <michael@errs.io>2024-12-12 16:29:40 +0000
commit3f97c6be8d4b78c9df55804171c588ebfadcb63e (patch)
treecdf10693da1f8085020f11bf6051d3b6747b6386 /compiler/rustc_ast_pretty
parent2a9e358c723b03cc6adbce9c2c5af36cb2d83914 (diff)
downloadrust-3f97c6be8d4b78c9df55804171c588ebfadcb63e.tar.gz
rust-3f97c6be8d4b78c9df55804171c588ebfadcb63e.zip
Add unwrap_unsafe_binder and wrap_unsafe_binder macro operators
Diffstat (limited to 'compiler/rustc_ast_pretty')
-rw-r--r--compiler/rustc_ast_pretty/src/pprust/state/expr.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
index c239cb249c3..dce76fb1e77 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
@@ -772,6 +772,25 @@ impl<'a> State<'a> {
                 self.word_nbsp("try");
                 self.print_block_with_attrs(blk, attrs)
             }
+            ast::ExprKind::UnsafeBinderCast(kind, expr, ty) => {
+                self.word("builtin # ");
+                match kind {
+                    ast::UnsafeBinderCastKind::Wrap => self.word("wrap_binder"),
+                    ast::UnsafeBinderCastKind::Unwrap => self.word("unwrap_binder"),
+                }
+                self.popen();
+                self.ibox(0);
+                self.print_expr(expr, FixupContext::default());
+
+                if let Some(ty) = ty {
+                    self.word(",");
+                    self.space();
+                    self.print_type(ty);
+                }
+
+                self.end();
+                self.pclose();
+            }
             ast::ExprKind::Err(_) => {
                 self.popen();
                 self.word("/*ERROR*/");