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

Report the unexpected_cfgs lint in external macros #132577

Merged
merged 4 commits into from
Nov 19, 2024

Conversation

Urgau
Copy link
Member

@Urgau Urgau commented Nov 3, 2024

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

@rustbot
Copy link
Collaborator

rustbot commented Nov 3, 2024

r? @wesleywiser

rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 3, 2024
@rust-log-analyzer

This comment has been minimized.

@jieyouxu jieyouxu added the L-unexpected_cfgs Lint: unexpected_cfgs label Nov 4, 2024
@rustbot
Copy link
Collaborator

rustbot commented Nov 4, 2024

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@Urgau
Copy link
Member Author

Urgau commented Nov 4, 2024

The job x86_64-gnu-tools failed!

Fixed in rust-cli/anstyle#229 (thks to @epage)

Let's try again!

@rust-log-analyzer

This comment has been minimized.

@jieyouxu
Copy link
Member

jieyouxu commented Nov 5, 2024

Would this need a crater run?

@Urgau
Copy link
Member Author

Urgau commented Nov 5, 2024

Would this need a crater run?

Evaluating the new unexpected_cfgs warnings coming from external macros on a crater run is doable (although not easy), but I'm not sure what it will give us, a part (obviously) from the number of impacted crates, which I'm not sure how to interpret. A big (or even small) number of warnings would IMO only reinforce the usefulness of enabling the reporting in external macros (not that it needs it to be clear).

Is there something particular you are looking for?

@jieyouxu
Copy link
Member

jieyouxu commented Nov 6, 2024

No I'm more just curious, because maybe a few crates are affected.

@Urgau
Copy link
Member Author

Urgau commented Nov 8, 2024

r? @petrochenkov

@rustbot rustbot assigned petrochenkov and unassigned wesleywiser Nov 8, 2024
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Nov 9, 2024

📌 Commit 37e67ac has been approved by petrochenkov

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 Nov 9, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 9, 2024
…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
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 9, 2024
…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
@workingjubilee
Copy link
Member

workingjubilee commented Nov 10, 2024

@bors r-
Seems to have failed in #132827 (comment)

@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 Nov 10, 2024
@workingjubilee
Copy link
Member

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 10, 2024
… 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
@bors
Copy link
Contributor

bors commented Nov 10, 2024

⌛ Trying commit 37e67ac with merge 6606d0e...

@rust-log-analyzer

This comment has been minimized.

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 19, 2024
…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
@bors bors merged commit 4720054 into rust-lang:master Nov 19, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Nov 19, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 19, 2024
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
smoelius added a commit to rust-fuzz/afl.rs that referenced this pull request Nov 20, 2024
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.
github-merge-queue bot pushed a commit to rust-fuzz/afl.rs that referenced this pull request Nov 20, 2024
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.
tnull added a commit to tnull/rust-lightning that referenced this pull request Nov 26, 2024
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.
joshlf added a commit to google/zerocopy that referenced this pull request Dec 3, 2024
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
github-merge-queue bot pushed a commit to google/zerocopy that referenced this pull request Dec 3, 2024
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
joshlf added a commit to google/zerocopy that referenced this pull request Dec 3, 2024
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
github-merge-queue bot pushed a commit to google/zerocopy that referenced this pull request Dec 3, 2024
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
richvdh added a commit to matrix-org/matrix-rust-sdk-crypto-wasm that referenced this pull request Dec 10, 2024
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.
richvdh added a commit to matrix-org/matrix-rust-sdk-crypto-wasm that referenced this pull request Dec 11, 2024
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.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 14, 2024
…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
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 14, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L-unexpected_cfgs Lint: unexpected_cfgs relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent warning for macros that contain unexpected_cfgs
10 participants