Skip to content

Commit c4139df

Browse files
committed
Sparkle some attributes over CloneToUninit stuff
1 parent 07bbc8b commit c4139df

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

library/core/src/clone.rs

+7
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ pub unsafe trait CloneToUninit {
269269

270270
#[unstable(feature = "clone_to_uninit", issue = "126799")]
271271
unsafe impl<T: Clone> CloneToUninit for T {
272+
#[inline]
272273
default unsafe fn clone_to_uninit(&self, dst: *mut Self) {
273274
// SAFETY: The safety conditions of clone_to_uninit() are a superset of those of
274275
// ptr::write().
@@ -282,8 +283,10 @@ unsafe impl<T: Clone> CloneToUninit for T {
282283

283284
// Specialized implementation for types that are [`Copy`], not just [`Clone`],
284285
// and can therefore be copied bitwise.
286+
#[doc(hidden)]
285287
#[unstable(feature = "clone_to_uninit", issue = "126799")]
286288
unsafe impl<T: Copy> CloneToUninit for T {
289+
#[inline]
287290
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
288291
// SAFETY: The safety conditions of clone_to_uninit() are a superset of those of
289292
// ptr::copy_nonoverlapping().
@@ -295,6 +298,7 @@ unsafe impl<T: Copy> CloneToUninit for T {
295298

296299
#[unstable(feature = "clone_to_uninit", issue = "126799")]
297300
unsafe impl<T: Clone> CloneToUninit for [T] {
301+
#[inline]
298302
#[cfg_attr(debug_assertions, track_caller)]
299303
default unsafe fn clone_to_uninit(&self, dst: *mut Self) {
300304
let len = self.len();
@@ -323,8 +327,10 @@ unsafe impl<T: Clone> CloneToUninit for [T] {
323327
}
324328
}
325329

330+
#[doc(hidden)]
326331
#[unstable(feature = "clone_to_uninit", issue = "126799")]
327332
unsafe impl<T: Copy> CloneToUninit for [T] {
333+
#[inline]
328334
#[cfg_attr(debug_assertions, track_caller)]
329335
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
330336
let len = self.len();
@@ -345,6 +351,7 @@ unsafe impl<T: Copy> CloneToUninit for [T] {
345351

346352
#[unstable(feature = "clone_to_uninit", issue = "126799")]
347353
unsafe impl CloneToUninit for str {
354+
#[inline]
348355
#[cfg_attr(debug_assertions, track_caller)]
349356
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
350357
// SAFETY: str is just a [u8] with UTF-8 invariant

library/std/src/ffi/os_str.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,7 @@ impl Clone for Box<OsStr> {
12711271

12721272
#[unstable(feature = "clone_to_uninit", issue = "126799")]
12731273
unsafe impl CloneToUninit for OsStr {
1274+
#[inline]
12741275
#[cfg_attr(debug_assertions, track_caller)]
12751276
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
12761277
// SAFETY: we're just a wrapper around a platform-specific Slice

library/std/src/path.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3026,6 +3026,7 @@ impl Path {
30263026

30273027
#[unstable(feature = "clone_to_uninit", issue = "126799")]
30283028
unsafe impl CloneToUninit for Path {
3029+
#[inline]
30293030
#[cfg_attr(debug_assertions, track_caller)]
30303031
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
30313032
// SAFETY: Path is just a wrapper around OsStr

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

+1
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ impl Slice {
353353

354354
#[unstable(feature = "clone_to_uninit", issue = "126799")]
355355
unsafe impl CloneToUninit for Slice {
356+
#[inline]
356357
#[cfg_attr(debug_assertions, track_caller)]
357358
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
358359
// SAFETY: we're just a wrapper around [u8]

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

+1
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ impl Slice {
275275

276276
#[unstable(feature = "clone_to_uninit", issue = "126799")]
277277
unsafe impl CloneToUninit for Slice {
278+
#[inline]
278279
#[cfg_attr(debug_assertions, track_caller)]
279280
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
280281
// SAFETY: we're just a wrapper around Wtf8

library/std/src/sys_common/wtf8.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,7 @@ impl Hash for Wtf8 {
10491049

10501050
#[unstable(feature = "clone_to_uninit", issue = "126799")]
10511051
unsafe impl CloneToUninit for Wtf8 {
1052+
#[inline]
10521053
#[cfg_attr(debug_assertions, track_caller)]
10531054
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
10541055
// SAFETY: we're just a wrapper around [u8]

0 commit comments

Comments
 (0)