@@ -269,6 +269,7 @@ pub unsafe trait CloneToUninit {
269
269
270
270
#[ unstable( feature = "clone_to_uninit" , issue = "126799" ) ]
271
271
unsafe impl < T : Clone > CloneToUninit for T {
272
+ #[ inline]
272
273
default unsafe fn clone_to_uninit ( & self , dst : * mut Self ) {
273
274
// SAFETY: The safety conditions of clone_to_uninit() are a superset of those of
274
275
// ptr::write().
@@ -282,8 +283,10 @@ unsafe impl<T: Clone> CloneToUninit for T {
282
283
283
284
// Specialized implementation for types that are [`Copy`], not just [`Clone`],
284
285
// and can therefore be copied bitwise.
286
+ #[ doc( hidden) ]
285
287
#[ unstable( feature = "clone_to_uninit" , issue = "126799" ) ]
286
288
unsafe impl < T : Copy > CloneToUninit for T {
289
+ #[ inline]
287
290
unsafe fn clone_to_uninit ( & self , dst : * mut Self ) {
288
291
// SAFETY: The safety conditions of clone_to_uninit() are a superset of those of
289
292
// ptr::copy_nonoverlapping().
@@ -295,6 +298,7 @@ unsafe impl<T: Copy> CloneToUninit for T {
295
298
296
299
#[ unstable( feature = "clone_to_uninit" , issue = "126799" ) ]
297
300
unsafe impl < T : Clone > CloneToUninit for [ T ] {
301
+ #[ inline]
298
302
#[ cfg_attr( debug_assertions, track_caller) ]
299
303
default unsafe fn clone_to_uninit ( & self , dst : * mut Self ) {
300
304
let len = self . len ( ) ;
@@ -323,8 +327,10 @@ unsafe impl<T: Clone> CloneToUninit for [T] {
323
327
}
324
328
}
325
329
330
+ #[ doc( hidden) ]
326
331
#[ unstable( feature = "clone_to_uninit" , issue = "126799" ) ]
327
332
unsafe impl < T : Copy > CloneToUninit for [ T ] {
333
+ #[ inline]
328
334
#[ cfg_attr( debug_assertions, track_caller) ]
329
335
unsafe fn clone_to_uninit ( & self , dst : * mut Self ) {
330
336
let len = self . len ( ) ;
@@ -345,6 +351,7 @@ unsafe impl<T: Copy> CloneToUninit for [T] {
345
351
346
352
#[ unstable( feature = "clone_to_uninit" , issue = "126799" ) ]
347
353
unsafe impl CloneToUninit for str {
354
+ #[ inline]
348
355
#[ cfg_attr( debug_assertions, track_caller) ]
349
356
unsafe fn clone_to_uninit ( & self , dst : * mut Self ) {
350
357
// SAFETY: str is just a [u8] with UTF-8 invariant
0 commit comments