We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ddaf9b2 commit 1ef24bbCopy full SHA for 1ef24bb
src/libcore/ptr.rs
@@ -16,6 +16,7 @@
16
17
#![stable(feature = "rust1", since = "1.0.0")]
18
19
+use convert::From;
20
use intrinsics;
21
use ops::CoerceUnsized;
22
use fmt;
@@ -1288,3 +1289,10 @@ impl<T: ?Sized> fmt::Pointer for Shared<T> {
1288
1289
fmt::Pointer::fmt(&self.as_ptr(), f)
1290
}
1291
1292
+
1293
+#[unstable(feature = "shared", issue = "27730")]
1294
+impl<T: ?Sized> From<Unique<T>> for Shared<T> {
1295
+ fn from(unique: Unique<T>) -> Self {
1296
+ Shared { pointer: unique.pointer, _marker: PhantomData }
1297
+ }
1298
+}
0 commit comments