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

fix: missing_const_for_fn FP on unstable const traits #14294

Merged
merged 1 commit into from
Mar 20, 2025

Conversation

profetia
Copy link
Contributor

@profetia profetia commented Feb 25, 2025

Closes #14020
Closes #14290
Closes #14091

Add checks for unstable const traits.

changelog: [missing_const_for_fn] fix FP on unstable const traits

@rustbot
Copy link
Collaborator

rustbot commented Feb 25, 2025

r? @Alexendoo

rustbot has assigned @Alexendoo.
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 the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 25, 2025
@profetia
Copy link
Contributor Author

r? clippy

@samueltardieu
Copy link
Contributor

You should add a separate "Closes #14290" line to the description so that the issue and the PR are linked.

@profetia profetia force-pushed the issue14020 branch 2 times, most recently from cda1dc4 to 0bb2e7f Compare March 3, 2025 04:52
@profetia
Copy link
Contributor Author

r? clippy

@rustbot rustbot assigned xFrednet and unassigned Jarcho Mar 12, 2025
@xFrednet
Copy link
Member

I sadly don't have the time to review this rn. Sorry for bouncing it again 🙈

r? clippy

@rustbot rustbot assigned y21 and unassigned xFrednet Mar 16, 2025
Copy link
Member

@y21 y21 left a comment

Choose a reason for hiding this comment

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

The change LGTM, thanks!

There's still some issues with how qualify_min_const_fn deals with const traits (for example, the issue14290::f test case still gets a false positive warning when adding the feature gate and removing the msrv attribute; it needs a T: const Add bound in order to be a const fn which the code doesn't seem to account for).

However, I'm pretty sure that that is a pre-existing issue and this PR shouldn't be at fault for that (since this just adapts to the rustc change that const stability is not a property of trait methods anymore and is instead inherited from the parent trait afaict, and as such basically keeps the behavior that was there before the rustc change).

@y21 y21 added this pull request to the merge queue Mar 20, 2025
Merged via the queue into rust-lang:master with commit 1e5237f Mar 20, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
7 participants