Accept .. in incorrect position to avoid further errors#51201
Accept .. in incorrect position to avoid further errors#51201bors merged 3 commits intorust-lang:masterfrom
.. in incorrect position to avoid further errors#51201Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
src/libsyntax/parse/parser.rs
Outdated
There was a problem hiding this comment.
This should be avoidable.
There was a problem hiding this comment.
Leftover from a false positive in a previous iteration of the code.
src/libsyntax/parse/parser.rs
Outdated
There was a problem hiding this comment.
Usually after rewrites like this accidental mistakes happen and parser suddenly starts silently accept double commas or something like this, but I'd never notice it in a diff like this, so let's hope our test suite is good enough!
There was a problem hiding this comment.
I made a cursory test and the behavior when encountering multiple commas hasn't changed, the parser fails and no attempt at recovery is made.
|
r=me after fixing tidy |
8254f5f to
2bdbc77
Compare
This comment has been minimized.
This comment has been minimized.
|
@bors r=petrochenkov |
|
📌 Commit 78d82df has been approved by |
This comment has been minimized.
This comment has been minimized.
We currently give a specific message when encountering a `..` anywhere other than the end of a pattern. Modify the parser to accept it (while still emitting the error) so that we don't also trigger "missing fields in pattern" errors afterwards.
When using `..` somewhere other than the end, parse the rest of the pattern correctly while still emitting an error. Add suggestions to either remove trailing `,` or moving the `..` to the end.
|
@bors r=petrochenkov |
|
📌 Commit d66d35b has been approved by |
Accept `..` in incorrect position to avoid further errors We currently give a specific message when encountering a `..` anywhere other than the end of a pattern. Modify the parser to accept it (while still emitting the error) so that we don't also trigger "missing fields in pattern" errors afterwards. Add suggestions to either remove trailing `,` or moving the `..` to the end. Follow up to rust-lang#49268.
|
⌛ Testing commit d66d35b with merge eed6924b27375b8a6a2ee6c7454840e9a3a8aeb5... |
|
💔 Test failed - status-travis |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@bors retry -- network error |
Accept `..` in incorrect position to avoid further errors We currently give a specific message when encountering a `..` anywhere other than the end of a pattern. Modify the parser to accept it (while still emitting the error) so that we don't also trigger "missing fields in pattern" errors afterwards. Add suggestions to either remove trailing `,` or moving the `..` to the end. Follow up to #49268.
|
☀️ Test successful - status-appveyor, status-travis |
We currently give a specific message when encountering a
..anywhereother than the end of a pattern. Modify the parser to accept it (while
still emitting the error) so that we don't also trigger "missing fields
in pattern" errors afterwards.
Add suggestions to either remove trailing
,or moving the..to theend.
Follow up to #49268.