make std::intrinsic functions actually be intrinsics #139916
Open
+337
−353
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Most of the functions in
std::intrinsics
are actually intrinsics, but some are not: for historical reasons,std::intrinsics::{copy,copy_nonoverlapping,write_bytes}
are accessible on stable, and the versions instd::ptr
are just re-exports. These functions are not intrinsics, but wrappers around the intrinsic, because they add extra debug assertions.This PR makes the functions in
std::intrinsics
actually be intrinsics.intrinsic
name of this function and turns that into a function pointer, that will no longer work, since only the wrapper functions can be turned into a function pointer. I would be rather surprised if anyone did this, though... and again, they must have already ignored a deprecation warning. Still, seems worth a crater run, if there's general agreement that we want to go ahead with this change.(
intrinsics::drop_in_place
also remains not-an-intrinsic, which bugs me, but oh well, not much we can do about it; we can't remove it from the module as the path is accidentally-stable.)Cc @rust-lang/libs-api @saethlin