about summary refs log tree commit diff
path: root/library
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-10-05 09:20:39 +0200
committerRalf Jung <post@ralfj.de>2020-10-16 11:33:35 +0200
commitdefcd7ff47d81f184eb3ba5c1d44bbb9e3658de0 (patch)
tree55b605a381916f76372a315eb4446eccb913eb79 /library
parent6a32e794c2180a514ad80d3a481300b9afe0b536 (diff)
downloadrust-defcd7ff47d81f184eb3ba5c1d44bbb9e3658de0.tar.gz
rust-defcd7ff47d81f184eb3ba5c1d44bbb9e3658de0.zip
stop relying on feature(untagged_unions) in stdlib
Diffstat (limited to 'library')
-rw-r--r--library/core/src/lib.rs2
-rw-r--r--library/core/src/ptr/mod.rs10
-rw-r--r--library/std/src/lib.rs2
3 files changed, 12 insertions, 2 deletions
diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs
index 97f27566eb0..737a95b603b 100644
--- a/library/core/src/lib.rs
+++ b/library/core/src/lib.rs
@@ -131,7 +131,7 @@
 #![feature(transparent_unions)]
 #![feature(unboxed_closures)]
 #![feature(unsized_locals)]
-#![feature(untagged_unions)]
+#![cfg_attr(bootstrap, feature(untagged_unions))]
 #![feature(unwind_attributes)]
 #![feature(variant_count)]
 #![feature(tbm_target_feature)]
diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs
index 92c4f2ccfe8..bca3be56ba5 100644
--- a/library/core/src/ptr/mod.rs
+++ b/library/core/src/ptr/mod.rs
@@ -229,6 +229,16 @@ pub(crate) struct FatPtr<T> {
     pub(crate) len: usize,
 }
 
+// Manual impl needed to avoid `T: Clone` bound.
+impl<T> Clone for FatPtr<T> {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+// Manual impl needed to avoid `T: Copy` bound.
+impl<T> Copy for FatPtr<T> {}
+
 /// Forms a raw slice from a pointer and a length.
 ///
 /// The `len` argument is the number of **elements**, not the number of bytes.
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs
index 5224672adb2..30e7a7f3c3b 100644
--- a/library/std/src/lib.rs
+++ b/library/std/src/lib.rs
@@ -319,7 +319,7 @@
 #![feature(unsafe_block_in_unsafe_fn)]
 #![feature(unsafe_cell_get_mut)]
 #![feature(unsafe_cell_raw_get)]
-#![feature(untagged_unions)]
+#![cfg_attr(bootstrap, feature(untagged_unions))]
 #![feature(unwind_attributes)]
 #![feature(vec_into_raw_parts)]
 #![feature(wake_trait)]