-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Get rid of is_min_const_fn #84547
Get rid of is_min_const_fn #84547
Conversation
Rejecting the forbidden unsafe ops is done by const checking, not by unsafety checking
This comment has been minimized.
This comment has been minimized.
Some checks used
Those should all be rejected by our regular const checks, right? |
This comment has been minimized.
This comment has been minimized.
Yea, we already have feature gates for them, that is independent |
Can you double check that we still make some things unsafe in const fn that are safe in regular fns? (Like pointer comparisons) |
I don't think pointer comaprisons were ever unsafe? They should just be forbidden. |
Raw ptr comparison is checked here
There is no feature gate for |
This comment has been minimized.
This comment has been minimized.
Yes, otherwise unleash can't know what checks it can skip |
r=me with ci passing |
I am not sure if unleashing should allow raw ptr comparisons... but yeah makes sense.
|
@bors r=oli-obk |
📌 Commit 421d54e has been approved by |
@bors r=oli-obk |
📌 Commit 588530d has been approved by |
We should skip the static check on raw pointer comparisons in unleash mode in order to demonstrate the interpretation time behaviour if there are actual relocations involved |
Rollup of 8 pull requests Successful merges: - rust-lang#84235 (refactor StyledBuffer) - rust-lang#84450 (Give a better error when `std` or `core` are missing) - rust-lang#84486 (Handle pretty printing of `else if let` clauses without ICEing) - rust-lang#84499 (Tweak trait not `use`d suggestion) - rust-lang#84516 (Add suggestion to "use break" when attempting to implicit-break a loop) - rust-lang#84520 (Improve diagnostics for function passed when a type was expected.) - rust-lang#84541 (Inline most raw socket, fd and handle conversions) - rust-lang#84547 (Get rid of is_min_const_fn) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This removes the last trace of the min_const_fn mechanism by making the unsafety checker agnostic about whether something is a min or "non-min" const fn. It seems this distinction was used to disallow some features inside
const fn
, but that is the responsibility of the const checker, not of the unsafety checker. No test seems to even notice this change in the unsafety checker so I guess we are good...r? @oli-obk
Cc #84510