-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Conversation
There was a problem hiding this 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 | ||
}) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
r=me after nit |
e7d2d4c
to
df94818
Compare
@bors r=lcnr |
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
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`
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 thelints_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