about summary refs log tree commit diff
path: root/src/libnative
diff options
context:
space:
mode:
Diffstat (limited to 'src/libnative')
-rw-r--r--src/libnative/io/addrinfo.rs8
-rw-r--r--src/libnative/io/file_win32.rs3
-rw-r--r--src/libnative/io/net.rs9
-rw-r--r--src/libnative/io/pipe_unix.rs3
-rw-r--r--src/libnative/io/process.rs6
-rw-r--r--src/libnative/io/timer_helper.rs6
-rw-r--r--src/libnative/lib.rs4
-rw-r--r--src/libnative/task.rs12
8 files changed, 24 insertions, 27 deletions
diff --git a/src/libnative/io/addrinfo.rs b/src/libnative/io/addrinfo.rs
index 57b87f21521..8ebae70f73c 100644
--- a/src/libnative/io/addrinfo.rs
+++ b/src/libnative/io/addrinfo.rs
@@ -9,11 +9,11 @@
 // except according to those terms.
 
 use ai = std::io::net::addrinfo;
+use libc::{c_char, c_int};
+use libc;
 use std::c_str::CString;
-use std::cast;
 use std::io::IoError;
-use libc;
-use libc::{c_char, c_int};
+use std::mem;
 use std::ptr::{null, mut_null};
 
 use super::net::sockaddr_to_addr;
@@ -61,7 +61,7 @@ impl GetAddrInfoRequest {
         let mut rp = res;
         while rp.is_not_null() {
             unsafe {
-                let addr = match sockaddr_to_addr(cast::transmute((*rp).ai_addr),
+                let addr = match sockaddr_to_addr(mem::transmute((*rp).ai_addr),
                                                   (*rp).ai_addrlen as uint) {
                     Ok(a) => a,
                     Err(e) => return Err(e)
diff --git a/src/libnative/io/file_win32.rs b/src/libnative/io/file_win32.rs
index 5fc9e506cf2..fc08a7f128f 100644
--- a/src/libnative/io/file_win32.rs
+++ b/src/libnative/io/file_win32.rs
@@ -11,7 +11,6 @@
 //! Blocking win32-based file I/O
 
 use std::c_str::CString;
-use std::cast;
 use std::io::IoError;
 use std::io;
 use libc::{c_int, c_void};
@@ -175,7 +174,7 @@ impl rtio::RtioFileStream for FileDesc {
         // This transmute is fine because our seek implementation doesn't
         // actually use the mutable self at all.
         // FIXME #13933: Remove/justify all `&T` to `&mut T` transmutes
-        unsafe { cast::transmute::<&_, &mut FileDesc>(self).seek(0, io::SeekCur) }
+        unsafe { mem::transmute::<&_, &mut FileDesc>(self).seek(0, io::SeekCur) }
     }
 
     fn fsync(&mut self) -> Result<(), IoError> {
diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs
index 218f8a4ef49..40b66cc526f 100644
--- a/src/libnative/io/net.rs
+++ b/src/libnative/io/net.rs
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 use libc;
-use std::cast;
 use std::io::net::ip;
 use std::io;
 use std::mem;
@@ -72,14 +71,14 @@ fn addr_to_sockaddr(addr: ip::SocketAddr) -> (libc::sockaddr_storage, uint) {
         let storage: libc::sockaddr_storage = mem::init();
         let len = match ip_to_inaddr(addr.ip) {
             InAddr(inaddr) => {
-                let storage: *mut libc::sockaddr_in = cast::transmute(&storage);
+                let storage: *mut libc::sockaddr_in = mem::transmute(&storage);
                 (*storage).sin_family = libc::AF_INET as libc::sa_family_t;
                 (*storage).sin_port = htons(addr.port);
                 (*storage).sin_addr = inaddr;
                 mem::size_of::<libc::sockaddr_in>()
             }
             In6Addr(inaddr) => {
-                let storage: *mut libc::sockaddr_in6 = cast::transmute(&storage);
+                let storage: *mut libc::sockaddr_in6 = mem::transmute(&storage);
                 (*storage).sin6_family = libc::AF_INET6 as libc::sa_family_t;
                 (*storage).sin6_port = htons(addr.port);
                 (*storage).sin6_addr = inaddr;
@@ -173,7 +172,7 @@ pub fn sockaddr_to_addr(storage: &libc::sockaddr_storage,
         libc::AF_INET => {
             assert!(len as uint >= mem::size_of::<libc::sockaddr_in>());
             let storage: &libc::sockaddr_in = unsafe {
-                cast::transmute(storage)
+                mem::transmute(storage)
             };
             let addr = storage.sin_addr.s_addr as u32;
             let a = (addr >>  0) as u8;
@@ -188,7 +187,7 @@ pub fn sockaddr_to_addr(storage: &libc::sockaddr_storage,
         libc::AF_INET6 => {
             assert!(len as uint >= mem::size_of::<libc::sockaddr_in6>());
             let storage: &libc::sockaddr_in6 = unsafe {
-                cast::transmute(storage)
+                mem::transmute(storage)
             };
             let a = ntohs(storage.sin6_addr.s6_addr[0]);
             let b = ntohs(storage.sin6_addr.s6_addr[1]);
diff --git a/src/libnative/io/pipe_unix.rs b/src/libnative/io/pipe_unix.rs
index 36ae2ba06d5..d66075f4419 100644
--- a/src/libnative/io/pipe_unix.rs
+++ b/src/libnative/io/pipe_unix.rs
@@ -10,7 +10,6 @@
 
 use libc;
 use std::c_str::CString;
-use std::cast;
 use std::intrinsics;
 use std::io;
 use std::mem;
@@ -36,7 +35,7 @@ fn addr_to_sockaddr_un(addr: &CString) -> IoResult<(libc::sockaddr_storage, uint
     assert!(mem::size_of::<libc::sockaddr_storage>() >=
             mem::size_of::<libc::sockaddr_un>());
     let mut storage: libc::sockaddr_storage = unsafe { intrinsics::init() };
-    let s: &mut libc::sockaddr_un = unsafe { cast::transmute(&mut storage) };
+    let s: &mut libc::sockaddr_un = unsafe { mem::transmute(&mut storage) };
 
     let len = addr.len();
     if len > s.sun_path.len() - 1 {
diff --git a/src/libnative/io/process.rs b/src/libnative/io/process.rs
index c83af20d1d8..81c76bba7a0 100644
--- a/src/libnative/io/process.rs
+++ b/src/libnative/io/process.rs
@@ -19,7 +19,7 @@ use p = std::io::process;
 use super::IoResult;
 use super::file;
 
-#[cfg(windows)] use std::cast;
+#[cfg(windows)] use std::mem;
 #[cfg(windows)] use std::strbuf::StrBuf;
 #[cfg(not(windows))] use super::retry;
 
@@ -326,7 +326,7 @@ fn spawn_process_os(config: p::ProcessConfig,
         with_envp(env, |envp| {
             with_dirp(dir, |dirp| {
                 cmd.with_c_str(|cmdp| {
-                    let created = CreateProcessA(ptr::null(), cast::transmute(cmdp),
+                    let created = CreateProcessA(ptr::null(), mem::transmute(cmdp),
                                                  ptr::mut_null(), ptr::mut_null(), TRUE,
                                                  flags, envp, dirp, &mut si,
                                                  &mut pi);
@@ -714,7 +714,7 @@ fn with_dirp<T>(d: Option<&Path>, cb: |*libc::c_char| -> T) -> T {
 #[cfg(windows)]
 fn free_handle(handle: *()) {
     assert!(unsafe {
-        libc::CloseHandle(cast::transmute(handle)) != 0
+        libc::CloseHandle(mem::transmute(handle)) != 0
     })
 }
 
diff --git a/src/libnative/io/timer_helper.rs b/src/libnative/io/timer_helper.rs
index 3bf967cb426..95b2620f3c7 100644
--- a/src/libnative/io/timer_helper.rs
+++ b/src/libnative/io/timer_helper.rs
@@ -20,7 +20,7 @@
 //! can be created in the future and there must be no active timers at that
 //! time.
 
-use std::cast;
+use std::mem;
 use std::rt::bookkeeping;
 use std::rt;
 use std::unstable::mutex::{StaticNativeMutex, NATIVE_MUTEX_INIT};
@@ -48,7 +48,7 @@ pub fn boot(helper: fn(imp::signal, Receiver<Req>)) {
             let (tx, rx) = channel();
             // promote this to a shared channel
             drop(tx.clone());
-            HELPER_CHAN = cast::transmute(box tx);
+            HELPER_CHAN = mem::transmute(box tx);
             let (receive, send) = imp::new();
             HELPER_SIGNAL = send;
 
@@ -86,7 +86,7 @@ fn shutdown() {
     // Clean up after ther helper thread
     unsafe {
         imp::close(HELPER_SIGNAL);
-        let _chan: Box<Sender<Req>> = cast::transmute(HELPER_CHAN);
+        let _chan: Box<Sender<Req>> = mem::transmute(HELPER_CHAN);
         HELPER_CHAN = 0 as *mut Sender<Req>;
         HELPER_SIGNAL = 0 as imp::signal;
     }
diff --git a/src/libnative/lib.rs b/src/libnative/lib.rs
index 4c0c4dcc18e..0df45f7d5a0 100644
--- a/src/libnative/lib.rs
+++ b/src/libnative/lib.rs
@@ -73,9 +73,9 @@ static OS_DEFAULT_STACK_ESTIMATE: uint = 2 * (1 << 20);
 #[lang = "start"]
 #[cfg(not(test))]
 pub fn lang_start(main: *u8, argc: int, argv: **u8) -> int {
-    use std::cast;
+    use std::mem;
     start(argc, argv, proc() {
-        let main: extern "Rust" fn() = unsafe { cast::transmute(main) };
+        let main: extern "Rust" fn() = unsafe { mem::transmute(main) };
         main();
     })
 }
diff --git a/src/libnative/task.rs b/src/libnative/task.rs
index d5b02dc007b..4183dec19d0 100644
--- a/src/libnative/task.rs
+++ b/src/libnative/task.rs
@@ -15,7 +15,7 @@
 //! in order to spawn new tasks and deschedule the current task.
 
 use std::any::Any;
-use std::cast;
+use std::mem;
 use std::rt::bookkeeping;
 use std::rt::env;
 use std::rt::local::Local;
@@ -169,7 +169,7 @@ impl rt::Runtime for Ops {
     // for both tasks because these operations are all done inside of a mutex.
     //
     // You'll also find that if blocking fails (the `f` function hands the
-    // BlockedTask back to us), we will `cast::forget` the handles. The
+    // BlockedTask back to us), we will `mem::forget` the handles. The
     // reasoning for this is the same logic as above in that the task silently
     // transfers ownership via the `uint`, not through normal compiler
     // semantics.
@@ -198,7 +198,7 @@ impl rt::Runtime for Ops {
                             guard.wait();
                         }
                     }
-                    Err(task) => { cast::forget(task.wake()); }
+                    Err(task) => { mem::forget(task.wake()); }
                 }
             } else {
                 let iter = task.make_selectable(times);
@@ -217,7 +217,7 @@ impl rt::Runtime for Ops {
                     Some(task) => {
                         match task.wake() {
                             Some(task) => {
-                                cast::forget(task);
+                                mem::forget(task);
                                 (*me).awoken = true;
                             }
                             None => {}
@@ -229,7 +229,7 @@ impl rt::Runtime for Ops {
                 }
             }
             // re-acquire ownership of the task
-            cur_task = cast::transmute(cur_task_dupe);
+            cur_task = mem::transmute(cur_task_dupe);
         }
 
         // put the task back in TLS, and everything is as it once was.
@@ -242,7 +242,7 @@ impl rt::Runtime for Ops {
         unsafe {
             let me = &mut *self as *mut Ops;
             to_wake.put_runtime(self);
-            cast::forget(to_wake);
+            mem::forget(to_wake);
             let guard = (*me).lock.lock();
             (*me).awoken = true;
             guard.signal();