Skip to content

Fixing unused imports when importing a list of items #5570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 29, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/tutorial-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ spawns the child task.

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

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

~~~
# use core::task::spawn;
# use core::comm::{stream, Port, Chan};
# use core::comm::stream;

// Create a vector of ports, one for each child task
let ports = do vec::from_fn(3) |init_val| {
Expand Down
2 changes: 1 addition & 1 deletion src/compiletest/procsrv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use core::prelude::*;

use core::io::{ReaderUtil, WriterUtil};
use core::io;
use core::libc::{c_int, pid_t};
use core::libc::c_int;
use core::os;
use core::run::spawn_process;
use core::run;
Expand Down
4 changes: 3 additions & 1 deletion src/libcore/cleanup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
#[doc(hidden)];

use libc::{c_char, c_void, intptr_t, uintptr_t};
use ptr::{mut_null, null, to_unsafe_ptr};
use ptr::mut_null;
use repr::BoxRepr;
use sys::TypeDesc;
use cast::transmute;

#[cfg(notest)] use ptr::to_unsafe_ptr;

/**
* Runtime structures
*
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/comm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ pub fn try_send_one<T: Owned>(chan: ChanOne<T>, data: T)

#[cfg(test)]
pub mod test {
use either::{Either, Left, Right};
use either::Right;
use super::{Chan, Port, oneshot, recv_one, stream};

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ with destructors.
*/

use cast;
use container::{Container, Mutable, Map, Set};
use container::{Map, Set};
use io;
use libc::{size_t, uintptr_t};
use option::{None, Option, Some};
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

use io;
use io::{Writer, WriterUtil};
use io::Writer;
use to_bytes::IterBytes;
use uint;
use vec;
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/hashmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ pub mod linear {

#[test]
mod test_map {
use container::{Container, Mutable, Map, Set};
use container::{Container, Map, Set};
use option::{None, Some};
use hashmap::linear::LinearMap;
use hashmap::linear;
Expand Down Expand Up @@ -845,7 +845,7 @@ pub mod linear {
#[test]
mod test_set {
use hashmap::linear;
use container::{Container, Mutable, Map, Set};
use container::{Container, Map, Set};
use vec;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use result::Result;

use int;
use libc;
use libc::{c_int, c_long, c_uint, c_void, size_t, ssize_t};
use libc::{c_int, c_long, c_void, size_t, ssize_t};
use libc::consts::os::posix88::*;
use os;
use cast;
Expand Down
3 changes: 2 additions & 1 deletion src/libcore/num/float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ use f64;
use num::NumCast;
use num::strconv;
use num;
use option::{None, Option, Some};
use option::Option;
use to_str;
use from_str;

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

pub use f64::{add, sub, mul, div, rem, lt, le, eq, ne, ge, gt};
pub use f64::logarithm;
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/num/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
// except according to those terms.

//! An interface for numeric types
use cmp::{Ord, Eq};
use ops::{Add, Div, Modulo, Mul, Neg, Sub};
use option::{None, Option, Some};
use cmp::Ord;
use ops::{Div, Mul, Neg};
use option::Option;
use kinds::Copy;

pub mod strconv;
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/num/uint-template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use from_str::FromStr;
use num::{ToStrRadix, FromStrRadix};
use num::strconv;
use num;
use option::{None, Option, Some};
use option::Option;
use prelude::*;

#[cfg(notest)] use cmp::{Eq, Ord};
Expand Down
10 changes: 5 additions & 5 deletions src/libcore/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
use cast;
use io;
use libc;
use libc::{c_char, c_void, c_int, c_uint, size_t, ssize_t};
use libc::{c_char, c_void, c_int, size_t};
use libc::{mode_t, pid_t, FILE};
use option;
use option::{Some, None};
Expand Down Expand Up @@ -397,7 +397,7 @@ pub fn pipe() -> Pipe {
// first, as in rust_run_program.
let mut fds = Pipe {in: 0 as c_int,
out: 0 as c_int };
let res = libc::pipe(&mut fds.in, 1024 as c_uint,
let res = libc::pipe(&mut fds.in, 1024 as ::libc::c_uint,
(libc::O_BINARY | libc::O_NOINHERIT) as c_int);
fail_unless!((res == 0 as c_int));
fail_unless!((fds.in != -1 as c_int && fds.in != 0 as c_int));
Expand Down Expand Up @@ -431,7 +431,7 @@ pub fn self_exe_path() -> Option<Path> {
KERN_PROC as c_int,
KERN_PROC_PATHNAME as c_int, -1 as c_int];
let mut sz = sz;
sysctl(vec::raw::to_ptr(mib), vec::len(mib) as c_uint,
sysctl(vec::raw::to_ptr(mib), vec::len(mib) as ::libc::c_uint,
buf as *mut c_void, &mut sz, ptr::null(),
0u as size_t) == (0 as c_int)
}
Expand Down Expand Up @@ -670,7 +670,7 @@ pub fn list_dir(p: &Path) -> ~[~str] {
#[cfg(target_os = "freebsd")]
#[cfg(target_os = "macos")]
unsafe fn get_list(p: &Path) -> ~[~str] {
use libc::{DIR, dirent_t};
use libc::{dirent_t};
use libc::{opendir, readdir, closedir};
extern mod rustrt {
unsafe fn rust_list_dir_val(ptr: *dirent_t)
Expand Down Expand Up @@ -1257,7 +1257,7 @@ pub mod consts {
mod tests {
use libc::{c_int, c_void, size_t};
use libc;
use option::{None, Option, Some};
use option::Some;
use option;
use os::{as_c_charp, env, getcwd, getenv, make_absolute, real_args};
use os::{remove_file, setenv};
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/pipes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -958,9 +958,9 @@ pub mod rt {

#[cfg(test)]
pub mod test {
use either::{Either, Left, Right};
use either::Right;
use comm::{Chan, Port, oneshot, recv_one, stream, Select2,
GenericPort, GenericChan, Peekable};
GenericChan, Peekable};

#[test]
pub fn test_select2() {
Expand Down
3 changes: 2 additions & 1 deletion src/libcore/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use cast;
use libc;
use libc::{c_void, size_t};
use unstable::intrinsics::{memmove32,memmove64};
use sys;

#[cfg(test)] use vec;
Expand Down Expand Up @@ -116,12 +115,14 @@ pub fn is_not_null<T>(ptr: *const T) -> bool { !is_null(ptr) }
#[inline(always)]
#[cfg(target_word_size = "32")]
pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
use unstable::intrinsics::memmove32;
let n = count * sys::size_of::<T>();
memmove32(dst as *mut u8, src as *u8, n as u32);
}
#[inline(always)]
#[cfg(target_word_size = "64")]
pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
use unstable::intrinsics::memmove64;
let n = count * sys::size_of::<T>();
memmove64(dst as *mut u8, src as *u8, n as u64);
}
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/rand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ pub fn random() -> uint {

#[cfg(test)]
pub mod tests {
use option::{None, Option, Some};
use option::{Option, Some};
use rand;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/reflect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Runtime type reflection

*/

use intrinsic::{TyDesc, get_tydesc, visit_tydesc, TyVisitor};
use intrinsic::{TyDesc, TyVisitor};
use libc::c_void;
use sys;
use vec;
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use libc::c_void;
use managed;
use ptr;
use reflect;
use reflect::{MovePtr, MovePtrAdaptor, align};
use reflect::{MovePtr, align};
use sys;
use to_str::ToStr;
use vec::UnboxedVecRepr;
Expand Down
2 changes: 0 additions & 2 deletions src/libcore/rt/io/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
// except according to those terms.

use prelude::*;
use super::super::sched::*;
use super::super::rtio::*;
use super::Stream;

pub struct FileStream;
Expand Down
8 changes: 4 additions & 4 deletions src/libcore/rt/thread_local_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

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

#[cfg(target_os="macos")]
#[allow(non_camel_case_types)] // foreign type
type pthread_key_t = c_ulong;
type pthread_key_t = ::libc::c_ulong;

#[cfg(target_os="linux")]
#[cfg(target_os="freebsd")]
#[cfg(target_os="android")]
#[allow(non_camel_case_types)] // foreign type
type pthread_key_t = c_uint;
type pthread_key_t = ::libc::c_uint;

#[cfg(unix)]
extern {
Expand Down
7 changes: 2 additions & 5 deletions src/libcore/rt/uv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,13 @@ use str::raw::from_c_str;
use to_str::ToStr;
use vec;
use ptr;
use libc::{c_void, c_int, size_t, malloc, free, ssize_t};
use cast::{transmute, transmute_mut_region};
use libc::{c_void, c_int, size_t, malloc, free};
use cast::transmute;
use ptr::null;
use super::uvll;
use super::uvll::*;
use unstable::finally::Finally;

#[cfg(test)] use unstable::run_in_bare_thread;
#[cfg(test)] use super::thread::Thread;
#[cfg(test)] use cell::Cell;

pub use self::file::{FsRequest, FsCallback};
pub use self::net::{StreamWatcher, TcpWatcher};
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/rt/uv/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

use prelude::*;
use libc::{size_t, ssize_t, c_int, c_void};
use cast::{transmute, transmute_mut_region};
use cast::transmute_mut_region;
use super::super::uvll;
use super::super::uvll::*;
use super::{Loop, Watcher, Request, UvError, Buf, Callback, NativeHandle, NullCallback,
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ pub fn waitpid(pid: pid_t) -> int {

#[cfg(test)]
mod tests {
use option::{None, Some};
use option::None;
use os;
use run::{readclose, writeclose};
use run;
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use at_vec;
use cast;
use char;
use clone::Clone;
use cmp::{Equiv, TotalEq, TotalOrd, Ordering, Less, Equal, Greater};
use cmp::{TotalOrd, Ordering, Less, Equal, Greater};
use libc;
use option::{None, Option, Some};
use ptr;
Expand All @@ -31,7 +31,7 @@ use uint;
use vec;
use to_str::ToStr;

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

/*
Section: Creating a string
Expand Down
4 changes: 3 additions & 1 deletion src/libcore/task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@
use cell::Cell;
use cmp::Eq;
use result::Result;
use comm::{stream, Chan, GenericChan, GenericPort, Port, SharedChan};
use comm::{stream, Chan, GenericChan, GenericPort, Port};
use prelude::*;
use result;
use task::rt::{task_id, sched_id, rust_task};
use util;
use util::replace;

#[cfg(test)] use comm::SharedChan;

mod local_data_priv;
pub mod local_data;
pub mod rt;
Expand Down
6 changes: 4 additions & 2 deletions src/libcore/task/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
use cast;
use cell::Cell;
use container::Map;
use comm::{Chan, GenericChan, GenericPort, Port, stream};
use comm::{Chan, GenericChan};
use prelude::*;
use unstable;
use ptr;
Expand All @@ -86,10 +86,12 @@ use task::rt;
use task::{Failure, ManualThreads, PlatformThread, SchedOpts, SingleThreaded};
use task::{Success, TaskOpts, TaskResult, ThreadPerCore, ThreadPerTask};
use task::{ExistingScheduler, SchedulerHandle};
use task::{default_task_opts, unkillable};
use task::unkillable;
use uint;
use util;

#[cfg(test)] use task::default_task_opts;

macro_rules! move_it (
{ $x:expr } => ( unsafe { let y = *ptr::addr_of(&($x)); y } )
)
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use libc;
use comm::{GenericChan, GenericPort};
use prelude::*;
use task;
use task::{TaskBuilder, atomically};
use task::atomically;

#[path = "unstable/at_exit.rs"]
pub mod at_exit;
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/unstable/at_exit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

use cast;
use libc::{c_void, size_t};
use libc::size_t;
use rand::RngUtil;
use rand;
use sys;
Expand Down
Loading