-
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
Make diff conflict marker error higher priority than unclosed delimeter #116252
Comments
@rustbot label +T-compiler +A-diagnostics |
Right, this is happens because the unclosed delimiter error is emitted in the lexer ( |
Reading between the line that sounds like it fits in the difficult to implement with only a small amount of value basket. Does this sound right? |
correct, you would have to be able to traverse the previous diagnostic errors already to-be-emitted and then swallow the previous one, I think. I don't know if our diagnostic architecture even allows that? |
We have done similar things by storing some related unemitted DiagnosticBuilders and ferry them around from one stage to the next and only emit them try to find them later through some key (like a Span) and if present we remove it/delay_as_bug, but this is very ad-hoc at the moment. |
So this regressed in #108297 which made unclosed delimiters a hard error. Before, the diff conflict marker error was emitted just fine: stderr
Without being an expert in this field, this should in theory be fixable by moving the conflict marker detection to the tokentree parser in |
When encountering unclosed delimiters during lexing, check for diff markers Fix rust-lang#116252.
Rollup merge of rust-lang#116712 - estebank:issue-116252, r=petrochenkov When encountering unclosed delimiters during lexing, check for diff markers Fix rust-lang#116252.
I tried this code:
I expected to see this happen: explanation
error: encountered diff marker
Instead, this happened: explanation
error: this file contains an unclosed delimiter
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: