make std::intrinsics functions actually be intrinsics by RalfJung · Pull Request #139916 · rust-lang/rust (original) (raw)

make std::intrinsic functions actually be intrinsics

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 in std::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.

(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