impl CloneToUninit for Path and OsStr · patricklam/verify-rust-std@e8c3718 (original) (raw)
`@@ -3,10 +3,13 @@
`
3
3
`#[cfg(test)]
`
4
4
`mod tests;
`
5
5
``
``
6
`+
use core::clone::CloneToUninit;
`
``
7
+
6
8
`use crate::borrow::{Borrow, Cow};
`
7
9
`use crate::collections::TryReserveError;
`
8
10
`use crate::hash::{Hash, Hasher};
`
9
11
`use crate::ops::{self, Range};
`
``
12
`+
use crate::ptr::addr_of_mut;
`
10
13
`use crate::rc::Rc;
`
11
14
`use crate::str::FromStr;
`
12
15
`use crate::sync::Arc;
`
`@@ -1261,6 +1264,15 @@ impl Clone for Box {
`
1261
1264
`}
`
1262
1265
`}
`
1263
1266
``
``
1267
`+
#[unstable(feature = "clone_to_uninit", issue = "126799")]
`
``
1268
`+
unsafe impl CloneToUninit for OsStr {
`
``
1269
`+
#[cfg_attr(debug_assertions, track_caller)]
`
``
1270
`+
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
`
``
1271
`+
// SAFETY: we're just a wrapper around a platform-specific Slice
`
``
1272
`+
unsafe { self.inner.clone_to_uninit(addr_of_mut!((*dst).inner)) }
`
``
1273
`+
}
`
``
1274
`+
}
`
``
1275
+
1264
1276
`#[stable(feature = "shared_from_slice2", since = "1.24.0")]
`
1265
1277
`impl From for Arc {
`
1266
1278
`` /// Converts an [OsString
] into an [Arc]<[OsStr]>
by moving the [OsString
]
``