-
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
On outer attr not found, avoid knock-down errors #118511
Conversation
r? @TaKO8Ki (rustbot has picked a reviewer for you, use r? to override) |
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.
Other than the suggestion from compiler-errors, r=me
When we encounter code like ```rust struct S; fn main() { S.clone(); } ``` we avoid emitting errors about the `derive` (which isn't early resolved as normal, but *has* a later resolution) and stop the compiler from advancing to later stages, to avoid knock down errors from the `derive` not being evaluated. Recovering these would be possible, but would produce incorrect errors in the cases where had the outer attribute been present it would have modified the behavior/evaluation of the `derive` attributes. Fix rust-lang#118455.
9e404df
to
c0ebfe9
Compare
@bors r=TaKO8Ki |
can we hold on this PR since it will conflict with #118533 My PR may suppress more these kinds of errors by checking builtin macros and attrs. Let's wait for @petrochenkov 's comments. |
@chenyukang Ok. I will cancel my approval temporarily. @bors r- |
☔ The latest upstream changes (presumably #119751) made this pull request unmergeable. Please resolve the merge conflicts. |
Closing in favor of #118533. |
When we encounter code like
we avoid emitting errors about the
derive
(which isn't early resolved as normal, but has a later resolution) and stop the compiler from advancing to later stages, to avoid knock down errors from thederive
not being evaluated. Recovering these would be possible, but would produce incorrect errors in the cases where had the outer attribute been present it would have modified the behavior/evaluation of thederive
attributes.Furthermore, the fan-out of knock down errors caused by this case is incredibly high, easily causing thousands of errors by the introduction of a single incorrect outer attribute in the crate root.
Fix #118455.