-
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
rustc: Filter out bogus extern crate warnings #46405
Merged
Merged
Conversation
This file contains 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
Rustdoc has for some time now used the "everybody loops" pass in the compiler to avoid typechecking and otherwise avoid looking at implementation details. In rust-lang#46115 the placement of this pass was pushed back in the compiler to after macro expansion to ensure that it works with macro-expanded code as well. This in turn caused the regression in rust-lang#46271. The bug here was that the resolver was producing `def_id` instances for "possibly unused extern crates" which would then later get processed during typeck to actually issue lint warnings. The problem was that *after* resolution these `def_id` nodes were actually removed from the AST by the "everybody loops" pass. This later, when we tried to take a look at `def_id`, caused the compiler to panic. The fix applied here is a bit of a heavy hammer which is to just, in this one case, ignore the `extern crate` lints if the `def_id` looks "bogus" in any way (basically if it looks like the node was removed after resolution). The real underlying bug here is probably that the "everybody loops" AST pass is being stressed to much beyond what it was originally intended to do, but this should at least fix the ICE for now... Closes rust-lang#46271
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
kennytm
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Nov 30, 2017
@bors r+ rollup |
📌 Commit 4e74eb5 has been approved by |
estebank
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Nov 30, 2017
Since it's a critical bug, I give it a high priority. @bors: p=10 |
kennytm
added a commit
to kennytm/rust
that referenced
this pull request
Dec 1, 2017
rustc: Filter out bogus extern crate warnings Rustdoc has for some time now used the "everybody loops" pass in the compiler to avoid typechecking and otherwise avoid looking at implementation details. In rust-lang#46115 the placement of this pass was pushed back in the compiler to after macro expansion to ensure that it works with macro-expanded code as well. This in turn caused the regression in rust-lang#46271. The bug here was that the resolver was producing `def_id` instances for "possibly unused extern crates" which would then later get processed during typeck to actually issue lint warnings. The problem was that *after* resolution these `def_id` nodes were actually removed from the AST by the "everybody loops" pass. This later, when we tried to take a look at `def_id`, caused the compiler to panic. The fix applied here is a bit of a heavy hammer which is to just, in this one case, ignore the `extern crate` lints if the `def_id` looks "bogus" in any way (basically if it looks like the node was removed after resolution). The real underlying bug here is probably that the "everybody loops" AST pass is being stressed to much beyond what it was originally intended to do, but this should at least fix the ICE for now... Closes rust-lang#46271
This was referenced Dec 1, 2017
@GuillaumeGomez The p=10 has no effect when rollup is still active 😕. |
@kennytm sorry about that, didn't realize that was a side effect :-/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
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.
Rustdoc has for some time now used the "everybody loops" pass in the compiler to
avoid typechecking and otherwise avoid looking at implementation details.
In #46115 the placement of this pass was pushed back in the compiler to after
macro expansion to ensure that it works with macro-expanded code as well. This
in turn caused the regression in #46271.
The bug here was that the resolver was producing
def_id
instances for"possibly unused extern crates" which would then later get processed during
typeck to actually issue lint warnings. The problem was that after resolution
these
def_id
nodes were actually removed from the AST by the "everybody loops"pass. This later, when we tried to take a look at
def_id
, caused the compilerto panic.
The fix applied here is a bit of a heavy hammer which is to just, in this one
case, ignore the
extern crate
lints if thedef_id
looks "bogus" in any way(basically if it looks like the node was removed after resolution). The real
underlying bug here is probably that the "everybody loops" AST pass is being
stressed to much beyond what it was originally intended to do, but this should
at least fix the ICE for now...
Closes #46271