Skip to content

Commit 26874cc

Browse files
committed
Sparkle some attributes over CloneToUninit stuff
1 parent e8c3718 commit 26874cc

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

Diff for: core/src/clone.rs

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

273273
#[unstable(feature = "clone_to_uninit", issue = "126799")]
274274
unsafe impl<T: Clone> CloneToUninit for T {
275+
#[inline]
275276
default unsafe fn clone_to_uninit(&self, dst: *mut Self) {
276277
// SAFETY: The safety conditions of clone_to_uninit() are a superset of those of
277278
// ptr::write().
@@ -285,8 +286,10 @@ unsafe impl<T: Clone> CloneToUninit for T {
285286

286287
// Specialized implementation for types that are [`Copy`], not just [`Clone`],
287288
// and can therefore be copied bitwise.
289+
#[doc(hidden)]
288290
#[unstable(feature = "clone_to_uninit", issue = "126799")]
289291
unsafe impl<T: Copy> CloneToUninit for T {
292+
#[inline]
290293
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
291294
// SAFETY: The safety conditions of clone_to_uninit() are a superset of those of
292295
// ptr::copy_nonoverlapping().
@@ -298,6 +301,7 @@ unsafe impl<T: Copy> CloneToUninit for T {
298301

299302
#[unstable(feature = "clone_to_uninit", issue = "126799")]
300303
unsafe impl<T: Clone> CloneToUninit for [T] {
304+
#[inline]
301305
#[cfg_attr(debug_assertions, track_caller)]
302306
default unsafe fn clone_to_uninit(&self, dst: *mut Self) {
303307
let len = self.len();
@@ -326,8 +330,10 @@ unsafe impl<T: Clone> CloneToUninit for [T] {
326330
}
327331
}
328332

333+
#[doc(hidden)]
329334
#[unstable(feature = "clone_to_uninit", issue = "126799")]
330335
unsafe impl<T: Copy> CloneToUninit for [T] {
336+
#[inline]
331337
#[cfg_attr(debug_assertions, track_caller)]
332338
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
333339
let len = self.len();
@@ -348,6 +354,7 @@ unsafe impl<T: Copy> CloneToUninit for [T] {
348354

349355
#[unstable(feature = "clone_to_uninit", issue = "126799")]
350356
unsafe impl CloneToUninit for str {
357+
#[inline]
351358
#[cfg_attr(debug_assertions, track_caller)]
352359
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
353360
// SAFETY: str is just a [u8] with UTF-8 invariant

Diff for: std/src/ffi/os_str.rs

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

12671267
#[unstable(feature = "clone_to_uninit", issue = "126799")]
12681268
unsafe impl CloneToUninit for OsStr {
1269+
#[inline]
12691270
#[cfg_attr(debug_assertions, track_caller)]
12701271
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
12711272
// SAFETY: we're just a wrapper around a platform-specific Slice

Diff for: std/src/path.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3113,6 +3113,7 @@ impl Path {
31133113

31143114
#[unstable(feature = "clone_to_uninit", issue = "126799")]
31153115
unsafe impl CloneToUninit for Path {
3116+
#[inline]
31163117
#[cfg_attr(debug_assertions, track_caller)]
31173118
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
31183119
// SAFETY: Path is just a wrapper around OsStr

Diff for: std/src/sys/os_str/bytes.rs

+1
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ impl Slice {
351351

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

Diff for: std/src/sys/os_str/wtf8.rs

+1
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ impl Slice {
274274

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

Diff for: std/src/sys_common/wtf8.rs

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

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

0 commit comments

Comments
 (0)