summaryrefslogtreecommitdiff
path: root/compiler/rustc_hir_pretty/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_hir_pretty/src/lib.rs')
-rw-r--r--compiler/rustc_hir_pretty/src/lib.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs
index 2db4f1e50d4..d93e8efc1b5 100644
--- a/compiler/rustc_hir_pretty/src/lib.rs
+++ b/compiler/rustc_hir_pretty/src/lib.rs
@@ -1407,10 +1407,16 @@ impl<'a> State<'a> {
self.print_type(ty);
}
hir::ExprKind::Type(expr, ty) => {
- let prec = AssocOp::Colon.precedence() as i8;
- self.print_expr_maybe_paren(expr, prec);
- self.word_space(":");
+ self.word("type_ascribe!(");
+ self.ibox(0);
+ self.print_expr(expr);
+
+ self.word(",");
+ self.space_if_not_bol();
self.print_type(ty);
+
+ self.end();
+ self.word(")");
}
hir::ExprKind::DropTemps(init) => {
// Print `{`: