-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
parser: reduce diversity in error handling mechanisms #67744
Conversation
| ^ unexpected `(` after qualified path | ||
| ------------------^ unexpected `(` after qualified path | ||
| | | ||
| the qualified path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could make this recover, but then the vec![...] =>
recovery has to go away (and I think it should, because it is causing problems in #66364 as well).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be a shame to lose it entirely, but if it improves this case it might be worth it. For the vec case if we lose the suggestion at least it should recover gracefully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to have the vec![...]
work with resolve instead of first checking if there is an error in expansion (i.e. check if the path is actually {core,std}::vec
)? Perhaps we can use diagnostic_item
s? It feels like the current encoding of the error is problematic in terms of infrastructure. What do you think @petrochenkov?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The vec![...]
hack is really bad, but I cannot answer whether it can be done it a better way without some investigation.
Finally! |
@bors r+ Perhaps it's time to eliminate |
📌 Commit 2e78061 has been approved by |
Worth a try, I think, 👍. |
…enkov parser: reduce diversity in error handling mechanisms Instead of having e.g. `span_err`, `fatal`, etc., we prefer to move towards uniformly using `struct_span_err` thus making it harder to emit fatal and/or unstructured diagnostics. This PR also de-fatalizes some diagnostics. r? @estebank
Rollup of 6 pull requests Successful merges: - #67574 (Extract `rustc_ast_lowering` crate from `rustc`) - #67685 (Constify Result) - #67702 (Add symbol normalization for proc_macro_server.) - #67730 (Cleanup pattern type checking, fix diagnostics bugs (+ improvements)) - #67744 (parser: reduce diversity in error handling mechanisms) - #67748 (Use function attribute "frame-pointer" instead of "no-frame-pointer-elim") Failed merges: r? @ghost
…chenkov More reductions in error handling diversity In this follow up to rust-lang#67744, we: - Remove all fatal / error / warning macros in `syntax` except for `struct_span_err`, which is moved to `rustc_errors`. - Lintify some hard-coded warnings which used warning macros. - Defatalize some errors. In general, the goal here is to make it painful to use fatal or unstructured errors and so we hopefully won't see many of these creep in.
More reductions in error handling diversity In this follow up to #67744, we: - Remove all fatal / error / warning macros in `syntax` except for `struct_span_err`, which is moved to `rustc_errors`. - Lintify some hard-coded warnings which used warning macros. - Defatalize some errors. In general, the goal here is to make it painful to use fatal or unstructured errors and so we hopefully won't see many of these creep in. Fixes #67933.
Instead of having e.g.
span_err
,fatal
, etc., we prefer to move towards uniformly usingstruct_span_err
thus making it harder to emit fatal and/or unstructured diagnostics.This PR also de-fatalizes some diagnostics.
r? @estebank