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

Remove LintBuffer from Session #65835

Merged
merged 6 commits into from
Nov 4, 2019

Conversation

Mark-Simulacrum
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum commented Oct 25, 2019

This moves the LintBuffer from Session into the Resolver, where it is used until lowering is done and then consumed by early lint passes. This also happily removes the failure mode of buffering lints too late where it would have previously lead to ICEs; it is statically no longer possible to do so.

I suspect that with a bit more work a similar move could be done for the lint buffer inside ParseSess, but this PR doesn't touch it (in part to keep itself small).

The last commit is the "interesting" commit -- the ones before it don't work (though they compile) as they sort of prepare the various crates for the lint buffer to be passed in rather than accessed through Session.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 25, 2019
@Mark-Simulacrum
Copy link
Member Author

I plan to prepare some similar documentation to what I'm working on now in rust-lang/rustc-dev-guide#476 once this lands -- we don't have a lot that talks about lint buffering today, but I've gained a decent understanding of why we need it in working on this so can write that up.

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

Looks good to me! I left one small suggestion to add a helper method. r=me with that suggestion.

src/librustc_interface/util.rs Outdated Show resolved Hide resolved
src/librustc_interface/util.rs Outdated Show resolved Hide resolved
@petrochenkov petrochenkov self-assigned this Oct 26, 2019
src/librustc_interface/passes.rs Outdated Show resolved Hide resolved
src/librustc_resolve/lib.rs Outdated Show resolved Hide resolved
@Mark-Simulacrum
Copy link
Member Author

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Oct 26, 2019

📌 Commit a44126a has been approved by nikomatsakis

@bors bors 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 Oct 26, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 26, 2019
…, r=nikomatsakis

Remove LintBuffer from Session

This moves the `LintBuffer` from `Session` into the `Resolver`, where it is used until lowering is done and then consumed by early lint passes. This also happily removes the failure mode of buffering lints too late where it would have previously lead to ICEs; it is statically no longer possible to do so.

I suspect that with a bit more work a similar move could be done for the lint buffer inside `ParseSess`, but this PR doesn't touch it (in part to keep itself small).

The last commit is the "interesting" commit -- the ones before it don't work (though they compile) as they sort of prepare the various crates for the lint buffer to be passed in rather than accessed through Session.
@Centril
Copy link
Contributor

Centril commented Oct 27, 2019

Possibly caused failure in #65854 (comment), @bors rollup=never

@bors
Copy link
Contributor

bors commented Oct 27, 2019

☔ The latest upstream changes (presumably #65869) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 27, 2019
@Mark-Simulacrum
Copy link
Member Author

@bors r=nikomatsakis rollup=never

I can't reproduce the rollup failure locally so I suspect/hope it is #65830 that is responsible (that seems more likely than this PR, personally, given the small number of errors, and being limited to dead code, though that PR doesn't look immediately at fault either.

@bors
Copy link
Contributor

bors commented Oct 28, 2019

📌 Commit bdcaedf1572a99a67919f686dd78c307918d9c48 has been approved by nikomatsakis

@bors bors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 28, 2019
@bors
Copy link
Contributor

bors commented Nov 4, 2019

⌛ Testing commit bdcaedf1572a99a67919f686dd78c307918d9c48 with merge d9d421ee53ed6e62dc900005b3db019ccbb4606d...

@rust-highfive
Copy link
Collaborator

The job mingw-check of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-11-04T02:29:54.6616073Z     Checking rustc_resolve v0.0.0 (/checkout/src/librustc_resolve)
2019-11-04T02:29:55.9373034Z error[E0599]: no method named `buffer_lint` found for type `&'b rustc::session::Session` in the current scope
2019-11-04T02:29:55.9376629Z    --> src/librustc_resolve/resolve_imports.rs:982:36
2019-11-04T02:29:55.9378510Z     |
2019-11-04T02:29:55.9379015Z 982 |                     self.r.session.buffer_lint(UNUSED_IMPORTS, directive.id, directive.span, msg);
2019-11-04T02:29:55.9379651Z     |                                    ^^^^^^^^^^^ method not found in `&'b rustc::session::Session`
2019-11-04T02:29:56.0025618Z error: aborting due to previous error
2019-11-04T02:29:56.0026642Z 
2019-11-04T02:29:56.0035113Z For more information about this error, try `rustc --explain E0599`.
2019-11-04T02:29:56.0214828Z error: could not compile `rustc_resolve`.
---
2019-11-04T02:30:07.1722273Z   local time: Mon Nov  4 02:30:07 UTC 2019
2019-11-04T02:30:07.3091555Z   network time: Mon, 04 Nov 2019 02:30:07 GMT
2019-11-04T02:30:07.3094644Z == end clock drift check ==
2019-11-04T02:30:08.5654743Z 
2019-11-04T02:30:08.5751144Z ##[error]Bash exited with code '1'.
2019-11-04T02:30:08.5781169Z ##[section]Starting: Checkout
2019-11-04T02:30:08.5783032Z ==============================================================================
2019-11-04T02:30:08.5783131Z Task         : Get sources
2019-11-04T02:30:08.5783219Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Nov 4, 2019

💔 Test failed - checks-azure

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 4, 2019
@Mark-Simulacrum
Copy link
Member Author

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Nov 4, 2019

📌 Commit c68df7c has been approved by nikomatsakis

@bors bors 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 4, 2019
@bors
Copy link
Contributor

bors commented Nov 4, 2019

⌛ Testing commit c68df7c with merge ab6e478...

bors added a commit that referenced this pull request Nov 4, 2019
…sakis

Remove LintBuffer from Session

This moves the `LintBuffer` from `Session` into the `Resolver`, where it is used until lowering is done and then consumed by early lint passes. This also happily removes the failure mode of buffering lints too late where it would have previously lead to ICEs; it is statically no longer possible to do so.

I suspect that with a bit more work a similar move could be done for the lint buffer inside `ParseSess`, but this PR doesn't touch it (in part to keep itself small).

The last commit is the "interesting" commit -- the ones before it don't work (though they compile) as they sort of prepare the various crates for the lint buffer to be passed in rather than accessed through Session.
@bors
Copy link
Contributor

bors commented Nov 4, 2019

☀️ Test successful - checks-azure
Approved by: nikomatsakis
Pushing ab6e478 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 4, 2019
@bors bors merged commit c68df7c into rust-lang:master Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

6 participants