Add unwrap_unsafe_binder and wrap_unsafe_binder macro operators

This commit is contained in:
Michael Goulet
2024-09-13 14:00:10 -04:00
parent 2a9e358c72
commit 3f97c6be8d
25 changed files with 222 additions and 12 deletions

View File

@@ -1542,6 +1542,19 @@ impl<'a> State<'a> {
self.word(")");
}
hir::ExprKind::UnsafeBinderCast(kind, expr, ty) => {
match kind {
hir::UnsafeBinderCastKind::Wrap => self.word("wrap_binder!("),
hir::UnsafeBinderCastKind::Unwrap => self.word("unwrap_binder!("),
}
self.print_expr(expr);
if let Some(ty) = ty {
self.word(",");
self.space();
self.print_type(ty);
}
self.word(")");
}
hir::ExprKind::Yield(expr, _) => {
self.word_space("yield");
self.print_expr_cond_paren(expr, expr.precedence() < ExprPrecedence::Jump);