diff options
| author | Michael Goulet <michael@errs.io> | 2024-09-13 14:00:10 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-12-12 16:29:40 +0000 |
| commit | 3f97c6be8d4b78c9df55804171c588ebfadcb63e (patch) | |
| tree | cdf10693da1f8085020f11bf6051d3b6747b6386 /compiler/rustc_ast_pretty | |
| parent | 2a9e358c723b03cc6adbce9c2c5af36cb2d83914 (diff) | |
| download | rust-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.rs | 19 |
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*/"); |
