Skip to content

Commit 4979bcc

Browse files
committedDec 22, 2017
Auto merge of #46925 - arielb1:make-the-trains-run-on-time, r=arielb1
Bounce out the layout refactor from beta @eddyb's #45225 was supposed to get into get into 1.24, but due to an ordering mistake, it had snuck into 1.23. That wide-effect translation-changing PR had poked LLVM's weak corners and caused many regressions (3 of them have fixes I include here, but also #46897, #46845, #46449, #46371). I don't think it is a good idea to land it in the beta (1.23) because there are bound to be some regressions we didn't patch. Therefore, I am reverting it in time for stable, along with its related regression fixes. r? @michaelwoerister (I think)
2 parents 3ab24df + d6a5946 commit 4979bcc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+5614
-4977
lines changed
 

‎src/liballoc/boxed.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl<T> Place<T> for IntermediateBox<T> {
151151
unsafe fn finalize<T>(b: IntermediateBox<T>) -> Box<T> {
152152
let p = b.ptr as *mut T;
153153
mem::forget(b);
154-
Box::from_raw(p)
154+
mem::transmute(p)
155155
}
156156

157157
fn make_place<T>() -> IntermediateBox<T> {
@@ -300,10 +300,7 @@ impl<T: ?Sized> Box<T> {
300300
issue = "27730")]
301301
#[inline]
302302
pub unsafe fn from_unique(u: Unique<T>) -> Self {
303-
#[cfg(stage0)]
304-
return mem::transmute(u);
305-
#[cfg(not(stage0))]
306-
return Box(u);
303+
mem::transmute(u)
307304
}
308305

309306
/// Consumes the `Box`, returning the wrapped raw pointer.
@@ -365,14 +362,7 @@ impl<T: ?Sized> Box<T> {
365362
issue = "27730")]
366363
#[inline]
367364
pub fn into_unique(b: Box<T>) -> Unique<T> {
368-
#[cfg(stage0)]
369-
return unsafe { mem::transmute(b) };
370-
#[cfg(not(stage0))]
371-
return {
372-
let unique = b.0;
373-
mem::forget(b);
374-
unique
375-
};
365+
unsafe { mem::transmute(b) }
376366
}
377367
}
378368

@@ -637,7 +627,7 @@ impl Box<Any + Send> {
637627
pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any + Send>> {
638628
<Box<Any>>::downcast(self).map_err(|s| unsafe {
639629
// reapply the Send marker
640-
Box::from_raw(Box::into_raw(s) as *mut (Any + Send))
630+
mem::transmute::<Box<Any>, Box<Any + Send>>(s)
641631
})
642632
}
643633
}

‎src/librustc/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,11 @@
4646
#![feature(const_fn)]
4747
#![feature(core_intrinsics)]
4848
#![feature(drain_filter)]
49-
#![feature(i128)]
5049
#![feature(i128_type)]
51-
#![feature(inclusive_range)]
50+
#![feature(match_default_bindings)]
5251
#![feature(inclusive_range_syntax)]
5352
#![cfg_attr(windows, feature(libc))]
5453
#![feature(macro_vis_matcher)]
55-
#![feature(match_default_bindings)]
5654
#![feature(never_type)]
5755
#![feature(nonzero)]
5856
#![feature(quote)]

0 commit comments

Comments
 (0)