-
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
Report the unexpected_cfgs
lint in external macros
#132577
Conversation
r? @wesleywiser rustbot has assigned @wesleywiser. Use |
This comment has been minimized.
This comment has been minimized.
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
Fixed in rust-cli/anstyle#229 (thks to @epage) Let's try again! |
This comment has been minimized.
This comment has been minimized.
Would this need a crater run? |
Evaluating the new Is there something particular you are looking for? |
No I'm more just curious, because maybe a few crates are affected. |
@bors r+ |
…o, r=petrochenkov Report the `unexpected_cfgs` lint in external macros This PR marks the `unexpected_cfgs` lint as being reportable in external macros, as it's probably not the intention of the macro author to leave ineffective cfgs in the users code. Fixes rust-lang#132572
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#131258 (Stabilize s390x inline assembly) - rust-lang#132577 (Report the `unexpected_cfgs` lint in external macros) - rust-lang#132801 (interpret: get_alloc_info: also return mutability) - rust-lang#132825 (Exclude relnotes-tracking-issue from needs-triage) r? `@ghost` `@rustbot` modify labels: rollup
@bors r- |
@bors try |
… r=<try> Report the `unexpected_cfgs` lint in external macros This PR marks the `unexpected_cfgs` lint as being reportable in external macros, as it's probably not the intention of the macro author to leave ineffective cfgs in the users code. Fixes rust-lang#132572 try-job: aarch64-gnu-debug
This comment has been minimized.
This comment has been minimized.
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#131081 (Use `ConstArgKind::Path` for all single-segment paths, not just params under `min_generic_const_args`) - rust-lang#132577 (Report the `unexpected_cfgs` lint in external macros) - rust-lang#133023 (Merge `-Zhir-stats` into `-Zinput-stats`) - rust-lang#133200 (ignore an occasionally-failing test in Miri) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#132577 - Urgau:check-cfg-report-extern-macro, r=petrochenkov Report the `unexpected_cfgs` lint in external macros This PR marks the `unexpected_cfgs` lint as being reportable in external macros, as it's probably not the intention of the macro author to leave ineffective cfgs in the users code. Fixes rust-lang#132572 try-job: aarch64-gnu-debug
This recent change is causing CI to fail: rust-lang/rust#132577 The failure is caused by the `used_linker` feature in code produced by the `ctor::ctor` attribute macro.
This recent change is causing CI to fail: rust-lang/rust#132577 The failure is caused by the `used_linker` feature in code produced by the `ctor::ctor` attribute macro.
Rustc 1.84 (nightly) introduced that the `unexpected_cfg`s lint will now be reported for external macros (see rust-lang/rust#132577), leading to some of our builds failing due to our `level = "forbid"` config of unexpected cfg flags. Here, we add the logging features to the expected features of the workspace to mitigiate this issue and fix builds.
As of nightly-2024-11-20 - specifically [1] - this triggers an `unexpected_cfgs` lint even when emitted in derive-generated code. [1] rust-lang/rust#132577 Fixes #2117 gherrit-pr-id: I9d536f0ea08475afe0b65411b225aa55f4db449a
As of nightly-2024-11-20 - specifically [1] - this triggers an `unexpected_cfgs` lint even when emitted in derive-generated code. [1] rust-lang/rust#132577 Fixes #2117 gherrit-pr-id: I9d536f0ea08475afe0b65411b225aa55f4db449a
As of nightly-2024-11-20 - specifically [1] - this triggers an `unexpected_cfgs` lint even when emitted in derive-generated code. [1] rust-lang/rust#132577 Fixes #2117 gherrit-pr-id: I9d536f0ea08475afe0b65411b225aa55f4db449a
As of nightly-2024-11-20 - specifically [1] - this triggers an `unexpected_cfgs` lint even when emitted in derive-generated code. [1] rust-lang/rust#132577 Fixes #2117 gherrit-pr-id: I9d536f0ea08475afe0b65411b225aa55f4db449a
Since rust-lang/rust#132577 (currently in rust nightly), we get hundreds of lint warnings: ``` warning: unexpected `cfg` condition name: `wasm_bindgen_unstable_test_coverage` --> src/rust/lib.rs:83:1 | 83 | #[wasm_bindgen(start)] ``` The correct solution is to upgrade wasm-bindgen, but legend has it that is difficult. For now, let's silence the lint.
Since rust-lang/rust#132577 (currently in rust nightly), we get hundreds of lint warnings: ``` warning: unexpected `cfg` condition name: `wasm_bindgen_unstable_test_coverage` --> src/rust/lib.rs:83:1 | 83 | #[wasm_bindgen(start)] ``` The correct solution is to upgrade wasm-bindgen, but legend has it that is difficult. For now, let's silence the lint.
…ouxu Add external macros specific diagnostics for check-cfg This PR adds specific check-cfg diagnostics for unexpected cfg in external macros. As well as hiding the some of the Cargo specific help/suggestions as they distraction for external macros and are generally not the right solution. Follow-up to rust-lang#132577 `@rustbot` label +L-unexpected_cfgs r? compiler
Rollup merge of rust-lang#133221 - Urgau:check-cfg-macro-diag, r=jieyouxu Add external macros specific diagnostics for check-cfg This PR adds specific check-cfg diagnostics for unexpected cfg in external macros. As well as hiding the some of the Cargo specific help/suggestions as they distraction for external macros and are generally not the right solution. Follow-up to rust-lang#132577 `@rustbot` label +L-unexpected_cfgs r? compiler
This PR marks the
unexpected_cfgs
lint as being reportable in external macros, as it's probably not the intention of the macro author to leave ineffective cfgs in the users code.Fixes #132572
try-job: aarch64-gnu-debug