diff options
| author | Nick Cameron <nrc@ncameron.org> | 2016-04-16 16:42:56 +1200 |
|---|---|---|
| committer | Nick Cameron <nrc@ncameron.org> | 2016-04-16 16:42:56 +1200 |
| commit | 41e037da7ede08d648ca196cbbba12b450aa2c8b (patch) | |
| tree | d65b1849b1e886282368ef84f1bcd37fd593fa98 /src | |
| parent | f70d306b838b8336bd737234184020542a8b535c (diff) | |
| parent | 45a83d18cc71fa4d7972d38c9302253ddec1c6cb (diff) | |
Merge pull request #941 from marcusklaas/type-ascription
Format type ascription
Diffstat (limited to 'src')
| -rw-r--r-- | src/expr.rs | 5 |
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), |
