Skip to content

Commit be57d74

Browse files
committed
Removing unused imports
1 parent cc83049 commit be57d74

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+288
-306
lines changed

Diff for: doc/tutorial-tasks.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ spawns the child task.
188188

189189
~~~~
190190
# use core::task::spawn;
191-
# use core::comm::{stream, Port, Chan};
191+
# use core::comm::stream;
192192
# fn some_expensive_computation() -> int { 42 }
193193
# let (port, chan) = stream();
194194
do spawn || {
@@ -208,7 +208,7 @@ computation, then waits for the child's result to arrive on the
208208
port:
209209

210210
~~~~
211-
# use core::comm::{stream, Port, Chan};
211+
# use core::comm::{stream};
212212
# fn some_other_expensive_computation() {}
213213
# let (port, chan) = stream::<int>();
214214
# chan.send(0);
@@ -277,7 +277,7 @@ might look like the example below.
277277

278278
~~~
279279
# use core::task::spawn;
280-
# use core::comm::{stream, Port, Chan};
280+
# use core::comm::stream;
281281
282282
// Create a vector of ports, one for each child task
283283
let ports = do vec::from_fn(3) |init_val| {

Diff for: src/compiletest/procsrv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use core::prelude::*;
1212

1313
use core::io::{ReaderUtil, WriterUtil};
1414
use core::io;
15-
use core::libc::{c_int, pid_t};
15+
use core::libc::c_int;
1616
use core::os;
1717
use core::run::spawn_process;
1818
use core::run;

Diff for: src/libcore/cleanup.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
#[doc(hidden)];
1212

1313
use libc::{c_char, c_void, intptr_t, uintptr_t};
14-
use ptr::{mut_null, null, to_unsafe_ptr};
14+
use ptr::mut_null;
1515
use repr::BoxRepr;
1616
use sys::TypeDesc;
1717
use cast::transmute;
1818

19+
#[cfg(notest)] use ptr::to_unsafe_ptr;
20+
1921
/**
2022
* Runtime structures
2123
*

Diff for: src/libcore/comm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ pub fn try_send_one<T: Owned>(chan: ChanOne<T>, data: T)
429429
430430
#[cfg(test)]
431431
pub mod test {
432-
use either::{Either, Left, Right};
432+
use either::Right;
433433
use super::{Chan, Port, oneshot, recv_one, stream};
434434
435435
#[test]

Diff for: src/libcore/gc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ with destructors.
3838
*/
3939

4040
use cast;
41-
use container::{Container, Mutable, Map, Set};
41+
use container::{Map, Set};
4242
use io;
4343
use libc::{size_t, uintptr_t};
4444
use option::{None, Option, Some};

Diff for: src/libcore/hash.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121

2222
use io;
23-
use io::{Writer, WriterUtil};
23+
use io::Writer;
2424
use to_bytes::IterBytes;
2525
use uint;
2626
use vec;

Diff for: src/libcore/hashmap.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ pub mod linear {
667667

668668
#[test]
669669
mod test_map {
670-
use container::{Container, Mutable, Map, Set};
670+
use container::{Container, Map, Set};
671671
use option::{None, Some};
672672
use hashmap::linear::LinearMap;
673673
use hashmap::linear;
@@ -845,7 +845,7 @@ pub mod linear {
845845
#[test]
846846
mod test_set {
847847
use hashmap::linear;
848-
use container::{Container, Mutable, Map, Set};
848+
use container::{Container, Map, Set};
849849
use vec;
850850

851851
#[test]

Diff for: src/libcore/io.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use result::Result;
1818

1919
use int;
2020
use libc;
21-
use libc::{c_int, c_long, c_uint, c_void, size_t, ssize_t};
21+
use libc::{c_int, c_long, c_void, size_t, ssize_t};
2222
use libc::consts::os::posix88::*;
2323
use os;
2424
use cast;

Diff for: src/libcore/num/float.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ use f64;
2424
use num::NumCast;
2525
use num::strconv;
2626
use num;
27-
use option::{None, Option, Some};
27+
use option::Option;
2828
use to_str;
2929
use from_str;
3030

3131
#[cfg(notest)] use cmp::{Eq, Ord};
3232
#[cfg(notest)] use ops;
33+
#[cfg(test)] use option::{Some, None};
3334

3435
pub use f64::{add, sub, mul, div, rem, lt, le, eq, ne, ge, gt};
3536
pub use f64::logarithm;

Diff for: src/libcore/num/num.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
// except according to those terms.
1010

1111
//! An interface for numeric types
12-
use cmp::{Ord, Eq};
13-
use ops::{Add, Div, Modulo, Mul, Neg, Sub};
14-
use option::{None, Option, Some};
12+
use cmp::Ord;
13+
use ops::{Div, Mul, Neg};
14+
use option::Option;
1515
use kinds::Copy;
1616

1717
pub mod strconv;

Diff for: src/libcore/num/uint-template.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use from_str::FromStr;
1616
use num::{ToStrRadix, FromStrRadix};
1717
use num::strconv;
1818
use num;
19-
use option::{None, Option, Some};
19+
use option::Option;
2020
use prelude::*;
2121

2222
#[cfg(notest)] use cmp::{Eq, Ord};

Diff for: src/libcore/os.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
use cast;
3030
use io;
3131
use libc;
32-
use libc::{c_char, c_void, c_int, c_uint, size_t, ssize_t};
32+
use libc::{c_char, c_void, c_int, size_t};
3333
use libc::{mode_t, pid_t, FILE};
3434
use option;
3535
use option::{Some, None};
@@ -397,7 +397,7 @@ pub fn pipe() -> Pipe {
397397
// first, as in rust_run_program.
398398
let mut fds = Pipe {in: 0 as c_int,
399399
out: 0 as c_int };
400-
let res = libc::pipe(&mut fds.in, 1024 as c_uint,
400+
let res = libc::pipe(&mut fds.in, 1024 as ::libc::c_uint,
401401
(libc::O_BINARY | libc::O_NOINHERIT) as c_int);
402402
fail_unless!((res == 0 as c_int));
403403
fail_unless!((fds.in != -1 as c_int && fds.in != 0 as c_int));
@@ -431,7 +431,7 @@ pub fn self_exe_path() -> Option<Path> {
431431
KERN_PROC as c_int,
432432
KERN_PROC_PATHNAME as c_int, -1 as c_int];
433433
let mut sz = sz;
434-
sysctl(vec::raw::to_ptr(mib), vec::len(mib) as c_uint,
434+
sysctl(vec::raw::to_ptr(mib), vec::len(mib) as ::libc::c_uint,
435435
buf as *mut c_void, &mut sz, ptr::null(),
436436
0u as size_t) == (0 as c_int)
437437
}
@@ -670,7 +670,7 @@ pub fn list_dir(p: &Path) -> ~[~str] {
670670
#[cfg(target_os = "freebsd")]
671671
#[cfg(target_os = "macos")]
672672
unsafe fn get_list(p: &Path) -> ~[~str] {
673-
use libc::{DIR, dirent_t};
673+
use libc::{dirent_t};
674674
use libc::{opendir, readdir, closedir};
675675
extern mod rustrt {
676676
unsafe fn rust_list_dir_val(ptr: *dirent_t)
@@ -1257,7 +1257,7 @@ pub mod consts {
12571257
mod tests {
12581258
use libc::{c_int, c_void, size_t};
12591259
use libc;
1260-
use option::{None, Option, Some};
1260+
use option::Some;
12611261
use option;
12621262
use os::{as_c_charp, env, getcwd, getenv, make_absolute, real_args};
12631263
use os::{remove_file, setenv};

Diff for: src/libcore/pipes.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -958,9 +958,9 @@ pub mod rt {
958958
959959
#[cfg(test)]
960960
pub mod test {
961-
use either::{Either, Left, Right};
961+
use either::Right;
962962
use comm::{Chan, Port, oneshot, recv_one, stream, Select2,
963-
GenericPort, GenericChan, Peekable};
963+
GenericChan, Peekable};
964964
965965
#[test]
966966
pub fn test_select2() {

Diff for: src/libcore/ptr.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use cast;
1414
use libc;
1515
use libc::{c_void, size_t};
16-
use unstable::intrinsics::{memmove32,memmove64};
1716
use sys;
1817

1918
#[cfg(test)] use vec;
@@ -116,12 +115,14 @@ pub fn is_not_null<T>(ptr: *const T) -> bool { !is_null(ptr) }
116115
#[inline(always)]
117116
#[cfg(target_word_size = "32")]
118117
pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
118+
use unstable::intrinsics::memmove32;
119119
let n = count * sys::size_of::<T>();
120120
memmove32(dst as *mut u8, src as *u8, n as u32);
121121
}
122122
#[inline(always)]
123123
#[cfg(target_word_size = "64")]
124124
pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
125+
use unstable::intrinsics::memmove64;
125126
let n = count * sys::size_of::<T>();
126127
memmove64(dst as *mut u8, src as *u8, n as u64);
127128
}

Diff for: src/libcore/rand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ pub fn random() -> uint {
574574

575575
#[cfg(test)]
576576
pub mod tests {
577-
use option::{None, Option, Some};
577+
use option::{Option, Some};
578578
use rand;
579579

580580
#[test]

Diff for: src/libcore/reflect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Runtime type reflection
1414
1515
*/
1616

17-
use intrinsic::{TyDesc, get_tydesc, visit_tydesc, TyVisitor};
17+
use intrinsic::{TyDesc, TyVisitor};
1818
use libc::c_void;
1919
use sys;
2020
use vec;

Diff for: src/libcore/repr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use libc::c_void;
2323
use managed;
2424
use ptr;
2525
use reflect;
26-
use reflect::{MovePtr, MovePtrAdaptor, align};
26+
use reflect::{MovePtr, align};
2727
use sys;
2828
use to_str::ToStr;
2929
use vec::UnboxedVecRepr;

Diff for: src/libcore/rt/io/file.rs

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
// except according to those terms.
1010

1111
use prelude::*;
12-
use super::super::sched::*;
13-
use super::super::rtio::*;
1412
use super::Stream;
1513

1614
pub struct FileStream;

Diff for: src/libcore/rt/thread_local_storage.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use libc::{c_void};
11+
use libc::c_void;
1212
#[cfg(unix)]
13-
use libc::{c_uint, c_ulong, c_int};
13+
use libc::c_int;
1414
#[cfg(unix)]
1515
use ptr::null;
1616
#[cfg(windows)]
@@ -36,13 +36,13 @@ pub unsafe fn get(key: Key) -> *mut c_void {
3636

3737
#[cfg(target_os="macos")]
3838
#[allow(non_camel_case_types)] // foreign type
39-
type pthread_key_t = c_ulong;
39+
type pthread_key_t = ::libc::c_ulong;
4040

4141
#[cfg(target_os="linux")]
4242
#[cfg(target_os="freebsd")]
4343
#[cfg(target_os="android")]
4444
#[allow(non_camel_case_types)] // foreign type
45-
type pthread_key_t = c_uint;
45+
type pthread_key_t = ::libc::c_uint;
4646

4747
#[cfg(unix)]
4848
extern {

Diff for: src/libcore/rt/uv/mod.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,13 @@ use str::raw::from_c_str;
3939
use to_str::ToStr;
4040
use vec;
4141
use ptr;
42-
use libc::{c_void, c_int, size_t, malloc, free, ssize_t};
43-
use cast::{transmute, transmute_mut_region};
42+
use libc::{c_void, c_int, size_t, malloc, free};
43+
use cast::transmute;
4444
use ptr::null;
4545
use super::uvll;
46-
use super::uvll::*;
4746
use unstable::finally::Finally;
4847

4948
#[cfg(test)] use unstable::run_in_bare_thread;
50-
#[cfg(test)] use super::thread::Thread;
51-
#[cfg(test)] use cell::Cell;
5249

5350
pub use self::file::{FsRequest, FsCallback};
5451
pub use self::net::{StreamWatcher, TcpWatcher};

Diff for: src/libcore/rt/uv/net.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use prelude::*;
1212
use libc::{size_t, ssize_t, c_int, c_void};
13-
use cast::{transmute, transmute_mut_region};
13+
use cast::transmute_mut_region;
1414
use super::super::uvll;
1515
use super::super::uvll::*;
1616
use super::{Loop, Watcher, Request, UvError, Buf, Callback, NativeHandle, NullCallback,

Diff for: src/libcore/run.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ pub fn waitpid(pid: pid_t) -> int {
458458

459459
#[cfg(test)]
460460
mod tests {
461-
use option::{None, Some};
461+
use option::None;
462462
use os;
463463
use run::{readclose, writeclose};
464464
use run;

Diff for: src/libcore/str.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use at_vec;
2121
use cast;
2222
use char;
2323
use clone::Clone;
24-
use cmp::{Equiv, TotalEq, TotalOrd, Ordering, Less, Equal, Greater};
24+
use cmp::{TotalOrd, Ordering, Less, Equal, Greater};
2525
use libc;
2626
use option::{None, Option, Some};
2727
use ptr;
@@ -31,7 +31,7 @@ use uint;
3131
use vec;
3232
use to_str::ToStr;
3333

34-
#[cfg(notest)] use cmp::{Eq, Ord};
34+
#[cfg(notest)] use cmp::{Eq, Ord, Equiv, TotalEq};
3535

3636
/*
3737
Section: Creating a string

Diff for: src/libcore/task/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@
3636
use cell::Cell;
3737
use cmp::Eq;
3838
use result::Result;
39-
use comm::{stream, Chan, GenericChan, GenericPort, Port, SharedChan};
39+
use comm::{stream, Chan, GenericChan, GenericPort, Port};
4040
use prelude::*;
4141
use result;
4242
use task::rt::{task_id, sched_id, rust_task};
4343
use util;
4444
use util::replace;
4545

46+
#[cfg(test)] use comm::SharedChan;
47+
4648
mod local_data_priv;
4749
pub mod local_data;
4850
pub mod rt;

Diff for: src/libcore/task/spawn.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
use cast;
7676
use cell::Cell;
7777
use container::Map;
78-
use comm::{Chan, GenericChan, GenericPort, Port, stream};
78+
use comm::{Chan, GenericChan};
7979
use prelude::*;
8080
use unstable;
8181
use ptr;
@@ -86,10 +86,12 @@ use task::rt;
8686
use task::{Failure, ManualThreads, PlatformThread, SchedOpts, SingleThreaded};
8787
use task::{Success, TaskOpts, TaskResult, ThreadPerCore, ThreadPerTask};
8888
use task::{ExistingScheduler, SchedulerHandle};
89-
use task::{default_task_opts, unkillable};
89+
use task::unkillable;
9090
use uint;
9191
use util;
9292

93+
#[cfg(test)] use task::default_task_opts;
94+
9395
macro_rules! move_it (
9496
{ $x:expr } => ( unsafe { let y = *ptr::addr_of(&($x)); y } )
9597
)

Diff for: src/libcore/unstable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use libc;
1515
use comm::{GenericChan, GenericPort};
1616
use prelude::*;
1717
use task;
18-
use task::{TaskBuilder, atomically};
18+
use task::atomically;
1919

2020
#[path = "unstable/at_exit.rs"]
2121
pub mod at_exit;

Diff for: src/libcore/unstable/at_exit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use cast;
12-
use libc::{c_void, size_t};
12+
use libc::size_t;
1313
use rand::RngUtil;
1414
use rand;
1515
use sys;

0 commit comments

Comments
 (0)