1
Fork 0

Fix the fallout of removing feature(import_shadowing).

This commit is contained in:
Eduard Burtescu 2014-12-15 06:03:00 +02:00
parent d5267d5845
commit 5193d542f6
20 changed files with 41 additions and 65 deletions

View file

@ -54,7 +54,6 @@ use core::default::Default;
use core::fmt; use core::fmt;
use core::hash::{mod, Hash}; use core::hash::{mod, Hash};
use core::kinds::marker::{ContravariantLifetime, InvariantType}; use core::kinds::marker::{ContravariantLifetime, InvariantType};
use core::kinds::Sized;
use core::mem; use core::mem;
use core::num::{Int, UnsignedInt}; use core::num::{Int, UnsignedInt};
use core::ops; use core::ops;

View file

@ -21,7 +21,6 @@ use core::hash::{Hash, Writer};
use core::iter; use core::iter;
use core::iter::{Enumerate, FilterMap, Map}; use core::iter::{Enumerate, FilterMap, Map};
use core::mem::replace; use core::mem::replace;
use core::ops::FnOnce;
use {vec, slice}; use {vec, slice};
use vec::Vec; use vec::Vec;

View file

@ -22,7 +22,7 @@ use middle::expr_use_visitor as euv;
use middle::mem_categorization::cmt; use middle::mem_categorization::cmt;
use middle::pat_util::*; use middle::pat_util::*;
use middle::ty::*; use middle::ty::*;
use middle::ty::{mod, Ty}; use middle::ty;
use std::fmt; use std::fmt;
use std::iter::AdditiveIterator; use std::iter::AdditiveIterator;
use std::iter::range_inclusive; use std::iter::range_inclusive;

View file

@ -14,8 +14,6 @@
pub use self::MoveKind::*; pub use self::MoveKind::*;
use borrowck::*; use borrowck::*;
use borrowck::LoanPathKind::{LpVar, LpUpvar, LpDowncast, LpExtend};
use borrowck::LoanPathElem::{LpInterior};
use rustc::middle::cfg; use rustc::middle::cfg;
use rustc::middle::dataflow::DataFlowContext; use rustc::middle::dataflow::DataFlowContext;
use rustc::middle::dataflow::BitwiseOperator; use rustc::middle::dataflow::BitwiseOperator;

View file

@ -487,7 +487,7 @@ pub fn trans_fn_ref_with_substs<'blk, 'tcx>(
let opt_ref_id = match node { let opt_ref_id = match node {
ExprId(id) => if id != 0 { Some(id) } else { None }, ExprId(id) => if id != 0 { Some(id) } else { None },
MethodCall(_) => None, MethodCallKey(_) => None,
}; };
let (val, must_cast) = let (val, must_cast) =
@ -498,7 +498,7 @@ pub fn trans_fn_ref_with_substs<'blk, 'tcx>(
// are subst'd) // are subst'd)
let ref_ty = match node { let ref_ty = match node {
ExprId(id) => node_id_type(bcx, id), ExprId(id) => node_id_type(bcx, id),
MethodCall(method_call) => { MethodCallKey(method_call) => {
let t = (*bcx.tcx().method_map.borrow())[method_call].ty; let t = (*bcx.tcx().method_map.borrow())[method_call].ty;
monomorphize_type(bcx, t) monomorphize_type(bcx, t)
} }

View file

@ -867,7 +867,7 @@ pub enum ExprOrMethodCall {
ExprId(ast::NodeId), ExprId(ast::NodeId),
// Type parameters for a method call like `a.foo::<int>()` // 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>, pub fn node_id_substs<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
@ -879,7 +879,7 @@ pub fn node_id_substs<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
ExprId(id) => { ExprId(id) => {
ty::node_id_item_substs(tcx, id).substs ty::node_id_item_substs(tcx, id).substs
} }
MethodCall(method_call) => { MethodCallKey(method_call) => {
(*tcx.method_map.borrow())[method_call].substs.clone() (*tcx.method_map.borrow())[method_call].substs.clone()
} }
}; };

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
use llvm::*; use llvm::ValueRef;
use middle::def; use middle::def;
use middle::lang_items::{PanicFnLangItem, PanicBoundsCheckFnLangItem}; use middle::lang_items::{PanicFnLangItem, PanicBoundsCheckFnLangItem};
use trans::_match; use trans::_match;

View file

@ -124,7 +124,7 @@ pub fn trans_method_callee<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
bcx: bcx, bcx: bcx,
data: Fn(callee::trans_fn_ref(bcx, data: Fn(callee::trans_fn_ref(bcx,
did, did,
MethodCall(method_call))), MethodCallKey(method_call))),
} }
} }
@ -344,12 +344,12 @@ fn trans_monomorphized_callee<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
// those from the impl and those from the method: // those from the impl and those from the method:
let callee_substs = let callee_substs =
combine_impl_and_methods_tps( combine_impl_and_methods_tps(
bcx, MethodCall(method_call), vtable_impl.substs); bcx, MethodCallKey(method_call), vtable_impl.substs);
// translate the function // translate the function
let llfn = trans_fn_ref_with_substs(bcx, let llfn = trans_fn_ref_with_substs(bcx,
mth_id, mth_id,
MethodCall(method_call), MethodCallKey(method_call),
callee_substs); callee_substs);
Callee { bcx: bcx, data: Fn(llfn) } Callee { bcx: bcx, data: Fn(llfn) }
@ -359,7 +359,7 @@ fn trans_monomorphized_callee<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
// after passing through fulfill_obligation // after passing through fulfill_obligation
let llfn = trans_fn_ref_with_substs(bcx, let llfn = trans_fn_ref_with_substs(bcx,
closure_def_id, closure_def_id,
MethodCall(method_call), MethodCallKey(method_call),
substs); substs);
Callee { Callee {

View file

@ -15,21 +15,10 @@
#![experimental] #![experimental]
#![allow(missing_docs)] #![allow(missing_docs)]
use clone::Clone; use prelude::*;
use c_str::ToCStr;
use iter::IteratorExt;
use mem; use mem;
use ops::*;
use option::*;
use option::Option::{None, Some};
use os; use os;
use path::{Path,GenericPath};
use result::*;
use result::Result::{Err, Ok};
use slice::{AsSlice,SliceExt};
use str; use str;
use string::String;
use vec::Vec;
#[allow(missing_copy_implementations)] #[allow(missing_copy_implementations)]
pub struct DynamicLibrary { pub struct DynamicLibrary {
@ -213,13 +202,10 @@ mod test {
pub mod dl { pub mod dl {
pub use self::Rtld::*; pub use self::Rtld::*;
use c_str::{CString, ToCStr}; use prelude::*;
use c_str::CString;
use libc; use libc;
use ops::FnOnce;
use ptr; use ptr;
use result::*;
use result::Result::{Err, Ok};
use string::String;
pub unsafe fn open_external<T: ToCStr>(filename: T) -> *mut u8 { pub unsafe fn open_external<T: ToCStr>(filename: T) -> *mut u8 {
filename.with_c_str(|raw_name| { filename.with_c_str(|raw_name| {

View file

@ -20,7 +20,6 @@ use core::str;
use libc::{mod, uintptr_t}; use libc::{mod, uintptr_t};
use os; use os;
use str::{FromStr, from_str, Str};
use sync::atomic; use sync::atomic;
/// Dynamically inquire about whether we're running under V. /// Dynamically inquire about whether we're running under V.
@ -66,7 +65,7 @@ pub fn min_stack() -> uint {
pub fn default_sched_threads() -> uint { pub fn default_sched_threads() -> uint {
match os::getenv("RUST_THREADS") { match os::getenv("RUST_THREADS") {
Some(nstr) => { 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 { match opt_n {
Some(n) if n > 0 => n, Some(n) if n > 0 => n,
_ => panic!("`RUST_THREADS` is `{}`, should be a positive integer", nstr) _ => panic!("`RUST_THREADS` is `{}`, should be a positive integer", nstr)

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
pub use sys::mutex::raw;
use sys::mutex as imp; use sys::mutex as imp;
/// An OS-based mutual exclusion lock. /// An OS-based mutual exclusion lock.

View file

@ -18,14 +18,11 @@ use io;
use prelude::*; use prelude::*;
use io::{FilePermission, Write, UnstableFileStat, Open, FileAccess, FileMode}; 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 io::{Read, Truncate, SeekCur, SeekSet, ReadWrite, SeekEnd, Append};
use result::Result::{Ok, Err};
use sys::retry; use sys::retry;
use sys_common::{keep_going, eof, mkerr_libc}; use sys_common::{keep_going, eof, mkerr_libc};
pub use path::PosixPath as Path;
pub type fd_t = libc::c_int; pub type fd_t = libc::c_int;
pub struct FileDesc { pub struct FileDesc {

View file

@ -16,8 +16,8 @@ use error::{FromError, Error};
use fmt; use fmt;
use io::{IoError, IoResult}; use io::{IoError, IoResult};
use libc::{mod, c_int, c_char, c_void}; use libc::{mod, c_int, c_char, c_void};
use path::{Path, GenericPath, BytesContainer}; use path::BytesContainer;
use ptr::{mod, RawPtr}; use ptr;
use sync::atomic::{AtomicInt, INIT_ATOMIC_INT, SeqCst}; use sync::atomic::{AtomicInt, INIT_ATOMIC_INT, SeqCst};
use sys::fs::FileDesc; use sys::fs::FileDesc;
use os; use os;

View file

@ -20,7 +20,7 @@ use sys::fs::FileDesc;
use sys::{set_nonblocking, wouldblock}; use sys::{set_nonblocking, wouldblock};
use sys; use sys;
use sys_common; use sys_common;
use sys_common::net::*; use sys_common::net;
pub use sys_common::net::TcpStream; pub use sys_common::net::TcpStream;
@ -34,17 +34,19 @@ pub struct TcpListener {
impl TcpListener { impl TcpListener {
pub fn bind(addr: ip::SocketAddr) -> IoResult<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 ret = TcpListener { inner: FileDesc::new(fd, true) };
let mut storage = unsafe { mem::zeroed() }; 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; let addrp = &storage as *const _ as *const libc::sockaddr;
// On platforms with Berkeley-derived sockets, this allows // On platforms with Berkeley-derived sockets, this allows
// to quickly rebind a socket, without needing to wait for // to quickly rebind a socket, without needing to wait for
// the OS to clean up the previous one. // 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) } { match unsafe { libc::bind(fd, addrp, len) } {
@ -77,7 +79,7 @@ impl TcpListener {
} }
pub fn socket_name(&mut self) -> IoResult<ip::SocketAddr> { pub fn socket_name(&mut self) -> IoResult<ip::SocketAddr> {
sockname(self.fd(), libc::getsockname) net::sockname(self.fd(), libc::getsockname)
} }
} }
@ -121,15 +123,15 @@ impl TcpAcceptor {
-1 => return Err(last_net_error()), -1 => return Err(last_net_error()),
fd => return Ok(TcpStream::new(fd as sock_t)), fd => return Ok(TcpStream::new(fd as sock_t)),
} }
try!(await(&[self.fd(), self.inner.reader.fd()], try!(net::await(&[self.fd(), self.inner.reader.fd()],
deadline, Readable)); deadline, net::Readable));
} }
Err(sys_common::eof()) Err(sys_common::eof())
} }
pub fn socket_name(&mut self) -> IoResult<ip::SocketAddr> { 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>) { pub fn set_timeout(&mut self, timeout: Option<u64>) {

View file

@ -10,7 +10,6 @@
use cell::UnsafeCell; use cell::UnsafeCell;
use libc::{mod, DWORD}; use libc::{mod, DWORD};
use libc;
use os; use os;
use sys::mutex::{mod, Mutex}; use sys::mutex::{mod, Mutex};
use sys::sync as ffi; use sys::sync as ffi;

View file

@ -26,10 +26,9 @@ use sys;
use sys_common::{keep_going, eof, mkerr_libc}; use sys_common::{keep_going, eof, mkerr_libc};
use io::{FilePermission, Write, UnstableFileStat, Open, FileAccess, FileMode}; 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}; use io::{Read, Truncate, SeekCur, SeekSet, ReadWrite, SeekEnd, Append};
pub use path::WindowsPath as Path;
pub type fd_t = libc::c_int; pub type fd_t = libc::c_int;
pub struct FileDesc { pub struct FileDesc {

View file

@ -20,12 +20,10 @@ use io::{IoResult, IoError};
use libc::{c_int, c_char, c_void}; use libc::{c_int, c_char, c_void};
use libc; use libc;
use os; use os;
use path::{Path, GenericPath, BytesContainer}; use path::BytesContainer;
use ptr::{mod, RawPtr}; use ptr;
use sync::atomic::{AtomicInt, INIT_ATOMIC_INT, SeqCst}; use sync::atomic::{AtomicInt, INIT_ATOMIC_INT, SeqCst};
use sys::fs::FileDesc; use sys::fs::FileDesc;
use option::Option;
use option::Option::{Some, None};
use slice; use slice;
use os::TMPBUF_SZ; use os::TMPBUF_SZ;

View file

@ -29,7 +29,6 @@ use sys_common::helper_thread::Helper;
use sys_common::{AsInner, mkerr_libc, timeout}; use sys_common::{AsInner, mkerr_libc, timeout};
use io::fs::PathExtensions; use io::fs::PathExtensions;
use string::String;
pub use sys_common::ProcessConfig; pub use sys_common::ProcessConfig;

View file

@ -18,8 +18,7 @@ use super::{last_error, last_net_error, retry, sock_t};
use sync::{Arc, atomic}; use sync::{Arc, atomic};
use sys::fs::FileDesc; use sys::fs::FileDesc;
use sys::{mod, c, set_nonblocking, wouldblock, timer}; use sys::{mod, c, set_nonblocking, wouldblock, timer};
use sys_common::{mod, timeout, eof}; use sys_common::{mod, timeout, eof, net};
use sys_common::net::*;
pub use sys_common::net::TcpStream; pub use sys_common::net::TcpStream;
@ -54,11 +53,11 @@ impl TcpListener {
pub fn bind(addr: ip::SocketAddr) -> IoResult<TcpListener> { pub fn bind(addr: ip::SocketAddr) -> IoResult<TcpListener> {
sys::init_net(); 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 ret = TcpListener { sock: sock };
let mut storage = unsafe { mem::zeroed() }; 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; let addrp = &storage as *const _ as *const libc::sockaddr;
match unsafe { libc::bind(sock, addrp, len) } { match unsafe { libc::bind(sock, addrp, len) } {
@ -95,7 +94,7 @@ impl TcpListener {
} }
pub fn socket_name(&mut self) -> IoResult<ip::SocketAddr> { pub fn socket_name(&mut self) -> IoResult<ip::SocketAddr> {
sockname(self.socket(), libc::getsockname) net::sockname(self.socket(), libc::getsockname)
} }
} }
@ -195,7 +194,7 @@ impl TcpAcceptor {
} }
pub fn socket_name(&mut self) -> IoResult<ip::SocketAddr> { 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>) { pub fn set_timeout(&mut self, timeout: Option<u64>) {

View file

@ -124,13 +124,17 @@
//! //!
//! * It can be implemented highly efficiently on many platforms. //! * It can be implemented highly efficiently on many platforms.
use core::prelude::*;
use any::Any; use any::Any;
use borrow::IntoCow; use borrow::IntoCow;
use boxed::Box; use boxed::Box;
use cell::UnsafeCell; 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 sync::{Mutex, Condvar, Arc};
use str::Str;
use string::String; use string::String;
use rt::{mod, unwind}; use rt::{mod, unwind};
use io::{Writer, stdio}; use io::{Writer, stdio};