Skip to content

Commit defcd7f

Browse files
committed
stop relying on feature(untagged_unions) in stdlib
1 parent 6a32e79 commit defcd7f

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

library/core/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
#![feature(transparent_unions)]
132132
#![feature(unboxed_closures)]
133133
#![feature(unsized_locals)]
134-
#![feature(untagged_unions)]
134+
#![cfg_attr(bootstrap, feature(untagged_unions))]
135135
#![feature(unwind_attributes)]
136136
#![feature(variant_count)]
137137
#![feature(tbm_target_feature)]

library/core/src/ptr/mod.rs

+10
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,16 @@ pub(crate) struct FatPtr<T> {
229229
pub(crate) len: usize,
230230
}
231231

232+
// Manual impl needed to avoid `T: Clone` bound.
233+
impl<T> Clone for FatPtr<T> {
234+
fn clone(&self) -> Self {
235+
*self
236+
}
237+
}
238+
239+
// Manual impl needed to avoid `T: Copy` bound.
240+
impl<T> Copy for FatPtr<T> {}
241+
232242
/// Forms a raw slice from a pointer and a length.
233243
///
234244
/// The `len` argument is the number of **elements**, not the number of bytes.

library/std/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@
319319
#![feature(unsafe_block_in_unsafe_fn)]
320320
#![feature(unsafe_cell_get_mut)]
321321
#![feature(unsafe_cell_raw_get)]
322-
#![feature(untagged_unions)]
322+
#![cfg_attr(bootstrap, feature(untagged_unions))]
323323
#![feature(unwind_attributes)]
324324
#![feature(vec_into_raw_parts)]
325325
#![feature(wake_trait)]

0 commit comments

Comments
 (0)