-
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
treat intrinsics entirely as an implementation detail of specialized modules #10008
Comments
This sounds like the opposite of #3369. Or do you mean keeping the intrinsics in intrinsics.rs but making it private, and reexport them in the relevant modules? |
It's not the opposite of #3369. We used to re-declare them whenever they were needed, rather than exporting them in a single time in a relevant module. I'm not proposing we go back to how things were before. The rust-core library is mostly (some numerics stuff is still in |
This provides a measurable compile-time performance improvement, and also a runtime performance improvement at I think the only thing we need to do is make sure |
We should also feature-gate |
assigning to non-1.0, P-low. |
Intrinsics are feature gated, the intrinsics module is unstable with no current plans to stabilize. I believe the current situation is fine. |
Treat custom enum discriminant values as constants fixes rust-lang#9882 changelog: All lints: Don't lint in enum discriminant values when the suggestion won't work in a const context
Exposing all of the intrinsics in one module is much more convenient than ad hoc
extern
blocks all over the standard library, but is very annoying for users of low-level Rust. It would be much nicer to treat intrinsics as part of the library API, and expose them in relevant modules. The fact that the API may be an intrinsic and not a library defined function is an implementation detail. Safe intrinsics should not be exposed as both anunsafe
function and a safe wrapper.Example: https://github.com/thestinger/rust-core/blob/master/core/f64.rs
The text was updated successfully, but these errors were encountered: