-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Document is_val_statically_known
only supports primitives (ICE otherwise)
#121115
Comments
@rustbot label +A-contributor-roadblock +F-core_intrinsics +T-libs +T-compiler -needs-triage |
Fixed in #120484, building on nightly will fix this crash. |
In my opinion, I think that is more of a reason to update documentation. |
@rustbot claim |
@RalfJung In terms of provenance and Miri, what does I think from a theoretical perspective, |
In terms of the spec, So it's really up to the optimizer to decide whether knowing the address but not the provenance of a pointer is sufficient to consider the value "known". I personally would say "no", but it's always okay to return |
LLVM either:
I'm not sure, but I'd bet on the first. The potential difference between those two possibilities is explained in the docs for |
There's no difference between those (on targets we currently support). If you think the Anyway, we can just call the |
* 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.
Location
rust/library/core/src/intrinsics.rs
Lines 2521 to 2570 in ee9c7c9
Summary
Per #121064 (comment) comment by @Nilstrieb,
is_val_statically_known
only supports primitive types - which is not listed anywhere in the documentation.When trying to use inside the core library on
core::fmt::Arguments
, compiler crashes #121066.CC: @NCGThompson
The text was updated successfully, but these errors were encountered: