On outer attr not found, avoid knock-down errors#118511
Closed
estebank wants to merge 1 commit intorust-lang:masterfrom
Closed
On outer attr not found, avoid knock-down errors#118511estebank wants to merge 1 commit intorust-lang:masterfrom
estebank wants to merge 1 commit intorust-lang:masterfrom
Conversation
Collaborator
|
r? @TaKO8Ki (rustbot has picked a reviewer for you, use r? to override) |
TaKO8Ki
reviewed
Dec 3, 2023
Member
TaKO8Ki
left a comment
There was a problem hiding this comment.
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
Contributor
Author
|
@bors r=TaKO8Ki |
Collaborator
Member
|
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. |
Member
|
@chenyukang Ok. I will cancel my approval temporarily. @bors r- |
Collaborator
|
☔ The latest upstream changes (presumably #119751) made this pull request unmergeable. Please resolve the merge conflicts. |
Contributor
Contributor
|
Closing in favor of #118533. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 thederivenot 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 thederiveattributes.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.