-
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
Update is_val_statically_known
Docs
#124502
Conversation
* Add `Type Requirements` section, listing the allowed inputs, as requested by rust-lang#121115 * Add `Pointers` subsection, explaining is_val_statically_known handles pointers. * Add `Stability concerns` section, referring to other documentation relating to consistency in `const` functions.
r? @Nilstrieb rustbot has assigned @Nilstrieb. Use |
@bors r+ rollup |
☀️ Test successful - checks-actions |
Finished benchmarking commit (5b1d58c): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 674.79s -> 673.986s (-0.12%) |
@RalfJung It's too late to change it, but I wonder if we can guarantee that it will behave deterministically while in |
|
Thanks, that clears things up.
While that is from a not-yet accepted RFC, this seems to also apply to the current state. Considering that in I'm not going to open another PR to remove the disclaimer just yet though; there are other changes I can make along with it. |
This is the relevant part of the float RFC for that:
The intrinsic is not deterministic, but it is "determinised" by the const-eval machine to ensure sound compilation. However, the exact way it is "determinised" is an unspecified implementation detail; users should treat the operation as non-deterministic. Also, discussing things in a closed PR is somewhat pointless, and I don't understand what problem you intend to solve by specifying is_val_statically_known differently. I want const-eval to support operations that are non-deterministic (like float ops) or that behave different at compiletime and runtime (like const_eval_select). This is not a bug, it's a feature. It is true that currently no such operation is stable, but so what? If there is a problem, please open an issue so we have a proper place for discussion. If you are just wondering how it can make sense that is_val_statically_known is specified as non-deterministic, then probably a topic on Zulip asking for someone to explain this is the best way to proceed. Non-determinism is a non-trivial topic and I think many people are confused about its subtler points. |
Type Requirements
section, listing the allowed inputs, as requested by Documentis_val_statically_known
only supports primitives (ICE otherwise) #121115Pointers
subsection, explaining is_val_statically_known handles pointers.Stability concerns
section, referring to other documentation relating to consistency inconst
functions.Fixes #121115
Sorry this took so long.