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

lints_that_dont_need_to_run: never skip future-compat-reported lints #133108

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

RalfJung
Copy link
Member

Follow-up to #125116: future-compat lints show up with --json=future-incompat even if they are otherwise allowed in the crate. So let's ensure we do not skip those as part of the lints_that_dont_need_to_run logic.

I could not find a current future compat lint that is emitted by a lint pass, so there's no clear way to add a test for this.

Cc @blyxyas @cjgillot

@rustbot
Copy link
Collaborator

rustbot commented Nov 16, 2024

r? @lcnr

rustbot has assigned @lcnr.
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 16, 2024
Copy link
Member

@blyxyas blyxyas left a comment

Choose a reason for hiding this comment

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

Looking good, just a question:

let has_future_breakage =
lint.future_incompatible.is_some_and(|fut| fut.reason.has_future_breakage());
!has_future_breakage && !lint.eval_always
})
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason to have these two as different methods?

Copy link
Member Author

@RalfJung RalfJung Nov 18, 2024

Choose a reason for hiding this comment

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

I think it's easier to first do the pure filtering, and then the filter_map part that also transforms the data. This also reduces rightward drift in the filter_map closure.

Copy link
Contributor

Choose a reason for hiding this comment

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

could the fitire breakage check be moved earlier? i.e. automatically set eval_always for all future breakage lints

Copy link
Member Author

Choose a reason for hiding this comment

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

That would require putting the logic for this into the declare_lint macro. IMO that's a bad idea, I'd rather not have this logic hidden in a macro.

@lcnr
Copy link
Contributor

lcnr commented Nov 19, 2024

r=me after nit

@RalfJung RalfJung force-pushed the future-compat-needs-to-run branch from e7d2d4c to df94818 Compare November 19, 2024 21:04
@RalfJung
Copy link
Member Author

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Nov 19, 2024

📌 Commit df94818 has been approved by lcnr

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 19, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 20, 2024
Rollup of 5 pull requests

Successful merges:

 - rust-lang#132732 (Use attributes for `dangling_pointers_from_temporaries` lint)
 - rust-lang#133108 (lints_that_dont_need_to_run: never skip future-compat-reported lints)
 - rust-lang#133190 (CI: use free runner in dist-aarch64-msvc)
 - rust-lang#133196 (Make rustc --explain compatible with BusyBox less)
 - rust-lang#133216 (Implement `~const Fn` trait goal in the new solver)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit a175db1 into rust-lang:master Nov 20, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Nov 20, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 20, 2024
Rollup merge of rust-lang#133108 - RalfJung:future-compat-needs-to-run, r=lcnr

lints_that_dont_need_to_run: never skip future-compat-reported lints

Follow-up to rust-lang#125116: future-compat lints show up with `--json=future-incompat` even if they are otherwise allowed in the crate. So let's ensure we do not skip those as part of the `lints_that_dont_need_to_run` logic.

I could not find a current future compat lint that is emitted by a lint pass, so there's no clear way to add a test for this.

Cc `@blyxyas` `@cjgillot`
@RalfJung RalfJung deleted the future-compat-needs-to-run branch November 20, 2024 12:33
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.

5 participants