Skip to content
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

Fix rustdoc ICE on macros defined within functions #47959

Merged
merged 2 commits into from
Feb 6, 2018

Conversation

Manishearth
Copy link
Member

fixes #47639

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@Manishearth
Copy link
Member Author

r? @QuietMisdreavus

@Manishearth Manishearth added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Feb 2, 2018
@kennytm kennytm added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 2, 2018
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// This should not ICE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[00:05:40] tidy error: /checkout/src/test/rustdoc/issue-47639.rs:11: trailing whitespace

@Manishearth
Copy link
Member Author

Manishearth commented Feb 2, 2018 via email

@kennytm kennytm added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 2, 2018
@QuietMisdreavus
Copy link
Member

Seeking a second opinion. Does someone on @rust-lang/compiler have a better grasp of the ramifications of turning off the "buffered-but-not-fired lints are bugs" functionality when running as rustdoc? @jseyfried? Something about "just patching out the line that panics" seems off, but then again the "everybody loops" pass is also a bit strange, so maybe it balances out.

@Manishearth
Copy link
Member Author

The assumption made in that bug! is that all linted nodes must be visited. This is an invariant that holds true in the absence of the everybody-loops pass (and if it were to break it would be problematic), however everybody-loops throws things for a toss by removing nodes wholesale. Proc macros can also remove nodes, but not after they get linted (admittedly a shaky way of holding up the invariant, but hey, that's why we have the bug!)

A more robust solution would be to note down the macros removed by everybody-loops but imo that's a bit like overkill.

@Mark-Simulacrum
Copy link
Member

Could we instead gate this check on whether everybody loops pass was run? Not sure whether that's better necessarily, but it seems at least like a minor improvement.

@Manishearth
Copy link
Member Author

Manishearth commented Feb 2, 2018 via email

@Mark-Simulacrum
Copy link
Member

Hm. Yeah, let's not change anything then unless the compiler team decides on something. Is there a chance you could prepare a PR to backport this (minimal) fix to beta? It seems like the smallest change we can make that should fix this regression and I'd like to get it on beta ASAP.

@Manishearth
Copy link
Member Author

done: #47969

won't be around for a while, feel free to force push to that branch or whatever to get it landed

// node ids to not exist (e.g. macros defined within functions for the
// unused_macro lint) anymore. So we only run this check
// when we're not in rustdoc mode. (see issue #47639)
if !sess.opts.actually_rustdoc {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually_rustdoc is pre-existing?!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh this is not CLI-facing, just an internal flag used for literally causing the problem here.

bors added a commit that referenced this pull request Feb 3, 2018
Backport rustdoc ICE fixes to beta

backport of #47959
@Manishearth
Copy link
Member Author

Anyway, r?

We've landed the beta one so this isn't urgent anymore but nightly is still broken.

@Mark-Simulacrum Mark-Simulacrum added beta-accepted Accepted for backporting to the compiler in the beta channel. and removed beta-nominated Nominated for backporting to the compiler in the beta channel. labels Feb 4, 2018
@Mark-Simulacrum
Copy link
Member

I think we should land this and perhaps iterate later if necessary. If anyone objects, feel free to r-

@bors r+

@bors
Copy link
Contributor

bors commented Feb 4, 2018

📌 Commit ee737c7 has been approved by Mark-Simulacrum

@kennytm kennytm 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 Feb 4, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Feb 5, 2018
…ulacrum

Fix rustdoc ICE on macros defined within functions

fixes rust-lang#47639
bors added a commit that referenced this pull request Feb 6, 2018
Rollup of 10 pull requests

- Successful merges: #46030, #47496, #47543, #47704, #47753, #47807, #47948, #47959, #48003, #48007
- Failed merges:
@bors bors merged commit ee737c7 into rust-lang:master Feb 6, 2018
@Manishearth Manishearth deleted the rustdoc-ice branch February 16, 2018 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE building docs of some crates in beta
8 participants