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::hash::{mod, Hash};
use core::kinds::marker::{ContravariantLifetime, InvariantType};
use core::kinds::Sized;
use core::mem;
use core::num::{Int, UnsignedInt};
use core::ops;

View file

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

View file

@ -22,7 +22,7 @@ use middle::expr_use_visitor as euv;
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;

View file

@ -14,8 +14,6 @@
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;

View file

@ -487,7 +487,7 @@ pub fn trans_fn_ref_with_substs<'blk, 'tcx>(
let opt_ref_id = match node {
ExprId(id) => if id != 0 { Some(id) } else { None },
MethodCall(_) => None,
MethodCallKey(_) => None,
};
let (val, must_cast) =
@ -498,7 +498,7 @@ pub fn trans_fn_ref_with_substs<'blk, 'tcx>(
// 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)
}

View file

@ -867,7 +867,7 @@ pub enum ExprOrMethodCall {
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>,
@ -879,7 +879,7 @@ 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()
}
};

View file

@ -8,7 +8,7 @@
// 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;

View file

@ -124,7 +124,7 @@ pub fn trans_method_callee<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
bcx: bcx,
data: Fn(callee::trans_fn_ref(bcx,
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:
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) }
@ -359,7 +359,7 @@ fn trans_monomorphized_callee<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
// after passing through fulfill_obligation
let llfn = trans_fn_ref_with_substs(bcx,
closure_def_id,
MethodCall(method_call),
MethodCallKey(method_call),
substs);
Callee {

View file

@ -15,21 +15,10 @@
#![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 {
@ -213,13 +202,10 @@ mod test {
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| {

View file

@ -20,7 +20,6 @@ use core::str;
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.
@ -66,7 +65,7 @@ pub fn min_stack() -> uint {
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)

View file

@ -8,8 +8,6 @@
// 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.

View file

@ -18,14 +18,11 @@ use io;
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 {

View file

@ -16,8 +16,8 @@ use error::{FromError, Error};
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;

View file

@ -20,7 +20,7 @@ use sys::fs::FileDesc;
use sys::{set_nonblocking, wouldblock};
use sys;
use sys_common;
use sys_common::net::*;
use sys_common::net;
pub use sys_common::net::TcpStream;
@ -34,17 +34,19 @@ pub struct TcpListener {
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) } {
@ -77,7 +79,7 @@ impl TcpListener {
}
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()),
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>) {

View file

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

View file

@ -26,10 +26,9 @@ use sys;
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 {

View file

@ -20,12 +20,10 @@ use io::{IoResult, IoError};
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;

View file

@ -29,7 +29,6 @@ use sys_common::helper_thread::Helper;
use sys_common::{AsInner, mkerr_libc, timeout};
use io::fs::PathExtensions;
use string::String;
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 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;
@ -54,11 +53,11 @@ impl TcpListener {
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) } {
@ -95,7 +94,7 @@ impl TcpListener {
}
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> {
sockname(self.socket(), libc::getsockname)
net::sockname(self.socket(), libc::getsockname)
}
pub fn set_timeout(&mut self, timeout: Option<u64>) {

View file

@ -124,13 +124,17 @@
//!
//! * 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};