diff options
| author | Corey Farwell <coreyf@rwell.org> | 2014-12-13 11:15:18 -0500 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-12-21 09:26:41 -0800 |
| commit | 98af642f5c8f60ae141a5d3ff92e8cc4e4317342 (patch) | |
| tree | 8dfc6b932d9322856e8297bfcb1c409f4a11c62e /src/libstd | |
| parent | c141f223d4fd4d8c8be8649877e08ddceaa43783 (diff) | |
| download | rust-98af642f5c8f60ae141a5d3ff92e8cc4e4317342.tar.gz rust-98af642f5c8f60ae141a5d3ff92e8cc4e4317342.zip | |
Remove a ton of public reexports
Remove most of the public reexports mentioned in #19253 These are all leftovers from the enum namespacing transition In particular: * src/libstd/num/strconv.rs * ExponentFormat * SignificantDigits * SignFormat * src/libstd/path/windows.rs * PathPrefix * src/libstd/sys/windows/timer.rs * Req * src/libcollections/str.rs * MaybeOwned * src/libstd/collections/hash/map.rs * Entry * src/libstd/collections/hash/table.rs * BucketState * src/libstd/dynamic_lib.rs * Rtld * src/libstd/io/net/ip.rs * IpAddr * src/libstd/os.rs * MemoryMapKind * MapOption * MapError * src/libstd/sys/common/net.rs * SocketStatus * InAddr * src/libstd/sys/unix/timer.rs * Req [breaking-change]
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/collections/hash/map.rs | 17 | ||||
| -rw-r--r-- | src/libstd/collections/hash/table.rs | 2 | ||||
| -rw-r--r-- | src/libstd/dynamic_lib.rs | 2 | ||||
| -rw-r--r-- | src/libstd/num/f32.rs | 18 | ||||
| -rw-r--r-- | src/libstd/num/f64.rs | 18 | ||||
| -rw-r--r-- | src/libstd/num/strconv.rs | 6 | ||||
| -rw-r--r-- | src/libstd/os.rs | 18 | ||||
| -rw-r--r-- | src/libstd/path/windows.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sys/common/net.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/unix/pipe.rs | 1 | ||||
| -rw-r--r-- | src/libstd/sys/unix/tcp.rs | 3 | ||||
| -rw-r--r-- | src/libstd/sys/unix/timer.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/timer.rs | 2 |
13 files changed, 53 insertions, 43 deletions
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 0b04edf6776..c32fec67d66 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -10,7 +10,7 @@ // // ignore-lexer-test FIXME #15883 -pub use self::Entry::*; +use self::Entry::*; use self::SearchResult::*; use self::VacantEntryState::*; @@ -30,18 +30,20 @@ use option::Option::{Some, None}; use result::Result; use result::Result::{Ok, Err}; -use super::table; use super::table::{ + mod, Bucket, - Empty, EmptyBucket, - Full, FullBucket, FullBucketImm, FullBucketMut, RawTable, SafeHash }; +use super::table::BucketState::{ + Empty, + Full, +}; const INITIAL_LOG2_CAP: uint = 5; pub const INITIAL_CAPACITY: uint = 1 << INITIAL_LOG2_CAP; // 2^5 @@ -379,7 +381,7 @@ fn robin_hood<'a, K: 'a, V: 'a>(mut bucket: FullBucketMut<'a, K, V>, assert!(probe.index() != idx_end); let full_bucket = match probe.peek() { - table::Empty(bucket) => { + Empty(bucket) => { // Found a hole! let b = bucket.put(old_hash, old_key, old_val); // Now that it's stolen, just read the value's pointer @@ -390,7 +392,7 @@ fn robin_hood<'a, K: 'a, V: 'a>(mut bucket: FullBucketMut<'a, K, V>, .into_mut_refs() .1; }, - table::Full(bucket) => bucket + Full(bucket) => bucket }; let probe_ib = full_bucket.index() - full_bucket.distance(); @@ -1470,7 +1472,8 @@ mod test_map { use prelude::*; use super::HashMap; - use super::{Occupied, Vacant}; + use super::Entry::{Occupied, Vacant}; + use cmp::Equiv; use hash; use iter::{range_inclusive, range_step_inclusive}; use cell::RefCell; diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index 115edcabca1..ce7dbd8ea5e 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -10,7 +10,7 @@ // // ignore-lexer-test FIXME #15883 -pub use self::BucketState::*; +use self::BucketState::*; use clone::Clone; use cmp; diff --git a/src/libstd/dynamic_lib.rs b/src/libstd/dynamic_lib.rs index e520c70824e..4d8c7d67b8c 100644 --- a/src/libstd/dynamic_lib.rs +++ b/src/libstd/dynamic_lib.rs @@ -200,7 +200,7 @@ mod test { target_os = "freebsd", target_os = "dragonfly"))] pub mod dl { - pub use self::Rtld::*; + use self::Rtld::*; use prelude::*; use c_str::CString; diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index d307e1f7415..951627b26ca 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -21,6 +21,9 @@ use intrinsics; use libc::c_int; use num::{Float, FloatMath}; use num::strconv; +use num::strconv::ExponentFormat::{ExpNone, ExpDec}; +use num::strconv::SignificantDigits::{DigAll, DigMax, DigExact}; +use num::strconv::SignFormat::SignNeg; pub use core::f32::{RADIX, MANTISSA_DIGITS, DIGITS, EPSILON, MIN_VALUE}; pub use core::f32::{MIN_POS_VALUE, MAX_VALUE, MIN_EXP, MAX_EXP, MIN_10_EXP}; @@ -252,7 +255,7 @@ impl FloatMath for f32 { #[experimental = "may be removed or relocated"] pub fn to_string(num: f32) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false); + num, 10u, true, SignNeg, DigAll, ExpNone, false); r } @@ -265,7 +268,7 @@ pub fn to_string(num: f32) -> String { #[experimental = "may be removed or relocated"] pub fn to_str_hex(num: f32) -> String { let (r, _) = strconv::float_to_str_common( - num, 16u, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false); + num, 16u, true, SignNeg, DigAll, ExpNone, false); r } @@ -279,8 +282,7 @@ pub fn to_str_hex(num: f32) -> String { #[inline] #[experimental = "may be removed or relocated"] pub fn to_str_radix_special(num: f32, rdx: uint) -> (String, bool) { - strconv::float_to_str_common(num, rdx, true, - strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false) + strconv::float_to_str_common(num, rdx, true, SignNeg, DigAll, ExpNone, false) } /// Converts a float to a string with exactly the number of @@ -294,7 +296,7 @@ pub fn to_str_radix_special(num: f32, rdx: uint) -> (String, bool) { #[experimental = "may be removed or relocated"] pub fn to_str_exact(num: f32, dig: uint) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, strconv::SignNeg, strconv::DigExact(dig), strconv::ExpNone, false); + num, 10u, true, SignNeg, DigExact(dig), ExpNone, false); r } @@ -309,7 +311,7 @@ pub fn to_str_exact(num: f32, dig: uint) -> String { #[experimental = "may be removed or relocated"] pub fn to_str_digits(num: f32, dig: uint) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, strconv::SignNeg, strconv::DigMax(dig), strconv::ExpNone, false); + num, 10u, true, SignNeg, DigMax(dig), ExpNone, false); r } @@ -325,7 +327,7 @@ pub fn to_str_digits(num: f32, dig: uint) -> String { #[experimental = "may be removed or relocated"] pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, strconv::SignNeg, strconv::DigExact(dig), strconv::ExpDec, upper); + num, 10u, true, SignNeg, DigExact(dig), ExpDec, upper); r } @@ -341,7 +343,7 @@ pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> String { #[experimental = "may be removed or relocated"] pub fn to_str_exp_digits(num: f32, dig: uint, upper: bool) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, strconv::SignNeg, strconv::DigMax(dig), strconv::ExpDec, upper); + num, 10u, true, SignNeg, DigMax(dig), ExpDec, upper); r } diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs index dfe20d59c82..7cc94b9ebbb 100644 --- a/src/libstd/num/f64.rs +++ b/src/libstd/num/f64.rs @@ -20,6 +20,9 @@ use intrinsics; use libc::c_int; use num::{Float, FloatMath}; use num::strconv; +use num::strconv::ExponentFormat::{ExpNone, ExpDec}; +use num::strconv::SignificantDigits::{DigAll, DigMax, DigExact}; +use num::strconv::SignFormat::SignNeg; pub use core::f64::{RADIX, MANTISSA_DIGITS, DIGITS, EPSILON, MIN_VALUE}; pub use core::f64::{MIN_POS_VALUE, MAX_VALUE, MIN_EXP, MAX_EXP, MIN_10_EXP}; @@ -260,7 +263,7 @@ impl FloatMath for f64 { #[experimental = "may be removed or relocated"] pub fn to_string(num: f64) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false); + num, 10u, true, SignNeg, DigAll, ExpNone, false); r } @@ -273,7 +276,7 @@ pub fn to_string(num: f64) -> String { #[experimental = "may be removed or relocated"] pub fn to_str_hex(num: f64) -> String { let (r, _) = strconv::float_to_str_common( - num, 16u, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false); + num, 16u, true, SignNeg, DigAll, ExpNone, false); r } @@ -287,8 +290,7 @@ pub fn to_str_hex(num: f64) -> String { #[inline] #[experimental = "may be removed or relocated"] pub fn to_str_radix_special(num: f64, rdx: uint) -> (String, bool) { - strconv::float_to_str_common(num, rdx, true, - strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false) + strconv::float_to_str_common(num, rdx, true, SignNeg, DigAll, ExpNone, false) } /// Converts a float to a string with exactly the number of @@ -302,7 +304,7 @@ pub fn to_str_radix_special(num: f64, rdx: uint) -> (String, bool) { #[experimental = "may be removed or relocated"] pub fn to_str_exact(num: f64, dig: uint) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, strconv::SignNeg, strconv::DigExact(dig), strconv::ExpNone, false); + num, 10u, true, SignNeg, DigExact(dig), ExpNone, false); r } @@ -317,7 +319,7 @@ pub fn to_str_exact(num: f64, dig: uint) -> String { #[experimental = "may be removed or relocated"] pub fn to_str_digits(num: f64, dig: uint) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, strconv::SignNeg, strconv::DigMax(dig), strconv::ExpNone, false); + num, 10u, true, SignNeg, DigMax(dig), ExpNone, false); r } @@ -333,7 +335,7 @@ pub fn to_str_digits(num: f64, dig: uint) -> String { #[experimental = "may be removed or relocated"] pub fn to_str_exp_exact(num: f64, dig: uint, upper: bool) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, strconv::SignNeg, strconv::DigExact(dig), strconv::ExpDec, upper); + num, 10u, true, SignNeg, DigExact(dig), ExpDec, upper); r } @@ -349,7 +351,7 @@ pub fn to_str_exp_exact(num: f64, dig: uint, upper: bool) -> String { #[experimental = "may be removed or relocated"] pub fn to_str_exp_digits(num: f64, dig: uint, upper: bool) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, strconv::SignNeg, strconv::DigMax(dig), strconv::ExpDec, upper); + num, 10u, true, SignNeg, DigMax(dig), ExpDec, upper); r } diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs index 016c4bd532a..b3e4dd52f89 100644 --- a/src/libstd/num/strconv.rs +++ b/src/libstd/num/strconv.rs @@ -12,9 +12,9 @@ #![allow(missing_docs)] -pub use self::ExponentFormat::*; -pub use self::SignificantDigits::*; -pub use self::SignFormat::*; +use self::ExponentFormat::*; +use self::SignificantDigits::*; +use self::SignFormat::*; use char::{mod, Char}; use num::{mod, Int, Float, FPNaN, FPInfinite, ToPrimitive}; diff --git a/src/libstd/os.rs b/src/libstd/os.rs index 20a72f45fbf..258e8964a9f 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -28,9 +28,9 @@ #![allow(non_snake_case)] #![allow(unused_imports)] -pub use self::MemoryMapKind::*; -pub use self::MapOption::*; -pub use self::MapError::*; +use self::MemoryMapKind::*; +use self::MapOption::*; +use self::MapError::*; use clone::Clone; use error::{FromError, Error}; @@ -1617,8 +1617,8 @@ mod tests { use result::Result::{Ok, Err}; let chunk = match os::MemoryMap::new(16, &[ - os::MapReadable, - os::MapWritable + os::MapOption::MapReadable, + os::MapOption::MapWritable ]) { Ok(chunk) => chunk, Err(msg) => panic!("{}", msg) @@ -1660,10 +1660,10 @@ mod tests { file.write_u8(0); let chunk = MemoryMap::new(size / 2, &[ - MapReadable, - MapWritable, - MapFd(get_fd(&file)), - MapOffset(size / 2) + MapOption::MapReadable, + MapOption::MapWritable, + MapOption::MapFd(get_fd(&file)), + MapOption::MapOffset(size / 2) ]).unwrap(); assert!(chunk.len > 0); diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index b498b3e8ad0..c2c17103554 100644 --- a/src/libstd/path/windows.rs +++ b/src/libstd/path/windows.rs @@ -12,7 +12,7 @@ //! Windows file path handling -pub use self::PathPrefix::*; +use self::PathPrefix::*; use ascii::AsciiCast; use c_str::{CString, ToCStr}; @@ -1117,6 +1117,7 @@ fn prefix_len(p: Option<PathPrefix>) -> uint { mod tests { use prelude::*; use super::*; + use super::PathPrefix::*; use super::parse_prefix; macro_rules! t { diff --git a/src/libstd/sys/common/net.rs b/src/libstd/sys/common/net.rs index 73da200e162..382f6875b28 100644 --- a/src/libstd/sys/common/net.rs +++ b/src/libstd/sys/common/net.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub use self::SocketStatus::*; -pub use self::InAddr::*; +use self::SocketStatus::*; +use self::InAddr::*; use alloc::arc::Arc; use libc::{mod, c_char, c_int}; diff --git a/src/libstd/sys/unix/pipe.rs b/src/libstd/sys/unix/pipe.rs index 26fd410a7a9..348b7cfad33 100644 --- a/src/libstd/sys/unix/pipe.rs +++ b/src/libstd/sys/unix/pipe.rs @@ -19,6 +19,7 @@ use prelude::*; use sys::{mod, timer, retry, c, set_nonblocking, wouldblock}; use sys::fs::{fd_t, FileDesc}; use sys_common::net::*; +use sys_common::net::SocketStatus::*; use sys_common::{eof, mkerr_libc}; fn unix_socket(ty: libc::c_int) -> IoResult<fd_t> { diff --git a/src/libstd/sys/unix/tcp.rs b/src/libstd/sys/unix/tcp.rs index dacd754582b..5c99ad1e0ce 100644 --- a/src/libstd/sys/unix/tcp.rs +++ b/src/libstd/sys/unix/tcp.rs @@ -21,6 +21,7 @@ use sys::{set_nonblocking, wouldblock}; use sys; use sys_common; use sys_common::net; +use sys_common::net::SocketStatus::Readable; pub use sys_common::net::TcpStream; @@ -124,7 +125,7 @@ impl TcpAcceptor { fd => return Ok(TcpStream::new(fd as sock_t)), } try!(net::await(&[self.fd(), self.inner.reader.fd()], - deadline, net::Readable)); + deadline, Readable)); } Err(sys_common::eof()) diff --git a/src/libstd/sys/unix/timer.rs b/src/libstd/sys/unix/timer.rs index 79a6a871f8d..fe393b81e3d 100644 --- a/src/libstd/sys/unix/timer.rs +++ b/src/libstd/sys/unix/timer.rs @@ -46,7 +46,7 @@ //! //! Note that all time units in this file are in *milliseconds*. -pub use self::Req::*; +use self::Req::*; use libc; use mem; diff --git a/src/libstd/sys/windows/timer.rs b/src/libstd/sys/windows/timer.rs index e2f9e2a9201..7e4dd768aa9 100644 --- a/src/libstd/sys/windows/timer.rs +++ b/src/libstd/sys/windows/timer.rs @@ -20,7 +20,7 @@ //! Other than that, the implementation is pretty straightforward in terms of //! the other two implementations of timers with nothing *that* new showing up. -pub use self::Req::*; +use self::Req::*; use libc; use ptr; |
