use core::fmt;
use core::hash::{mod, Hash};
use core::kinds::marker::{ContravariantLifetime, InvariantType};
-use core::kinds::Sized;
use core::mem;
use core::num::{Int, UnsignedInt};
use core::ops;
use core::iter;
use core::iter::{Enumerate, FilterMap, Map};
use core::mem::replace;
-use core::ops::FnOnce;
use {vec, slice};
use vec::Vec;
use middle::mem_categorization::cmt;
use middle::pat_util::*;
use middle::ty::*;
-use middle::ty::{mod, Ty};
+use middle::ty;
use std::fmt;
use std::iter::AdditiveIterator;
use std::iter::range_inclusive;
pub use self::MoveKind::*;
use borrowck::*;
-use borrowck::LoanPathKind::{LpVar, LpUpvar, LpDowncast, LpExtend};
-use borrowck::LoanPathElem::{LpInterior};
use rustc::middle::cfg;
use rustc::middle::dataflow::DataFlowContext;
use rustc::middle::dataflow::BitwiseOperator;
let opt_ref_id = match node {
ExprId(id) => if id != 0 { Some(id) } else { None },
- MethodCall(_) => None,
+ MethodCallKey(_) => None,
};
let (val, must_cast) =
// are subst'd)
let ref_ty = match node {
ExprId(id) => node_id_type(bcx, id),
- MethodCall(method_call) => {
+ MethodCallKey(method_call) => {
let t = (*bcx.tcx().method_map.borrow())[method_call].ty;
monomorphize_type(bcx, t)
}
ExprId(ast::NodeId),
// Type parameters for a method call like `a.foo::<int>()`
- MethodCall(ty::MethodCall)
+ MethodCallKey(ty::MethodCall)
}
pub fn node_id_substs<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
ExprId(id) => {
ty::node_id_item_substs(tcx, id).substs
}
- MethodCall(method_call) => {
+ MethodCallKey(method_call) => {
(*tcx.method_map.borrow())[method_call].substs.clone()
}
};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-use llvm::*;
+use llvm::ValueRef;
use middle::def;
use middle::lang_items::{PanicFnLangItem, PanicBoundsCheckFnLangItem};
use trans::_match;
bcx: bcx,
data: Fn(callee::trans_fn_ref(bcx,
did,
- MethodCall(method_call))),
+ MethodCallKey(method_call))),
}
}
// those from the impl and those from the method:
let callee_substs =
combine_impl_and_methods_tps(
- bcx, MethodCall(method_call), vtable_impl.substs);
+ bcx, MethodCallKey(method_call), vtable_impl.substs);
// translate the function
let llfn = trans_fn_ref_with_substs(bcx,
mth_id,
- MethodCall(method_call),
+ MethodCallKey(method_call),
callee_substs);
Callee { bcx: bcx, data: Fn(llfn) }
// after passing through fulfill_obligation
let llfn = trans_fn_ref_with_substs(bcx,
closure_def_id,
- MethodCall(method_call),
+ MethodCallKey(method_call),
substs);
Callee {
#![experimental]
#![allow(missing_docs)]
-use clone::Clone;
-use c_str::ToCStr;
-use iter::IteratorExt;
+use prelude::*;
use mem;
-use ops::*;
-use option::*;
-use option::Option::{None, Some};
use os;
-use path::{Path,GenericPath};
-use result::*;
-use result::Result::{Err, Ok};
-use slice::{AsSlice,SliceExt};
use str;
-use string::String;
-use vec::Vec;
#[allow(missing_copy_implementations)]
pub struct DynamicLibrary {
pub mod dl {
pub use self::Rtld::*;
- use c_str::{CString, ToCStr};
+ use prelude::*;
+ use c_str::CString;
use libc;
- use ops::FnOnce;
use ptr;
- use result::*;
- use result::Result::{Err, Ok};
- use string::String;
pub unsafe fn open_external<T: ToCStr>(filename: T) -> *mut u8 {
filename.with_c_str(|raw_name| {
use libc::{mod, uintptr_t};
use os;
-use str::{FromStr, from_str, Str};
use sync::atomic;
/// Dynamically inquire about whether we're running under V.
pub fn default_sched_threads() -> uint {
match os::getenv("RUST_THREADS") {
Some(nstr) => {
- let opt_n: Option<uint> = FromStr::from_str(nstr.as_slice());
+ let opt_n: Option<uint> = from_str(nstr.as_slice());
match opt_n {
Some(n) if n > 0 => n,
_ => panic!("`RUST_THREADS` is `{}`, should be a positive integer", nstr)
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-pub use sys::mutex::raw;
-
use sys::mutex as imp;
/// An OS-based mutual exclusion lock.
use prelude::*;
use io::{FilePermission, Write, UnstableFileStat, Open, FileAccess, FileMode};
-use io::{IoResult, FileStat, SeekStyle, Reader};
+use io::{IoResult, FileStat, SeekStyle};
use io::{Read, Truncate, SeekCur, SeekSet, ReadWrite, SeekEnd, Append};
-use result::Result::{Ok, Err};
use sys::retry;
use sys_common::{keep_going, eof, mkerr_libc};
-pub use path::PosixPath as Path;
-
pub type fd_t = libc::c_int;
pub struct FileDesc {
use fmt;
use io::{IoError, IoResult};
use libc::{mod, c_int, c_char, c_void};
-use path::{Path, GenericPath, BytesContainer};
-use ptr::{mod, RawPtr};
+use path::BytesContainer;
+use ptr;
use sync::atomic::{AtomicInt, INIT_ATOMIC_INT, SeqCst};
use sys::fs::FileDesc;
use os;
use sys::{set_nonblocking, wouldblock};
use sys;
use sys_common;
-use sys_common::net::*;
+use sys_common::net;
pub use sys_common::net::TcpStream;
impl TcpListener {
pub fn bind(addr: ip::SocketAddr) -> IoResult<TcpListener> {
- let fd = try!(socket(addr, libc::SOCK_STREAM));
+ let fd = try!(net::socket(addr, libc::SOCK_STREAM));
let ret = TcpListener { inner: FileDesc::new(fd, true) };
let mut storage = unsafe { mem::zeroed() };
- let len = addr_to_sockaddr(addr, &mut storage);
+ let len = net::addr_to_sockaddr(addr, &mut storage);
let addrp = &storage as *const _ as *const libc::sockaddr;
// On platforms with Berkeley-derived sockets, this allows
// to quickly rebind a socket, without needing to wait for
// the OS to clean up the previous one.
- try!(setsockopt(fd, libc::SOL_SOCKET, libc::SO_REUSEADDR, 1 as libc::c_int));
+ try!(net::setsockopt(fd, libc::SOL_SOCKET,
+ libc::SO_REUSEADDR,
+ 1 as libc::c_int));
match unsafe { libc::bind(fd, addrp, len) } {
}
pub fn socket_name(&mut self) -> IoResult<ip::SocketAddr> {
- sockname(self.fd(), libc::getsockname)
+ net::sockname(self.fd(), libc::getsockname)
}
}
-1 => return Err(last_net_error()),
fd => return Ok(TcpStream::new(fd as sock_t)),
}
- try!(await(&[self.fd(), self.inner.reader.fd()],
- deadline, Readable));
+ try!(net::await(&[self.fd(), self.inner.reader.fd()],
+ deadline, net::Readable));
}
Err(sys_common::eof())
}
pub fn socket_name(&mut self) -> IoResult<ip::SocketAddr> {
- sockname(self.fd(), libc::getsockname)
+ net::sockname(self.fd(), libc::getsockname)
}
pub fn set_timeout(&mut self, timeout: Option<u64>) {
use cell::UnsafeCell;
use libc::{mod, DWORD};
-use libc;
use os;
use sys::mutex::{mod, Mutex};
use sys::sync as ffi;
use sys_common::{keep_going, eof, mkerr_libc};
use io::{FilePermission, Write, UnstableFileStat, Open, FileAccess, FileMode};
-use io::{IoResult, IoError, FileStat, SeekStyle, Seek, Writer, Reader};
+use io::{IoResult, IoError, FileStat, SeekStyle};
use io::{Read, Truncate, SeekCur, SeekSet, ReadWrite, SeekEnd, Append};
-pub use path::WindowsPath as Path;
pub type fd_t = libc::c_int;
pub struct FileDesc {
use libc::{c_int, c_char, c_void};
use libc;
use os;
-use path::{Path, GenericPath, BytesContainer};
-use ptr::{mod, RawPtr};
+use path::BytesContainer;
+use ptr;
use sync::atomic::{AtomicInt, INIT_ATOMIC_INT, SeqCst};
use sys::fs::FileDesc;
-use option::Option;
-use option::Option::{Some, None};
use slice;
use os::TMPBUF_SZ;
use sys_common::{AsInner, mkerr_libc, timeout};
use io::fs::PathExtensions;
-use string::String;
pub use sys_common::ProcessConfig;
use sync::{Arc, atomic};
use sys::fs::FileDesc;
use sys::{mod, c, set_nonblocking, wouldblock, timer};
-use sys_common::{mod, timeout, eof};
-use sys_common::net::*;
+use sys_common::{mod, timeout, eof, net};
pub use sys_common::net::TcpStream;
pub fn bind(addr: ip::SocketAddr) -> IoResult<TcpListener> {
sys::init_net();
- let sock = try!(socket(addr, libc::SOCK_STREAM));
+ let sock = try!(net::socket(addr, libc::SOCK_STREAM));
let ret = TcpListener { sock: sock };
let mut storage = unsafe { mem::zeroed() };
- let len = addr_to_sockaddr(addr, &mut storage);
+ let len = net::addr_to_sockaddr(addr, &mut storage);
let addrp = &storage as *const _ as *const libc::sockaddr;
match unsafe { libc::bind(sock, addrp, len) } {
}
pub fn socket_name(&mut self) -> IoResult<ip::SocketAddr> {
- sockname(self.socket(), libc::getsockname)
+ net::sockname(self.socket(), libc::getsockname)
}
}
}
pub fn socket_name(&mut self) -> IoResult<ip::SocketAddr> {
- sockname(self.socket(), libc::getsockname)
+ net::sockname(self.socket(), libc::getsockname)
}
pub fn set_timeout(&mut self, timeout: Option<u64>) {
//!
//! * It can be implemented highly efficiently on many platforms.
-use core::prelude::*;
-
use any::Any;
use borrow::IntoCow;
use boxed::Box;
use cell::UnsafeCell;
+use clone::Clone;
+use kinds::Send;
+use ops::{Drop, FnOnce};
+use option::Option::{mod, Some, None};
+use result::Result::{Err, Ok};
use sync::{Mutex, Condvar, Arc};
+use str::Str;
use string::String;
use rt::{mod, unwind};
use io::{Writer, stdio};