about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/expr.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-08-02 09:56:26 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2023-08-03 09:03:30 +1000
commitd75ee2a6bcfc2ec9b21c0bb1ffaf34ff6b7161f1 (patch)
treed9c3e155ef8f3751de71e8d3578b3f0caea6ab2c /compiler/rustc_parse/src/parser/expr.rs
parentba294a816bd51526b8bf99cb21050f669b8397b0 (diff)
downloadrust-d75ee2a6bcfc2ec9b21c0bb1ffaf34ff6b7161f1.tar.gz
rust-d75ee2a6bcfc2ec9b21c0bb1ffaf34ff6b7161f1.zip
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.
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index 975dafecb10..dc3b131e7f2 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -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