@@ -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" ) ]
286287unsafe 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" ) ]
297298unsafe 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" ) ]
327330unsafe 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" ) ]
347351unsafe 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 ] ) }
0 commit comments