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

rustbuild: Cleanup global lint settings #62438

Merged
merged 2 commits into from
Jul 7, 2019
Merged

Conversation

petrochenkov
Copy link
Contributor

Lint settings do not depend on if let Some(target) = target in any way, so they are moved out of that clause.

Internal lints now respect RUSTC_DENY_WARNINGS.

Crate name treatment is cleaned up a bit.

cc #61545 @flip1995
r? @Mark-Simulacrum

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 6, 2019
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

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

r=me with nits resolved

Thanks!

env::var_os("RUSTC_EXTERNAL_TOOL").is_none() {
cmd.arg("-Dwarnings");
cmd.arg("-Drust_2018_idioms");
if stage != "0" && crate_name != Some("rustc_version") && // cfg(not(bootstrap))
Copy link
Member

Choose a reason for hiding this comment

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

Can you move the cfg comment ontop of the if and expand it a bit, something like "Internal lints may change, so don't enable them on the bootstrap compiler. Also, only enable them for internal crates."

I think rustc_version is just excluded because it's actually external but happens to fall into the use_internal_crates check, could it be moved into that function and a comment added saying "this is actually an external crate"?

Copy link
Contributor Author

@petrochenkov petrochenkov Jul 6, 2019

Choose a reason for hiding this comment

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

Internal lints may change, so don't enable them on the bootstrap compiler

The reason is simpler - stage 0 compiler doesn't understand -Drustc::internal since it's too new for it and gives an error.

rustc_version for some reason reports stage == "1" when it's actually built by a stage 0 compiler that errors on -Drustc::internal (this happens during x.py doc, IIRC), it doesn't have issues with the lints themselves.
So it's also a part of the bootstrap problem and we'll be able to remove this exception during the next bootstrap compiler update, that's why it's not in use_internal_crates.
(There are other "false-positive" rustc_* crates which happen to pass the internal lint checks and therefore not listed as exceptions.)

I'll add a comment.

Copy link
Member

Choose a reason for hiding this comment

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

I'd expect the stage 0 compiler to understand -Drustc::internal now, since we just bumped beta -- should we remove that check then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, I think I tried it and it didn't work.
Does stage 0 include #61545 (merged yesterday)?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, no, that's ~one day too recent :)

if env::var_os("RUSTC_DENY_WARNINGS").is_some() &&
env::var_os("RUSTC_EXTERNAL_TOOL").is_none() {
cmd.arg("-Dwarnings");
cmd.arg("-Drust_2018_idioms");
Copy link
Member

Choose a reason for hiding this comment

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

It looks like we maybe lost bare_trait_objects here? Or is that included in rust_2018_idioms (it should be, I'd guess)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's a part of the edition idiom group.
(And it's a part of -Dwarnings too now because it was turned into warn-by-default on both editions.)

@petrochenkov
Copy link
Contributor Author

@bors r=Mark-Simulacrum rollup

@bors
Copy link
Contributor

bors commented Jul 6, 2019

📌 Commit 36a5aa8 has been approved by Mark-Simulacrum

@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 Jul 6, 2019
Centril added a commit to Centril/rust that referenced this pull request Jul 7, 2019
…lacrum

rustbuild: Cleanup global lint settings

Lint settings do not depend on `if let Some(target) = target` in any way, so they are moved out of that clause.

Internal lints now respect `RUSTC_DENY_WARNINGS`.

Crate name treatment is cleaned up a bit.

cc rust-lang#61545 @flip1995
r? @Mark-Simulacrum
bors added a commit that referenced this pull request Jul 7, 2019
Rollup of 4 pull requests

Successful merges:

 - #61990 (First question mark in doctest)
 - #62379 (Add missing links in Option documentation)
 - #62438 (rustbuild: Cleanup global lint settings)
 - #62455 (name the trait in ambiguous-associated-items fully qualified suggestion)

Failed merges:

r? @ghost
@bors bors merged commit 36a5aa8 into rust-lang:master Jul 7, 2019
@petrochenkov petrochenkov deleted the buildwarn branch July 8, 2019 13:35
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants