Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diagnostics: incorrect, redundant "expected/found" parse error #33188

Closed
jseyfried opened this issue Apr 25, 2016 · 4 comments
Closed

diagnostics: incorrect, redundant "expected/found" parse error #33188

jseyfried opened this issue Apr 25, 2016 · 4 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jseyfried
Copy link
Contributor

Compiling the following:

struct S(pub () ());

produces:

<anon>:1:17: 1:18 error: expected one of `+` or `,`, found `(`
<anon>:1 struct S(pub () ());
                         ^
<anon>:1:17: 1:18 error: expected one of `+`, `;`, or `where`, found `(`
<anon>:1 struct S(pub () ());
                         ^
@jseyfried
Copy link
Contributor Author

This is not a regression (it is currently an issue on stable).

@petrochenkov
Copy link
Contributor

The first one is correct, () can be followed by a next field (struct S(pub (), u8);) or operand of type sum (struct S(pub () + Send);).
The second one looks like it may be caused by some recent efforts on error recovery in parser, but I'm not sure.

@steveklabnik steveklabnik added the A-diagnostics Area: Messages for errors, warnings, and lints label Jul 25, 2016
@Mark-Simulacrum Mark-Simulacrum added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jul 25, 2017
@estebank
Copy link
Contributor

The underlying reason is the same as in #44339, and the proposed solution can be generalized to also fix this case.

@estebank estebank added the E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. label Sep 22, 2017
@nikomatsakis nikomatsakis added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-compiler-const labels Sep 25, 2017
@nikomatsakis
Copy link
Contributor

Even though this one is older, I am closing it as a duplicate of #44339, which has mentoring instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants