-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 ICE checking for feature gated const fn #7128
Conversation
r? @giraffate (rust-highfive has picked a reviewer for you, use r? to override) |
// `rustc_mir::const_eval::is_const_fn` should return false for unstably const functions. | ||
unreachable!(); | ||
// Unstable const fn with the feature enabled. | ||
msrv.is_none() |
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.
Why does the return value change here depending on whether MSRV is set?
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.
There's no stable rust version where the function is const
as there's no stability attribute. If the MSRV is set, then the function is clearly not const. If it's not set, then the question becomes is the function const
now, which is true.
@bors r+ Thanks! I also want to get this into the out of cycle sync: rust-lang/rust#84610 |
📌 Commit db7ad64 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
fixes: #7126
changelog: Fix ICE in
missing_const_for_fn
when using a feature-gatedconst fn