diff options
| author | bors <bors@rust-lang.org> | 2015-02-23 20:47:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-02-23 20:47:30 +0000 |
| commit | 91a5a1ab4ad054c8dccf49f6f409542f82683cfc (patch) | |
| tree | 1c2a90b8e1aac6793a0fbf6350778a5b9ac65dae /src/libstd/sys/common | |
| parent | f0f7ca27de6b4e03f30012656dad270cda55a363 (diff) | |
| parent | ee6f2a1ad6ab79ed954cd96fff6eaddcdfb6a043 (diff) | |
| download | rust-91a5a1ab4ad054c8dccf49f6f409542f82683cfc.tar.gz rust-91a5a1ab4ad054c8dccf49f6f409542f82683cfc.zip | |
Auto merge of #22724 - Manishearth:rollup, r=alexcrichton
Seems to pass `check-stage1`, but I had to tweak some things so it's going through the test gauntlet again.
Diffstat (limited to 'src/libstd/sys/common')
| -rw-r--r-- | src/libstd/sys/common/helper_thread.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sys/common/thread.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/sys/common/helper_thread.rs b/src/libstd/sys/common/helper_thread.rs index dc1ae85efe0..5faaa928ee9 100644 --- a/src/libstd/sys/common/helper_thread.rs +++ b/src/libstd/sys/common/helper_thread.rs @@ -22,8 +22,8 @@ use prelude::v1::*; +use boxed; use cell::UnsafeCell; -use mem; use ptr; use rt; use sync::{StaticMutex, StaticCondvar}; @@ -88,7 +88,7 @@ impl<M: Send> Helper<M> { let _guard = self.lock.lock().unwrap(); if !*self.initialized.get() { let (tx, rx) = channel(); - *self.chan.get() = mem::transmute(box tx); + *self.chan.get() = boxed::into_raw(box tx); let (receive, send) = helper_signal::new(); *self.signal.get() = send as uint; @@ -132,7 +132,7 @@ impl<M: Send> Helper<M> { let mut guard = self.lock.lock().unwrap(); // Close the channel by destroying it - let chan: Box<Sender<M>> = mem::transmute(*self.chan.get()); + let chan: Box<Sender<M>> = Box::from_raw(*self.chan.get()); *self.chan.get() = ptr::null_mut(); drop(chan); helper_signal::signal(*self.signal.get() as helper_signal::signal); diff --git a/src/libstd/sys/common/thread.rs b/src/libstd/sys/common/thread.rs index b725b6c7e6e..731617858e9 100644 --- a/src/libstd/sys/common/thread.rs +++ b/src/libstd/sys/common/thread.rs @@ -27,7 +27,7 @@ pub fn start_thread(main: *mut libc::c_void) -> thread::rust_thread_return { unsafe { stack::record_os_managed_stack_bounds(0, usize::MAX); let handler = stack_overflow::Handler::new(); - let f: Box<Thunk> = mem::transmute(main); + let f: Box<Thunk> = Box::from_raw(main as *mut Thunk); f.invoke(()); drop(handler); mem::transmute(0 as thread::rust_thread_return) |
