-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Modify some parser diagnostics to continue evaluating beyond the parser #57540
Conversation
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
Is it possible to flip the default and introduce |
In the previous PRs (#57379, #57272 etc) I adjusted tests so they don't report errors that are not related to the point of the test and are not consequences of recovery (e.g. unresolved names, missing |
src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.stderr
Outdated
Show resolved
Hide resolved
Makes sense. EDIT: I just realized that we still need to use
I'd like to have some regression tests to make sure that the parser doesn't suddenly start blocking further processing again by accident. Do you think it makes sense to have a few marked explicitly that way? |
| | ||
LL | where Q: for <#[rustc_1] 'a, 'b, #[oops]> Fn(RefIntPair<'a,'b>) -> &'b u32 | ||
| ^^^^^^^ | ||
LL | where Q: for <#[allow(unused)] 'a, 'b, #[oops]> Fn(RefIntPair<'a,'b>) -> &'b u32 |
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 didn't know we could have attributes annotating lifetimes, 2) we have no attributes to annotate lifetimes or type arguments at this time :)
Hmm, looks like that would require touching a lot of other code because behavior of
Yes, it would be good to have a single dedicated test rather than "accidental" errors here and there. |
@bors r+ |
📌 Commit 28ea03e has been approved by |
Modify some parser diagnostics to continue evaluating beyond the parser Continue evaluating further errors after parser errors on: - trailing type argument attribute - lifetime in incorrect location - incorrect binary literal - missing `for` in `impl Trait for Foo` - type argument in `where` clause - incorrect float literal - incorrect `..` in pattern - associated types - incorrect discriminator value variant error and others. All of these were found by making `continue-parse-after-error` `true` by default to identify errors that would need few changes. There are now only a handful of errors that have any change with `continue-parse-after-error` enabled. These changes make it so `rust` _won't_ stop evaluation after finishing parsing, enabling type checking errors to be displayed on the existing code without having to fix the parse errors. Each commit has an individual diagnostic change with their corresponding tests. CC rust-lang#48724.
Modify some parser diagnostics to continue evaluating beyond the parser Continue evaluating further errors after parser errors on: - trailing type argument attribute - lifetime in incorrect location - incorrect binary literal - missing `for` in `impl Trait for Foo` - type argument in `where` clause - incorrect float literal - incorrect `..` in pattern - associated types - incorrect discriminator value variant error and others. All of these were found by making `continue-parse-after-error` `true` by default to identify errors that would need few changes. There are now only a handful of errors that have any change with `continue-parse-after-error` enabled. These changes make it so `rust` _won't_ stop evaluation after finishing parsing, enabling type checking errors to be displayed on the existing code without having to fix the parse errors. Each commit has an individual diagnostic change with their corresponding tests. CC rust-lang#48724.
Rollup of 8 pull requests Successful merges: - #57043 (Fix poor worst case performance of set intersection) - #57480 (Clean up and fix a bug in query plumbing) - #57481 (provide suggestion for invalid boolean cast) - #57540 (Modify some parser diagnostics to continue evaluating beyond the parser) - #57570 (Querify local `plugin_registrar_fn` and `proc_macro_decls_static`) - #57572 (Unaccept `extern_in_paths`) - #57585 (Recover from item trailing semicolon) - #57589 (Add a debug_assert to Vec::set_len) Failed merges: r? @ghost
Continue evaluating further errors after parser errors on:
for
inimpl Trait for Foo
where
clause..
in patternand others. All of these were found by making
continue-parse-after-error
true
by default to identify errors that would need few changes. There are now only a handful of errors that have any change withcontinue-parse-after-error
enabled.These changes make it so
rust
won't stop evaluation after finishing parsing, enabling type checking errors to be displayed on the existing code without having to fix the parse errors.Each commit has an individual diagnostic change with their corresponding tests.
CC #48724.