Skip to content

Use RUSTC_LINT_FLAGS more #138331

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Mar 12, 2025
Merged

Conversation

nnethercote
Copy link
Contributor

An alternative to the failed #138084.

Fixes #138106.

r? @jieyouxu

For the `Mode::Rustc` lints as well. Because, unlike `RUSTC_FLAGS`,
`RUSTC_LINT_FLAGS` is not ignored for proc macro crates.

Fixes rust-lang#138106.
And fix the new errors in the handful of crates that didn't have a
`#![warn(unreachable_pub)]`.
It's no longer necessary now that `-Wunreachable_pub` is being passed.
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Mar 11, 2025
@rustbot
Copy link
Collaborator

rustbot commented Mar 11, 2025

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

Some changes occurred in compiler/rustc_sanitizers

cc @rust-lang/project-exploit-mitigations, @rcvalle

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

Some changes occurred in compiler/rustc_attr_data_structures

cc @jdonszelmann

rustc_error_messages was changed

cc @davidtwco, @compiler-errors, @TaKO8Ki

Some changes occurred in diagnostic error codes

cc @GuillaumeGomez

Some changes occurred in exhaustiveness checking

cc @Nadrieril

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

@jieyouxu
Copy link
Member

Wow, that was added back in #74046.

@jieyouxu
Copy link
Member

This looks like it shouldn't cause problems to me, but also I didn't foresee the rustc-src breakage, so rolling a second bootstrap reviewer to double-check.

r? @onur-ozkan (or reroll)

@rustbot rustbot assigned onur-ozkan and unassigned jieyouxu Mar 11, 2025
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Thanks!

  • Compiler changes look good to me.
  • Bootstrap changes LGTM as well but definitely worth having another bootstrap reviewer double-check.

@jieyouxu jieyouxu self-assigned this Mar 11, 2025
Copy link
Member

@onur-ozkan onur-ozkan left a comment

Choose a reason for hiding this comment

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

Looks great

@onur-ozkan
Copy link
Member

@bors r=onur-ozkan,jieyouxu

@bors
Copy link
Collaborator

bors commented Mar 11, 2025

📌 Commit ff0a5fe has been approved by onur-ozkan,jieyouxu

It is now in the queue for this repository.

@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 Mar 11, 2025
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Mar 12, 2025
…ore, r=onur-ozkan,jieyouxu

Use `RUSTC_LINT_FLAGS` more

An alternative to the failed rust-lang#138084.

Fixes rust-lang#138106.

r? `@jieyouxu`
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Mar 12, 2025
…ore, r=onur-ozkan,jieyouxu

Use `RUSTC_LINT_FLAGS` more

An alternative to the failed rust-lang#138084.

Fixes rust-lang#138106.

r? ``@jieyouxu``
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 12, 2025
Rollup of 25 pull requests

Successful merges:

 - rust-lang#134076 (Stabilize `std::io::ErrorKind::InvalidFilename`)
 - rust-lang#136842 (Add libstd support for Trusty targets)
 - rust-lang#137314 (change definitely unproductive cycles to error)
 - rust-lang#137504 (Move methods from Map to TyCtxt, part 4.)
 - rust-lang#137621 (Add std support to cygwin target)
 - rust-lang#137701 (Convert `ShardedHashMap` to use `hashbrown::HashTable`)
 - rust-lang#138109 (make precise capturing args in rustdoc Json typed)
 - rust-lang#138161 (Add PeekMut::refresh)
 - rust-lang#138162 (Update the standard library to Rust 2024)
 - rust-lang#138174 (Elaborate trait assumption in `receiver_is_dispatchable`)
 - rust-lang#138175 (Support rmeta inputs for --crate-type=bin --emit=obj)
 - rust-lang#138269 (uefi: fs: Implement FileType, FilePermissions and FileAttr)
 - rust-lang#138313 (Update books)
 - rust-lang#138318 (Rustdoc: remove a bunch of `@ts-expect-error` from main.js)
 - rust-lang#138331 (Use `RUSTC_LINT_FLAGS` more)
 - rust-lang#138333 (Rebuild llvm spuriously less frequently)
 - rust-lang#138343 (Enable `f16` tests for `powf`)
 - rust-lang#138345 (Some autodiff cleanups)
 - rust-lang#138346 (naked functions: on windows emit `.endef` without the symbol name)
 - rust-lang#138347 (Reduce `kw::Empty` usage, part 2)
 - rust-lang#138360 (Fix false-positive in `expr_or_init` and in the `invalid_from_utf8` lint)
 - rust-lang#138371 (Update compiletest's `has_asm_support` to match rustc)
 - rust-lang#138372 (Refactor `pick2_mut` & `pick3_mut` to use `get_disjoint_mut`)
 - rust-lang#138376 (Item-related cleanups)
 - rust-lang#138377 (Remove unnecessary lifetime from `PatInfo`.)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 12, 2025
…ore, r=onur-ozkan,jieyouxu

Use `RUSTC_LINT_FLAGS` more

An alternative to the failed rust-lang#138084.

Fixes rust-lang#138106.

r? ```@jieyouxu```
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 12, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#137314 (change definitely unproductive cycles to error)
 - rust-lang#137701 (Convert `ShardedHashMap` to use `hashbrown::HashTable`)
 - rust-lang#138269 (uefi: fs: Implement FileType, FilePermissions and FileAttr)
 - rust-lang#138331 (Use `RUSTC_LINT_FLAGS` more)
 - rust-lang#138345 (Some autodiff cleanups)
 - rust-lang#138387 (intrinsics: remove unnecessary leading underscore from argument names)
 - rust-lang#138389 (use `expect` instead of `allow`)
 - rust-lang#138390 (fix incorrect tracing log)

r? `@ghost`
`@rustbot` modify labels: rollup
Manishearth added a commit to Manishearth/rust that referenced this pull request Mar 12, 2025
…ore, r=onur-ozkan,jieyouxu

Use `RUSTC_LINT_FLAGS` more

An alternative to the failed rust-lang#138084.

Fixes rust-lang#138106.

r? `````@jieyouxu`````
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 12, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#137314 (change definitely unproductive cycles to error)
 - rust-lang#137701 (Convert `ShardedHashMap` to use `hashbrown::HashTable`)
 - rust-lang#138269 (uefi: fs: Implement FileType, FilePermissions and FileAttr)
 - rust-lang#138331 (Use `RUSTC_LINT_FLAGS` more)
 - rust-lang#138345 (Some autodiff cleanups)
 - rust-lang#138387 (intrinsics: remove unnecessary leading underscore from argument names)
 - rust-lang#138390 (fix incorrect tracing log)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d93ef39 into rust-lang:master Mar 12, 2025
6 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 12, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 12, 2025
Rollup merge of rust-lang#138331 - nnethercote:use-RUSTC_LINT_FLAGS-more, r=onur-ozkan,jieyouxu

Use `RUSTC_LINT_FLAGS` more

An alternative to the failed rust-lang#138084.

Fixes rust-lang#138106.

r? ````@jieyouxu````
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 12, 2025
…earth

Rollup of 12 pull requests

Successful merges:

 - rust-lang#134076 (Stabilize `std::io::ErrorKind::InvalidFilename`)
 - rust-lang#137504 (Move methods from Map to TyCtxt, part 4.)
 - rust-lang#138175 (Support rmeta inputs for --crate-type=bin --emit=obj)
 - rust-lang#138259 (Disentangle `ForwardGenericParamBan` and `ConstParamTy` ribs)
 - rust-lang#138280 (fix ICE in pretty-printing `global_asm!`)
 - rust-lang#138318 (Rustdoc: remove a bunch of `@ts-expect-error` from main.js)
 - rust-lang#138331 (Use `RUSTC_LINT_FLAGS` more)
 - rust-lang#138357 (merge `TypeChecker` and `TypeVerifier`)
 - rust-lang#138394 (remove unnecessary variant)
 - rust-lang#138403 (Delegation: one more ICE fix for `MethodCall` generation)
 - rust-lang#138407 (Delegation: reject C-variadics)
 - rust-lang#138409 (Use sa_sigaction instead of sa_union.__su_sigaction for AIX)

r? `@ghost`
`@rustbot` modify labels: rollup
@nnethercote nnethercote deleted the use-RUSTC_LINT_FLAGS-more branch March 12, 2025 21:54
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 13, 2025
…earth

Rollup of 12 pull requests

Successful merges:

 - rust-lang#134076 (Stabilize `std::io::ErrorKind::InvalidFilename`)
 - rust-lang#137504 (Move methods from Map to TyCtxt, part 4.)
 - rust-lang#138175 (Support rmeta inputs for --crate-type=bin --emit=obj)
 - rust-lang#138259 (Disentangle `ForwardGenericParamBan` and `ConstParamTy` ribs)
 - rust-lang#138280 (fix ICE in pretty-printing `global_asm!`)
 - rust-lang#138318 (Rustdoc: remove a bunch of `@ts-expect-error` from main.js)
 - rust-lang#138331 (Use `RUSTC_LINT_FLAGS` more)
 - rust-lang#138357 (merge `TypeChecker` and `TypeVerifier`)
 - rust-lang#138394 (remove unnecessary variant)
 - rust-lang#138403 (Delegation: one more ICE fix for `MethodCall` generation)
 - rust-lang#138407 (Delegation: reject C-variadics)
 - rust-lang#138409 (Use sa_sigaction instead of sa_union.__su_sigaction for AIX)

r? `@ghost`
`@rustbot` modify labels: rollup
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Mar 14, 2025
…earth

Rollup of 12 pull requests

Successful merges:

 - rust-lang#134076 (Stabilize `std::io::ErrorKind::InvalidFilename`)
 - rust-lang#137504 (Move methods from Map to TyCtxt, part 4.)
 - rust-lang#138175 (Support rmeta inputs for --crate-type=bin --emit=obj)
 - rust-lang#138259 (Disentangle `ForwardGenericParamBan` and `ConstParamTy` ribs)
 - rust-lang#138280 (fix ICE in pretty-printing `global_asm!`)
 - rust-lang#138318 (Rustdoc: remove a bunch of `@ts-expect-error` from main.js)
 - rust-lang#138331 (Use `RUSTC_LINT_FLAGS` more)
 - rust-lang#138357 (merge `TypeChecker` and `TypeVerifier`)
 - rust-lang#138394 (remove unnecessary variant)
 - rust-lang#138403 (Delegation: one more ICE fix for `MethodCall` generation)
 - rust-lang#138407 (Delegation: reject C-variadics)
 - rust-lang#138409 (Use sa_sigaction instead of sa_union.__su_sigaction for AIX)

r? `@ghost`
`@rustbot` modify labels: rollup
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate and implement a scheme to consistently apply lints for all compiler crates
5 participants