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

Make #![feature] suggestion MaybeIncorrect #124926

Merged
merged 1 commit into from May 9, 2024

Conversation

Alexendoo
Copy link
Member

Fixes rust-lang/rust-clippy#12784

The unstable_name_collisions lint uses disabled_nightly_features to mention the feature name, but accepting the suggestion would result in an ambiguity error

There are other calls where accepting the feature gate would fix code when ran with cargo fix --broken-code, though it's not always desirable to add a feature gate even if the user is currently on nightly so MaybeIncorrect seems appropriate

@rustbot
Copy link
Collaborator

rustbot commented May 9, 2024

r? @petrochenkov

rustbot has assigned @petrochenkov.
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 May 9, 2024
@est31
Copy link
Member

est31 commented May 9, 2024

Yeah IMO #![feature] should be an explicit choice one opts into.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 9, 2024

📌 Commit 3c52553 has been approved by est31

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 May 9, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 9, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#124893 (Make a minimal amount of region APIs public)
 - rust-lang#124919 (Add `ErrorGuaranteed` to `Recovered::Yes` and use it more.)
 - rust-lang#124923 (interpret/miri: better errors on failing offset_from)
 - rust-lang#124924 (chore: remove repetitive words)
 - rust-lang#124926 (Make `#![feature]` suggestion MaybeIncorrect)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 779fe95 into rust-lang:master May 9, 2024
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 9, 2024
Rollup merge of rust-lang#124926 - Alexendoo:feature-maybe-incorrect, r=est31

Make `#![feature]` suggestion MaybeIncorrect

Fixes rust-lang/rust-clippy#12784

The `unstable_name_collisions` lint uses `disabled_nightly_features` to mention the feature name, but accepting the suggestion would result in an ambiguity error

There are other calls where accepting the feature gate would fix code when ran with `cargo fix --broken-code`, though it's not always desirable to add a feature gate even if the user is currently on nightly so MaybeIncorrect seems appropriate
@rustbot rustbot added this to the 1.80.0 milestone May 9, 2024
@Alexendoo Alexendoo deleted the feature-maybe-incorrect branch May 9, 2024 21:19
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. 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.

ICE when invoking cargo clippy --fix
5 participants