Skip to content

Commit 2791cc3

Browse files
committed
Teach parser to understand fake anonymous enum syntax
Parse `-> Ty | OtherTy`. Parse type ascription in top level patterns.
1 parent 19c2286 commit 2791cc3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/types.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,9 @@ impl Rewrite for ast::Ty {
839839
})
840840
}
841841
ast::TyKind::CVarArgs => Some("...".to_owned()),
842-
ast::TyKind::Err => Some(context.snippet(self.span).to_owned()),
842+
ast::TyKind::AnonEnum(_) | ast::TyKind::Err => {
843+
Some(context.snippet(self.span).to_owned())
844+
}
843845
ast::TyKind::Typeof(ref anon_const) => rewrite_call(
844846
context,
845847
"typeof",

0 commit comments

Comments
 (0)