about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNick Cameron <nrc@ncameron.org>2016-04-16 16:42:56 +1200
committerNick Cameron <nrc@ncameron.org>2016-04-16 16:42:56 +1200
commit41e037da7ede08d648ca196cbbba12b450aa2c8b (patch)
treed65b1849b1e886282368ef84f1bcd37fd593fa98 /src
parentf70d306b838b8336bd737234184020542a8b535c (diff)
parent45a83d18cc71fa4d7972d38c9302253ddec1c6cb (diff)
Merge pull request #941 from marcusklaas/type-ascription
Format type ascription
Diffstat (limited to 'src')
-rw-r--r--src/expr.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/expr.rs b/src/expr.rs
index 057a0ef1056..90ccb87e2d4 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),