-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Parse qualified paths in type params and provide custom diagnostic #60323
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
When #52662 (cc) becomes stable we can suggest that instead. |
@petrochenkov Do you have opinions on this? Do you even want to review it maybe? |
I'm generally unhappy about parsing random specific constructions in random positions just because someone made a ticket. Perhaps the "consider adding an explicit lifetime bound ::TrSubtype: 'a" suggestion should instead mention |
@petrochenkov beyond the specifics of this ticket in particular, I believe the parser should be able to parse a superset of valid code for things that are either correct in other languages ( |
I don't have an opinion on the specifics of this PR; but in general, is this really true? |
@Centril I have a few dozen coworkers writing Rust. Anecdotally, I have only seen three people in a little less than a year file a I can certainly see that there are some really obscure corner cases (like this one) that might not be worth complicating the parser for, but any ticket that has either "+1" style comments or duplicates tells me that the amount of people actually encountering that problem is probably >100, and those numbers are only going to increase as the community expands. Not every diagnostic is born equal, but just as much as following the Pareto curve let's us focus most of our attention to the cases that come up 80% the time, I think we should give some attention to the long tail cases, particularly if . I'm also empathetic to needing to clean up the happy path code and make diagnostics code unobtrusive. This is something that myself and others are planning to work on once we have a large enough chunk of time to do so: it's at the top of our priorities for this year. |
@estebank If there are duplicates and "me too" comments on such diagnostics issues then I think there's a strong case for the improvement benefiting many people. I mainly think that it's not necessarily true that if there's a single issue reporting something obscure, that it will affect many folks and that it therefore many not deserve special attention.
❤️ |
Agree entirely.
My concerns are mostly about particularities and specific PRs, not about improving error recovery in general.
Here's where I disagree.
That's arguable. Even if an issue is real and closing it is a positive, we should still try balance it with less noticeable and more long term goals, and attempt to 1) fix it as non-intrusively as possible (only wording, ideally) and 2) generalize to increase the positive effect (while not increasing intrusiveness). In case of this PR a wording-only solution (mentioning (I'm not going to go on a crusade and block PRs that provide unbalanced solutions to diagnostic issues, but I'll probably still going to nag people about this from time to time, because the priorities need to be adjusted more in favor of the compiler maintainability.) |
@estebank Perhaps leave a FIXME for the replacement when the RFC stabilizes? |
r? @petrochenkov, if you don't mind. |
Oh no. |
@petrochenkov I have PR I'm working on to split |
Yeah, that would be nice, this is not an urgent issue. |
Fix #26271.