Teach parser to understand fake anonymous enum syntax

Parse `-> Ty | OtherTy`.
Parse type ascription in top level patterns.
This commit is contained in:
Esteban Küber 2023-01-15 22:36:46 +00:00
parent 19c2286d5c
commit 2791cc37e6

View File

@ -839,7 +839,9 @@ impl Rewrite for ast::Ty {
})
}
ast::TyKind::CVarArgs => Some("...".to_owned()),
ast::TyKind::Err => Some(context.snippet(self.span).to_owned()),
ast::TyKind::AnonEnum(_) | ast::TyKind::Err => {
Some(context.snippet(self.span).to_owned())
}
ast::TyKind::Typeof(ref anon_const) => rewrite_call(
context,
"typeof",