diff options
| author | Pavel Grigorenko <GrigorenkoPV@ya.ru> | 2024-06-24 18:09:27 +0300 |
|---|---|---|
| committer | Pavel Grigorenko <GrigorenkoPV@ya.ru> | 2024-07-29 20:44:42 +0300 |
| commit | dbc13fb309f3a1539e8bb1cdeeb5fbb2e3eaaa43 (patch) | |
| tree | ae397af7bc2ae5860b59119b98042abae376468d | |
| parent | afabc583f7f646d45f506263a1c331383ebdc252 (diff) | |
| download | rust-dbc13fb309f3a1539e8bb1cdeeb5fbb2e3eaaa43.tar.gz rust-dbc13fb309f3a1539e8bb1cdeeb5fbb2e3eaaa43.zip | |
Sparkle some attributes over `CloneToUninit` stuff
| -rw-r--r-- | library/core/src/clone.rs | 7 | ||||
| -rw-r--r-- | library/std/src/ffi/os_str.rs | 1 | ||||
| -rw-r--r-- | library/std/src/path.rs | 1 | ||||
| -rw-r--r-- | library/std/src/sys/os_str/bytes.rs | 1 | ||||
| -rw-r--r-- | library/std/src/sys/os_str/wtf8.rs | 1 | ||||
| -rw-r--r-- | library/std/src/sys_common/wtf8.rs | 1 |
6 files changed, 12 insertions, 0 deletions
diff --git a/library/core/src/clone.rs b/library/core/src/clone.rs index 409fd2746f5..88f7990c017 100644 --- a/library/core/src/clone.rs +++ b/library/core/src/clone.rs @@ -272,6 +272,7 @@ pub unsafe trait CloneToUninit { #[unstable(feature = "clone_to_uninit", issue = "126799")] unsafe impl<T: Clone> CloneToUninit for T { + #[inline] default unsafe fn clone_to_uninit(&self, dst: *mut Self) { // SAFETY: The safety conditions of clone_to_uninit() are a superset of those of // ptr::write(). @@ -285,8 +286,10 @@ unsafe impl<T: Clone> CloneToUninit for T { // Specialized implementation for types that are [`Copy`], not just [`Clone`], // and can therefore be copied bitwise. +#[doc(hidden)] #[unstable(feature = "clone_to_uninit", issue = "126799")] unsafe impl<T: Copy> CloneToUninit for T { + #[inline] unsafe fn clone_to_uninit(&self, dst: *mut Self) { // SAFETY: The safety conditions of clone_to_uninit() are a superset of those of // ptr::copy_nonoverlapping(). @@ -298,6 +301,7 @@ unsafe impl<T: Copy> CloneToUninit for T { #[unstable(feature = "clone_to_uninit", issue = "126799")] unsafe impl<T: Clone> CloneToUninit for [T] { + #[inline] #[cfg_attr(debug_assertions, track_caller)] default unsafe fn clone_to_uninit(&self, dst: *mut Self) { let len = self.len(); @@ -326,8 +330,10 @@ unsafe impl<T: Clone> CloneToUninit for [T] { } } +#[doc(hidden)] #[unstable(feature = "clone_to_uninit", issue = "126799")] unsafe impl<T: Copy> CloneToUninit for [T] { + #[inline] #[cfg_attr(debug_assertions, track_caller)] unsafe fn clone_to_uninit(&self, dst: *mut Self) { let len = self.len(); @@ -348,6 +354,7 @@ unsafe impl<T: Copy> CloneToUninit for [T] { #[unstable(feature = "clone_to_uninit", issue = "126799")] unsafe impl CloneToUninit for str { + #[inline] #[cfg_attr(debug_assertions, track_caller)] unsafe fn clone_to_uninit(&self, dst: *mut Self) { // SAFETY: str is just a [u8] with UTF-8 invariant diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index f68ea3c562a..918eec2d0d8 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -1266,6 +1266,7 @@ impl Clone for Box<OsStr> { #[unstable(feature = "clone_to_uninit", issue = "126799")] unsafe impl CloneToUninit for OsStr { + #[inline] #[cfg_attr(debug_assertions, track_caller)] unsafe fn clone_to_uninit(&self, dst: *mut Self) { // SAFETY: we're just a wrapper around a platform-specific Slice diff --git a/library/std/src/path.rs b/library/std/src/path.rs index d6c78883f28..9eaa0e01c2c 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -3113,6 +3113,7 @@ impl Path { #[unstable(feature = "clone_to_uninit", issue = "126799")] unsafe impl CloneToUninit for Path { + #[inline] #[cfg_attr(debug_assertions, track_caller)] unsafe fn clone_to_uninit(&self, dst: *mut Self) { // SAFETY: Path is just a wrapper around OsStr diff --git a/library/std/src/sys/os_str/bytes.rs b/library/std/src/sys/os_str/bytes.rs index 8529207366e..992767211d0 100644 --- a/library/std/src/sys/os_str/bytes.rs +++ b/library/std/src/sys/os_str/bytes.rs @@ -351,6 +351,7 @@ impl Slice { #[unstable(feature = "clone_to_uninit", issue = "126799")] unsafe impl CloneToUninit for Slice { + #[inline] #[cfg_attr(debug_assertions, track_caller)] unsafe fn clone_to_uninit(&self, dst: *mut Self) { // SAFETY: we're just a wrapper around [u8] diff --git a/library/std/src/sys/os_str/wtf8.rs b/library/std/src/sys/os_str/wtf8.rs index e5755a4b874..433237aa6e7 100644 --- a/library/std/src/sys/os_str/wtf8.rs +++ b/library/std/src/sys/os_str/wtf8.rs @@ -274,6 +274,7 @@ impl Slice { #[unstable(feature = "clone_to_uninit", issue = "126799")] unsafe impl CloneToUninit for Slice { + #[inline] #[cfg_attr(debug_assertions, track_caller)] unsafe fn clone_to_uninit(&self, dst: *mut Self) { // SAFETY: we're just a wrapper around Wtf8 diff --git a/library/std/src/sys_common/wtf8.rs b/library/std/src/sys_common/wtf8.rs index 2bdeff78ddf..063451ad54e 100644 --- a/library/std/src/sys_common/wtf8.rs +++ b/library/std/src/sys_common/wtf8.rs @@ -1051,6 +1051,7 @@ impl Hash for Wtf8 { #[unstable(feature = "clone_to_uninit", issue = "126799")] unsafe impl CloneToUninit for Wtf8 { + #[inline] #[cfg_attr(debug_assertions, track_caller)] unsafe fn clone_to_uninit(&self, dst: *mut Self) { // SAFETY: we're just a wrapper around [u8] |
