do catch
should also be allowed before blocks
#42528
Labels
A-parser
Area: The lexing & parsing of Rust source code to an AST
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
Currently
do catch
can't appear before blocks.One has to enclose the
do catch
with parentheses.I think it is inconsistent with the behavior like this:
The
RESTRICTION_NO_STRUCT_LITERAL
is mainly used to distinguishif x == (A { .. }) { .. }
fromif x == A { .. }
and unnecessary fordo catch {}
where{}
definitely comes here.At least the emitted warning for
(do catch { .. })
is wrong and the emitted error fordo catch { .. }
is unhelpful for now.The text was updated successfully, but these errors were encountered: