Skip to content

Commit 69070ac

Browse files
committed
libstd: Remove unnecessary re-exports under std::std
1 parent 759517c commit 69070ac

File tree

4 files changed

+19
-22
lines changed

4 files changed

+19
-22
lines changed

src/libstd/io/fs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ mod test {
859859
})
860860

861861
iotest!(fn file_test_io_seek_shakedown() {
862-
use std::str; // 01234567890123
862+
use str; // 01234567890123
863863
let initial_msg = "qwer-asdf-zxcv";
864864
let chunk_one: &str = "qwer";
865865
let chunk_two: &str = "asdf";
@@ -947,7 +947,7 @@ mod test {
947947
})
948948

949949
iotest!(fn file_test_directoryinfo_readdir() {
950-
use std::str;
950+
use str;
951951
let tmpdir = tmpdir();
952952
let dir = &tmpdir.join("di_readdir");
953953
check!(mkdir(dir, io::UserRWX));

src/libstd/io/process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
use prelude::*;
1616

17-
use std::str;
17+
use str;
1818
use fmt;
1919
use io::IoResult;
2020
use io;

src/libstd/lib.rs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -266,24 +266,21 @@ pub mod rt;
266266
// can be resolved within libstd.
267267
#[doc(hidden)]
268268
mod std {
269+
// mods used for deriving
269270
pub use clone;
270271
pub use cmp;
271-
pub use comm;
272-
pub use fmt;
273272
pub use hash;
274-
pub use io;
275-
pub use kinds;
276-
pub use local_data;
277-
pub use option;
278-
pub use os;
279-
pub use rt;
280-
pub use str;
281-
pub use to_str;
282-
pub use ty;
283-
pub use unstable;
284-
pub use vec;
285273

274+
pub use comm; // used for select!()
275+
pub use fmt; // used for any formatting strings
276+
pub use io; // used for println!()
277+
pub use local_data; // used for local_data_key!()
278+
pub use option; // used for bitflags!()
279+
pub use rt; // used for fail!()
280+
pub use vec; // used for vec![]
281+
282+
// The test runner calls ::std::os::args() but really wants realstd
283+
#[cfg(test)] pub use os = realstd::os;
286284
// The test runner requires std::slice::Vector, so re-export std::slice just for it.
287285
#[cfg(test)] pub use slice;
288-
#[cfg(test)] pub use string;
289286
}

src/libstd/os.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ impl Drop for MemoryMap {
13281328

13291329
#[cfg(target_os = "linux")]
13301330
pub mod consts {
1331-
pub use std::os::arch_consts::ARCH;
1331+
pub use os::arch_consts::ARCH;
13321332

13331333
pub static FAMILY: &'static str = "unix";
13341334

@@ -1359,7 +1359,7 @@ pub mod consts {
13591359

13601360
#[cfg(target_os = "macos")]
13611361
pub mod consts {
1362-
pub use std::os::arch_consts::ARCH;
1362+
pub use os::arch_consts::ARCH;
13631363

13641364
pub static FAMILY: &'static str = "unix";
13651365

@@ -1390,7 +1390,7 @@ pub mod consts {
13901390

13911391
#[cfg(target_os = "freebsd")]
13921392
pub mod consts {
1393-
pub use std::os::arch_consts::ARCH;
1393+
pub use os::arch_consts::ARCH;
13941394

13951395
pub static FAMILY: &'static str = "unix";
13961396

@@ -1421,7 +1421,7 @@ pub mod consts {
14211421

14221422
#[cfg(target_os = "android")]
14231423
pub mod consts {
1424-
pub use std::os::arch_consts::ARCH;
1424+
pub use os::arch_consts::ARCH;
14251425

14261426
pub static FAMILY: &'static str = "unix";
14271427

@@ -1452,7 +1452,7 @@ pub mod consts {
14521452

14531453
#[cfg(target_os = "win32")]
14541454
pub mod consts {
1455-
pub use std::os::arch_consts::ARCH;
1455+
pub use os::arch_consts::ARCH;
14561456

14571457
pub static FAMILY: &'static str = "windows";
14581458

0 commit comments

Comments
 (0)