From 45a83d18cc71fa4d7972d38c9302253ddec1c6cb Mon Sep 17 00:00:00 2001 From: Marcus Klaas Date: Fri, 15 Apr 2016 17:56:08 +0200 Subject: Format type ascription --- src/expr.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/expr.rs b/src/expr.rs index a88e7ee6d19..b5be60cf052 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -177,6 +177,9 @@ impl Rewrite for ast::Expr { ast::ExprKind::Cast(ref expr, ref ty) => { rewrite_pair(&**expr, &**ty, "", " as ", "", context, width, offset) } + ast::ExprKind::Type(ref expr, ref ty) => { + rewrite_pair(&**expr, &**ty, "", ": ", "", context, width, offset) + } ast::ExprKind::Index(ref expr, ref index) => { rewrite_pair(&**expr, &**index, "", "[", "]", context, width, offset) } @@ -210,8 +213,6 @@ impl Rewrite for ast::Expr { // satisfy our width restrictions. ast::ExprKind::InPlace(..) | ast::ExprKind::InlineAsm(..) | - // TODO(#848): Handle type ascription - ast::ExprKind::Type(_, _) | // TODO(#867): Handle try shorthand ast::ExprKind::Try(_) => { wrap_str(context.snippet(self.span), -- cgit 1.4.1-3-g733a5