Skip to content

Commit aadd353

Browse files
committed
Sparkle some attributes over CloneToUninit stuff
1 parent 489dcc7 commit aadd353

File tree

6 files changed

+10
-0
lines changed

6 files changed

+10
-0
lines changed

library/core/src/clone.rs

+5
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ unsafe impl<T: Clone> CloneToUninit for T {
282282

283283
// Specialized implementation for types that are [`Copy`], not just [`Clone`],
284284
// and can therefore be copied bitwise.
285+
#[doc(hidden)]
285286
#[unstable(feature = "clone_to_uninit", issue = "126799")]
286287
unsafe impl<T: Copy> CloneToUninit for T {
287288
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
@@ -296,6 +297,7 @@ unsafe impl<T: Copy> CloneToUninit for T {
296297
#[unstable(feature = "clone_to_uninit", issue = "126799")]
297298
unsafe impl<T: Clone> CloneToUninit for [T] {
298299
#[cfg_attr(debug_assertions, track_caller)]
300+
#[inline]
299301
default unsafe fn clone_to_uninit(&self, dst: *mut Self) {
300302
let len = self.len();
301303
// This is the most likely mistake to make, so check it as a debug assertion.
@@ -323,9 +325,11 @@ unsafe impl<T: Clone> CloneToUninit for [T] {
323325
}
324326
}
325327

328+
#[doc(hidden)]
326329
#[unstable(feature = "clone_to_uninit", issue = "126799")]
327330
unsafe impl<T: Copy> CloneToUninit for [T] {
328331
#[cfg_attr(debug_assertions, track_caller)]
332+
#[inline]
329333
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
330334
let len = self.len();
331335
// This is the most likely mistake to make, so check it as a debug assertion.
@@ -346,6 +350,7 @@ unsafe impl<T: Copy> CloneToUninit for [T] {
346350
#[unstable(feature = "clone_to_uninit", issue = "126799")]
347351
unsafe impl CloneToUninit for str {
348352
#[cfg_attr(debug_assertions, track_caller)]
353+
#[inline]
349354
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
350355
// SAFETY: str is just a [u8] with UTF-8 invariant
351356
unsafe { self.as_bytes().clone_to_uninit(dst as *mut [u8]) }

library/std/src/ffi/os_str.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,7 @@ impl Clone for Box<OsStr> {
12621262
#[unstable(feature = "clone_to_uninit", issue = "126799")]
12631263
unsafe impl CloneToUninit for OsStr {
12641264
#[cfg_attr(debug_assertions, track_caller)]
1265+
#[inline]
12651266
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
12661267
// SAFETY: we're just a wrapper around a platform-specific Slice
12671268
unsafe { self.inner.clone_to_uninit(addr_of_mut!((*dst).inner)) }

library/std/src/path.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3032,6 +3032,7 @@ impl Path {
30323032
#[unstable(feature = "clone_to_uninit", issue = "126799")]
30333033
unsafe impl CloneToUninit for Path {
30343034
#[cfg_attr(debug_assertions, track_caller)]
3035+
#[inline]
30353036
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
30363037
// SAFETY: Path is just a wrapper around OsStr
30373038
unsafe { self.inner.clone_to_uninit(core::ptr::addr_of_mut!((*dst).inner)) }

library/std/src/sys/os_str/bytes.rs

+1
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ impl Slice {
344344
#[unstable(feature = "clone_to_uninit", issue = "126799")]
345345
unsafe impl CloneToUninit for Slice {
346346
#[cfg_attr(debug_assertions, track_caller)]
347+
#[inline]
347348
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
348349
// SAFETY: we're just a wrapper around [u8]
349350
unsafe { self.inner.clone_to_uninit(addr_of_mut!((*dst).inner)) }

library/std/src/sys/os_str/wtf8.rs

+1
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ impl Slice {
266266
#[unstable(feature = "clone_to_uninit", issue = "126799")]
267267
unsafe impl CloneToUninit for Slice {
268268
#[cfg_attr(debug_assertions, track_caller)]
269+
#[inline]
269270
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
270271
// SAFETY: we're just a wrapper around Wtf8
271272
unsafe { self.inner.clone_to_uninit(addr_of_mut!((*dst).inner)) }

library/std/src/sys_common/wtf8.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,7 @@ impl Hash for Wtf8 {
10501050
#[unstable(feature = "clone_to_uninit", issue = "126799")]
10511051
unsafe impl CloneToUninit for Wtf8 {
10521052
#[cfg_attr(debug_assertions, track_caller)]
1053+
#[inline]
10531054
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
10541055
// SAFETY: we're just a wrapper around [u8]
10551056
unsafe { self.bytes.clone_to_uninit(addr_of_mut!((*dst).bytes)) }

0 commit comments

Comments
 (0)