Remove MacDelimiter
.
It's the same as `Delimiter`, minus the `Invisible` variant. I'm generally in favour of using types to make impossible states unrepresentable, but this one feels very low-value, and the conversions between the two types are annoying and confusing. Look at the change in `src/tools/rustfmt/src/expr.rs` for an example: the old code converted from `MacDelimiter` to `Delimiter` and back again, for no good reason. This suggests the author was confused about the types.
This commit is contained in:
parent
ba294a816b
commit
d75ee2a6bc
13 changed files with 37 additions and 67 deletions
|
@ -2599,7 +2599,7 @@ impl<'a> Parser<'a> {
|
|||
|
||||
// Recover from missing expression in `for` loop
|
||||
if matches!(expr.kind, ExprKind::Block(..))
|
||||
&& !matches!(self.token.kind, token::OpenDelim(token::Delimiter::Brace))
|
||||
&& !matches!(self.token.kind, token::OpenDelim(Delimiter::Brace))
|
||||
&& self.may_recover()
|
||||
{
|
||||
self.sess
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue