auto merge of #5179 : alexcrichton/rust/default-warn-unused-import, r=graydon

I've found that unused imports can often start cluttering a project after a long time, and it's very useful to keep them under control. I don't like how Go forces a compiler error by default and it can't be changed, but I certainly want to know about them so I think that a warn is a good default.

Now that the `unused_imports` lint option is a bit smarter, I think it's possible to change the default level to warn. This commit also removes all unused imports throughout the compiler and libraries (500+).

The only odd things that I ran into were that some `use` statements had to have `#[cfg(notest)]` or `#[cfg(test)]` based on where they were. The ones with `notest` were mostly in core for modules like `cmp` whereas `cfg(test)` was for tests that weren't part of a normal `mod test` module.
This commit is contained in:
bors
2013-03-05 00:57:46 -08:00
220 changed files with 161 additions and 731 deletions
-2
View File
@@ -10,8 +10,6 @@
use core::prelude::*;
use cmp;
#[deriving_eq]
pub enum mode {
mode_compile_fail,
-1
View File
@@ -32,7 +32,6 @@ pub mod errors;
use std::getopts;
use std::test;
use core::{result, either};
use core::result::{Ok, Err};
use common::config;
-2
View File
@@ -10,8 +10,6 @@
use core::prelude::*;
use common::config;
use core::io;
use core::io::ReaderUtil;
use core::str;
-3
View File
@@ -13,14 +13,11 @@
use core::io::{ReaderUtil, WriterUtil};
use core::io;
use core::libc::{c_int, pid_t};
use core::libc;
use core::os;
use core::pipes;
use core::run::spawn_process;
use core::run;
use core::str;
use core::task;
use core::vec;
#[cfg(target_os = "win32")]
fn target_env(lib_path: ~str, prog: ~str) -> ~[(~str,~str)] {
-2
View File
@@ -10,14 +10,12 @@
use core::prelude::*;
use common;
use common::mode_run_pass;
use common::mode_run_fail;
use common::mode_compile_fail;
use common::mode_pretty;
use common::config;
use errors;
use header;
use header::load_props;
use header::TestProps;
use procsrv;
-2
View File
@@ -10,12 +10,10 @@
use core::prelude::*;
use common;
use common::config;
use core::io;
use core::os::getenv;
use core::os;
pub fn make_new_path(path: ~str) -> ~str {
+2 -4
View File
@@ -11,10 +11,8 @@
//! Boolean logic
use bool;
use cmp;
use cmp::Eq;
use option::{None, Option, Some};
#[cfg(notest)] use cmp;
/// Negation / inverse
pub pure fn not(v: bool) -> bool { !v }
@@ -82,7 +80,7 @@ impl cmp::Eq for bool {
#[test]
pub fn test_bool_from_str() {
do all_values |v| {
assert Some(v) == from_str(bool::to_str(v))
assert Some(v) == from_str(to_str(v))
}
}
+4 -4
View File
@@ -10,14 +10,14 @@
//! Utilities for manipulating the char type
use char;
use cmp::Eq;
use option::{None, Option, Some};
use str;
use u32;
use uint;
use unicode;
#[cfg(notest)] use cmp::Eq;
/*
Lu Uppercase_Letter an uppercase letter
Ll Lowercase_Letter a lowercase letter
@@ -305,8 +305,8 @@ fn test_to_digit() {
#[test]
fn test_is_ascii() {
assert str::all(~"banana", char::is_ascii);
assert ! str::all(~"ประเทศไทย中华Việt Nam", char::is_ascii);
assert str::all(~"banana", is_ascii);
assert ! str::all(~"ประเทศไทย中华Việt Nam", is_ascii);
}
#[test]
-1
View File
@@ -20,7 +20,6 @@
*/
use cast;
use cast::reinterpret_cast;
use prelude::*;
use ptr::null;
use vec;
-1
View File
@@ -11,7 +11,6 @@
//! A type that represents one of two alternatives
use cmp::Eq;
use cmp;
use kinds::Copy;
use result::Result;
use result;
+2 -1
View File
@@ -17,9 +17,10 @@
use libc;
use libc::{c_void, size_t, c_int};
use ptr;
use rand;
use vec;
#[cfg(test)] use rand;
extern mod rustrt {
unsafe fn tdefl_compress_mem_to_heap(psrc_buf: *const c_void,
src_buf_len: size_t,
-1
View File
@@ -21,7 +21,6 @@
use io;
use io::{Writer, WriterUtil};
use os;
use to_bytes::IterBytes;
use uint;
use vec;
-3
View File
@@ -19,11 +19,8 @@ pub mod linear {
use iter::BaseIter;
use hash::Hash;
use iter;
use kinds::Copy;
use option::{None, Option, Some};
use option;
use rand;
use to_bytes::IterBytes;
use uint;
use vec;
+3 -4
View File
@@ -16,14 +16,11 @@
use result::Result;
use cmp::Eq;
use dvec::DVec;
use int;
use libc;
use libc::{c_int, c_long, c_uint, c_void, size_t, ssize_t};
use libc::consts::os::posix88::*;
use libc::consts::os::extra::*;
use option;
use os;
use prelude::*;
use ptr;
@@ -719,7 +716,9 @@ pub fn mk_file_writer(path: &Path, flags: &[FileFlag])
-> Result<Writer, ~str> {
#[cfg(windows)]
fn wb() -> c_int { (O_WRONLY | O_BINARY) as c_int }
fn wb() -> c_int {
(O_WRONLY | libc::consts::os::extra::O_BINARY) as c_int
}
#[cfg(unix)]
fn wb() -> c_int { O_WRONLY as c_int }
-2
View File
@@ -9,8 +9,6 @@
// except according to those terms.
mod inst {
use cast;
use dlist;
use dlist::DList;
use managed;
use option::{Option, Some};
-1
View File
@@ -1007,7 +1007,6 @@ pub mod funcs {
pub mod c95 {
use libc::types::common::c95::{FILE, c_void, fpos_t};
use libc::types::common::posix88::dirent_t;
use libc::types::os::arch::c95::{c_char, c_double, c_int, c_long};
use libc::types::os::arch::c95::{c_uint, c_ulong, c_void, size_t};
+5 -4
View File
@@ -10,11 +10,7 @@
//! Logging
use cast::transmute;
use io;
use libc;
use repr;
use vec;
#[nolink]
extern mod rustrt {
@@ -48,6 +44,11 @@ pub fn console_off() {
#[cfg(notest)]
#[lang="log_type"]
pub fn log_type<T>(level: u32, object: &T) {
use cast::transmute;
use io;
use repr;
use vec;
let bytes = do io::with_bytes_writer |writer| {
repr::write_repr(writer, object);
};
+1 -4
View File
@@ -10,12 +10,9 @@
//! Operations on managed box types
use cast::transmute;
use cmp::{Eq, Ord};
use managed::raw::BoxRepr;
use prelude::*;
use ptr;
#[cfg(notest)] use cmp::{Eq, Ord};
pub mod raw {
+1
View File
@@ -14,6 +14,7 @@
*/
#[cfg(notest)]
use cmp::{Eq, Ord};
#[cfg(notest)]
+3 -2
View File
@@ -11,17 +11,18 @@
//! Operations and constants for `f32`
use cmath;
use cmp;
use libc::{c_float, c_int};
use num::NumCast;
use num::strconv;
use num;
use ops;
use option::Option;
use unstable::intrinsics::floorf32;
use from_str;
use to_str;
#[cfg(notest)] use cmp;
#[cfg(notest)] use ops;
pub use cmath::c_float_targ_consts::*;
macro_rules! delegate(
+3 -3
View File
@@ -11,18 +11,18 @@
//! Operations and constants for `f64`
use cmath;
use cmp;
use libc::{c_double, c_int};
use libc;
use num::NumCast;
use num::strconv;
use num;
use ops;
use option::Option;
use unstable::intrinsics::floorf64;
use to_str;
use from_str;
#[cfg(notest)] use cmp;
#[cfg(notest)] use ops;
pub use cmath::c_double_targ_consts::*;
pub use cmp::{min, max};
+3 -7
View File
@@ -20,21 +20,17 @@
// PORT this must match in width according to architecture
use m_float = f64;
use cmp::{Eq, Ord};
use cmp;
use f64;
use num::NumCast;
use num::strconv;
use num;
use ops;
use option::{None, Option, Some};
use str;
use uint;
use to_str;
use from_str;
#[cfg(notest)] use cmp::{Eq, Ord};
#[cfg(notest)] use ops;
pub use f64::{add, sub, mul, div, rem, lt, le, eq, ne, ge, gt};
pub use f64::logarithm;
pub use f64::{acos, asin, atan2, cbrt, ceil, copysign, cosh, floor};
+3 -9
View File
@@ -10,21 +10,15 @@
use T = self::inst::T;
use char;
use cmp::{Eq, Ord};
use cmp;
use to_str::ToStr;
use from_str::FromStr;
use num::{ToStrRadix, FromStrRadix};
use num::strconv;
use num;
use prelude::*;
use str;
use uint;
use vec;
use i8;
use i16;
use i32;
#[cfg(notest)] use cmp::{Eq, Ord};
pub use cmp::{min, max};
pub const bits : uint = inst::bits;
-3
View File
@@ -12,10 +12,7 @@
use cmp::{Ord, Eq};
use ops::{Add, Div, Modulo, Mul, Neg, Sub};
use option::{None, Option, Some};
use char;
use str;
use kinds::Copy;
use vec;
pub mod strconv;
+2 -10
View File
@@ -11,9 +11,6 @@
use T = self::inst::T;
use T_SIGNED = self::inst::T_SIGNED;
use char;
use cmp::{Eq, Ord};
use cmp;
use to_str::ToStr;
use from_str::FromStr;
use num::{ToStrRadix, FromStrRadix};
@@ -21,12 +18,8 @@
use num;
use option::{None, Option, Some};
use prelude::*;
use str;
use uint;
use vec;
use u8;
use u16;
use u32;
#[cfg(notest)] use cmp::{Eq, Ord};
pub use cmp::{min, max};
@@ -357,7 +350,6 @@ pub fn to_str_radix37() {
uint::to_str_radix(100u, 37u);
}
use io;
#[test]
pub fn test_ranges() {
let mut l = ~[];
+44 -44
View File
@@ -19,7 +19,6 @@
pub mod inst {
use sys;
use uint;
use iter;
pub type T = uint;
@@ -144,50 +143,51 @@ impl iter::Times for uint {
#[test]
fn test_next_power_of_two() {
assert (uint::next_power_of_two(0u) == 0u);
assert (uint::next_power_of_two(1u) == 1u);
assert (uint::next_power_of_two(2u) == 2u);
assert (uint::next_power_of_two(3u) == 4u);
assert (uint::next_power_of_two(4u) == 4u);
assert (uint::next_power_of_two(5u) == 8u);
assert (uint::next_power_of_two(6u) == 8u);
assert (uint::next_power_of_two(7u) == 8u);
assert (uint::next_power_of_two(8u) == 8u);
assert (uint::next_power_of_two(9u) == 16u);
assert (uint::next_power_of_two(10u) == 16u);
assert (uint::next_power_of_two(11u) == 16u);
assert (uint::next_power_of_two(12u) == 16u);
assert (uint::next_power_of_two(13u) == 16u);
assert (uint::next_power_of_two(14u) == 16u);
assert (uint::next_power_of_two(15u) == 16u);
assert (uint::next_power_of_two(16u) == 16u);
assert (uint::next_power_of_two(17u) == 32u);
assert (uint::next_power_of_two(18u) == 32u);
assert (uint::next_power_of_two(19u) == 32u);
assert (uint::next_power_of_two(20u) == 32u);
assert (uint::next_power_of_two(21u) == 32u);
assert (uint::next_power_of_two(22u) == 32u);
assert (uint::next_power_of_two(23u) == 32u);
assert (uint::next_power_of_two(24u) == 32u);
assert (uint::next_power_of_two(25u) == 32u);
assert (uint::next_power_of_two(26u) == 32u);
assert (uint::next_power_of_two(27u) == 32u);
assert (uint::next_power_of_two(28u) == 32u);
assert (uint::next_power_of_two(29u) == 32u);
assert (uint::next_power_of_two(30u) == 32u);
assert (uint::next_power_of_two(31u) == 32u);
assert (uint::next_power_of_two(32u) == 32u);
assert (uint::next_power_of_two(33u) == 64u);
assert (uint::next_power_of_two(34u) == 64u);
assert (uint::next_power_of_two(35u) == 64u);
assert (uint::next_power_of_two(36u) == 64u);
assert (uint::next_power_of_two(37u) == 64u);
assert (uint::next_power_of_two(38u) == 64u);
assert (uint::next_power_of_two(39u) == 64u);
assert (next_power_of_two(0u) == 0u);
assert (next_power_of_two(1u) == 1u);
assert (next_power_of_two(2u) == 2u);
assert (next_power_of_two(3u) == 4u);
assert (next_power_of_two(4u) == 4u);
assert (next_power_of_two(5u) == 8u);
assert (next_power_of_two(6u) == 8u);
assert (next_power_of_two(7u) == 8u);
assert (next_power_of_two(8u) == 8u);
assert (next_power_of_two(9u) == 16u);
assert (next_power_of_two(10u) == 16u);
assert (next_power_of_two(11u) == 16u);
assert (next_power_of_two(12u) == 16u);
assert (next_power_of_two(13u) == 16u);
assert (next_power_of_two(14u) == 16u);
assert (next_power_of_two(15u) == 16u);
assert (next_power_of_two(16u) == 16u);
assert (next_power_of_two(17u) == 32u);
assert (next_power_of_two(18u) == 32u);
assert (next_power_of_two(19u) == 32u);
assert (next_power_of_two(20u) == 32u);
assert (next_power_of_two(21u) == 32u);
assert (next_power_of_two(22u) == 32u);
assert (next_power_of_two(23u) == 32u);
assert (next_power_of_two(24u) == 32u);
assert (next_power_of_two(25u) == 32u);
assert (next_power_of_two(26u) == 32u);
assert (next_power_of_two(27u) == 32u);
assert (next_power_of_two(28u) == 32u);
assert (next_power_of_two(29u) == 32u);
assert (next_power_of_two(30u) == 32u);
assert (next_power_of_two(31u) == 32u);
assert (next_power_of_two(32u) == 32u);
assert (next_power_of_two(33u) == 64u);
assert (next_power_of_two(34u) == 64u);
assert (next_power_of_two(35u) == 64u);
assert (next_power_of_two(36u) == 64u);
assert (next_power_of_two(37u) == 64u);
assert (next_power_of_two(38u) == 64u);
assert (next_power_of_two(39u) == 64u);
}
#[test]
fn test_overflows() {
use uint;
assert (uint::max_value > 0u);
assert (uint::min_value <= 0u);
assert (uint::min_value + uint::max_value + 1u == 0u);
@@ -195,9 +195,9 @@ fn test_overflows() {
#[test]
fn test_div() {
assert(uint::div_floor(3u, 4u) == 0u);
assert(uint::div_ceil(3u, 4u) == 1u);
assert(uint::div_round(3u, 4u) == 1u);
assert(div_floor(3u, 4u) == 0u);
assert(div_ceil(3u, 4u) == 1u);
assert(div_round(3u, 4u) == 1u);
}
#[test]
+3 -3
View File
@@ -43,12 +43,12 @@
use cmp::{Eq,Ord};
use kinds::Copy;
use option;
use ptr;
use str;
use util;
use num::Zero;
#[cfg(test)] use ptr;
#[cfg(test)] use str;
/// The option type
#[deriving_eq]
pub enum Option<T> {
-2
View File
@@ -27,7 +27,6 @@
*/
use cast;
use either;
use io;
use libc;
use libc::{c_char, c_void, c_int, c_uint, size_t, ssize_t};
@@ -38,7 +37,6 @@
use ptr;
use str;
use task;
use task::TaskBuilder;
use uint;
use vec;
+1 -1
View File
@@ -10,7 +10,7 @@
//! Operations on unique pointer types
use cmp::{Eq, Ord};
#[cfg(notest)] use cmp::{Eq, Ord};
#[cfg(notest)]
impl<T:Eq> Eq for ~T {
-2
View File
@@ -17,7 +17,6 @@
use cmp::Eq;
use libc;
use option::{None, Option, Some};
use ptr;
use str;
use to_str::ToStr;
@@ -830,7 +829,6 @@ impl GenericPath for WindowsPath {
pub mod windows {
use libc;
use option::{None, Option, Some};
use to_str::ToStr;
#[inline(always)]
pub pure fn is_sep(u: u8) -> bool {
-2
View File
@@ -90,10 +90,8 @@
use libc;
use option;
use option::{None, Option, Some, unwrap};
use pipes;
use unstable::intrinsics;
use ptr;
use unstable;
use task;
use vec;
+12 -12
View File
@@ -11,14 +11,14 @@
//! Unsafe pointer utility functions
use cast;
use cmp::{Eq, Ord};
use libc;
use libc::{c_void, size_t};
use unstable::intrinsics::{memmove32,memmove64};
use ptr;
use str;
use sys;
use vec;
#[cfg(test)] use vec;
#[cfg(test)] use str;
#[cfg(notest)] use cmp::{Eq, Ord};
#[nolink]
#[abi = "cdecl"]
@@ -316,13 +316,13 @@ pub fn test() {
let mut v0 = ~[32000u16, 32001u16, 32002u16];
let mut v1 = ~[0u16, 0u16, 0u16];
ptr::copy_memory(ptr::mut_offset(vec::raw::to_mut_ptr(v1), 1u),
ptr::offset(vec::raw::to_ptr(v0), 1u), 1u);
copy_memory(mut_offset(vec::raw::to_mut_ptr(v1), 1u),
offset(vec::raw::to_ptr(v0), 1u), 1u);
assert (v1[0] == 0u16 && v1[1] == 32001u16 && v1[2] == 0u16);
ptr::copy_memory(vec::raw::to_mut_ptr(v1),
ptr::offset(vec::raw::to_ptr(v0), 2u), 1u);
copy_memory(vec::raw::to_mut_ptr(v1),
offset(vec::raw::to_ptr(v0), 2u), 1u);
assert (v1[0] == 32002u16 && v1[1] == 32001u16 && v1[2] == 0u16);
ptr::copy_memory(ptr::mut_offset(vec::raw::to_mut_ptr(v1), 2u),
copy_memory(mut_offset(vec::raw::to_mut_ptr(v1), 2u),
vec::raw::to_ptr(v0), 1u);
assert (v1[0] == 32002u16 && v1[1] == 32001u16 && v1[2] == 32000u16);
}
@@ -361,15 +361,15 @@ pub fn test_buf_len() {
#[test]
pub fn test_is_null() {
let p: *int = ptr::null();
let p: *int = null();
assert p.is_null();
assert !p.is_not_null();
let q = ptr::offset(p, 1u);
let q = offset(p, 1u);
assert !q.is_null();
assert q.is_not_null();
let mp: *mut int = ptr::mut_null();
let mp: *mut int = mut_null();
assert mp.is_null();
assert !mp.is_not_null();
+3 -7
View File
@@ -15,29 +15,25 @@
*/
use cast::transmute;
use cast;
use char;
use dvec::DVec;
use intrinsic;
use intrinsic::{TyDesc, TyVisitor, visit_tydesc};
use io;
use io::{Writer, WriterUtil};
use libc::c_void;
use managed;
use managed::raw::BoxHeaderRepr;
use ptr;
use reflect;
use reflect::{MovePtr, MovePtrAdaptor, align};
use repr;
use str;
use sys;
use sys::TypeDesc;
use to_str::ToStr;
use uint;
use vec::UnboxedVecRepr;
use vec::raw::{VecRepr, SliceRepr};
use vec;
#[cfg(test)] use io;
pub use managed::raw::BoxRepr;
/// Helpers
@@ -581,7 +577,7 @@ struct P {a: int, b: float}
fn test_repr() {
fn exact_test<T>(t: &T, e:&str) {
let s : &str = io::with_str_writer(|w| repr::write_repr(w, t));
let s : &str = io::with_str_writer(|w| write_repr(w, t));
if s != e {
error!("expected '%s', got '%s'",
e, s);
-1
View File
@@ -12,7 +12,6 @@
// NB: transitionary, de-mode-ing.
use cmp;
use cmp::Eq;
use either;
use either::Either;
-2
View File
@@ -11,7 +11,6 @@
//! Process spawning
use cast;
use io;
use io::ReaderUtil;
use libc;
use libc::{pid_t, c_void, c_int};
use comm::{stream, SharedChan, GenericChan, GenericPort};
@@ -452,7 +451,6 @@ fn WEXITSTATUS(status: i32) -> i32 {
#[cfg(test)]
mod tests {
use debug;
use io::WriterUtil;
use option::{None, Some};
use os;
use run::{readclose, writeclose};
-2
View File
@@ -11,8 +11,6 @@
#[doc(hidden)]; // FIXME #3538
use cast::reinterpret_cast;
use ptr::offset;
use sys::size_of;
pub type Word = uint;
+3 -4
View File
@@ -20,18 +20,17 @@
use at_vec;
use cast;
use char;
use cmp::{Eq, Ord, TotalOrd, Ordering, Less, Equal, Greater};
use cmp::{TotalOrd, Ordering, Less, Equal, Greater};
use libc;
use libc::size_t;
use io::WriterUtil;
use option::{None, Option, Some};
use ptr;
use str;
use to_str::ToStr;
use u8;
use uint;
use vec;
#[cfg(notest)] use cmp::{Eq, Ord};
/*
Section: Creating a string
*/
-2
View File
@@ -16,10 +16,8 @@
use io;
use libc;
use libc::{c_void, c_char, size_t};
use ptr;
use repr;
use str;
use vec;
pub type FreeGlue = fn(*TypeDesc, *c_void);
-1
View File
@@ -29,7 +29,6 @@
use prelude::*;
use task::local_data_priv::{local_get, local_pop, local_modify, local_set};
use task::rt;
use task;
/**
* Indexes a task-local data slot. The function's code pointer is used for
-8
View File
@@ -33,22 +33,14 @@
* ~~~
*/
use cast;
use cell::Cell;
use cmp;
use cmp::Eq;
use iter;
use libc;
use option;
use result::Result;
use comm::{stream, Chan, GenericChan, GenericPort, Port, SharedChan};
use pipes;
use prelude::*;
use ptr;
use result;
use task::local_data_priv::{local_get, local_set};
use task::rt::{task_id, sched_id, rust_task};
use task;
use util;
use util::replace;
-2
View File
@@ -77,14 +77,12 @@
use container::Map;
use option;
use comm::{Chan, GenericChan, GenericPort, Port, stream};
use pipes;
use prelude::*;
use unstable;
use ptr;
use hashmap::linear::LinearSet;
use task::local_data_priv::{local_get, local_set};
use task::rt::rust_task;
use task::rt::rust_closure;
use task::rt;
use task::{Failure, ManualThreads, PlatformThread, SchedOpts, SingleThreaded};
use task::{Success, TaskOpts, TaskResult, ThreadPerCore, ThreadPerTask};
-2
View File
@@ -14,9 +14,7 @@
*/
use kinds::Copy;
use str;
use vec;
pub trait ToStr {
pure fn to_str(&self) -> ~str;
+2 -1
View File
@@ -10,10 +10,11 @@
//! Operations on tuples
use cmp::{Eq, Ord};
use kinds::Copy;
use vec;
#[cfg(notest)] use cmp::{Eq, Ord};
pub trait CopyableTuple<T, U> {
pure fn first() -> T;
pure fn second() -> U;
-9
View File
@@ -11,16 +11,12 @@
#[doc(hidden)];
use cast;
use iter;
use libc;
use option;
use comm::{GenericChan, GenericPort};
use prelude::*;
use ptr;
use result;
use task;
use task::{TaskBuilder, atomically};
use uint;
#[path = "unstable/at_exit.rs"]
pub mod at_exit;
@@ -310,13 +306,8 @@ unsafe fn with_imm<U>(f: fn(x: &T) -> U) -> U {
#[cfg(test)]
pub mod tests {
use core::option::{None, Some};
use cell::Cell;
use comm;
use option;
use super::exclusive;
use result;
use task;
use uint;
+2 -2
View File
@@ -10,13 +10,13 @@
use sys;
use cast;
use ptr;
use task;
use uint;
use vec;
use rand;
use libc::{c_void, size_t};
#[cfg(test)] use uint;
/**
Register a function to be run during runtime shutdown.
-3
View File
@@ -77,9 +77,7 @@
*/
use cmp::Eq;
use option::{Some, None};
use prelude::*;
use str;
/*
* We have a 'ct' (compile-time) module that parses format strings into a
@@ -98,7 +96,6 @@ pub mod ct {
use char;
use prelude::*;
use str;
use vec;
#[deriving_eq]
pub enum Signedness { Signed, Unsigned, }
+2 -1
View File
@@ -24,7 +24,8 @@
*/
use ops::Drop;
use task::{spawn, failing};
#[cfg(test)] use task::failing;
pub trait Finally<T> {
fn finally(&self, dtor: &fn()) -> T;
+5 -5
View File
@@ -31,16 +31,16 @@
use libc::{c_void, uintptr_t};
use option::{Option, Some, None};
use ops::Drop;
use pipes;
use unstable::{Exclusive, exclusive};
use unstable::{SharedMutableState, shared_mutable_state};
use unstable::{get_shared_immutable_state};
use unstable::at_exit::at_exit;
use unstable::intrinsics::atomic_cxchg;
use hashmap::linear::LinearMap;
use sys::Closure;
use task::spawn;
use uint;
#[cfg(test)] use unstable::{SharedMutableState, shared_mutable_state};
#[cfg(test)] use unstable::get_shared_immutable_state;
#[cfg(test)] use task::spawn;
#[cfg(test)] use uint;
pub type GlobalDataKey<T> = &fn(v: T);
+2 -1
View File
@@ -18,7 +18,8 @@
use unstable::exchange_alloc;
use cast::transmute;
use gc::{cleanup_stack_for_failure, gc, Word};
#[allow(non_camel_case_types)]
pub type rust_task = c_void;
#[cfg(target_word_size = "32")]
pub const FROZEN_BIT: uint = 0x80000000;
-1
View File
@@ -22,7 +22,6 @@
use comm::{GenericSmartChan, stream};
use comm::{Port, Chan, SharedChan, GenericChan, GenericPort};
use hashmap::linear::LinearMap;
use ops::Drop;
use option::{Some, None, swap_unwrap};
use unstable::at_exit::at_exit;
use unstable::finally::Finally;
+1 -1
View File
@@ -14,7 +14,6 @@
*/
use cmp::Eq;
use prelude::*;
/// The identity function.
@@ -102,6 +101,7 @@ pub fn unreachable() -> ! {
fail!(~"internal error: entered unreachable code");
}
#[cfg(test)]
mod tests {
use option::{None, Some};
use util::{NonCopyable, id, replace, swap};
-1
View File
@@ -13,7 +13,6 @@
#[warn(non_camel_case_types)];
use container::{Container, Mutable};
use cast::transmute;
use cast;
use cmp::{Eq, Ord, TotalOrd, Ordering, Less, Equal, Greater};
use iter::BaseIter;
-7
View File
@@ -15,17 +15,14 @@
use driver::session;
use lib::llvm::llvm;
use lib::llvm::{ModuleRef, mk_pass_manager, mk_target_data, True, False};
use lib::llvm::{PassManagerRef, FileType};
use lib;
use metadata::common::LinkMeta;
use metadata::filesearch;
use metadata::{encoder, cstore};
use middle::trans::common::CrateContext;
use middle::ty;
use util::ppaux;
use core::char;
use core::cmp;
use core::hash;
use core::io::{Writer, WriterUtil};
use core::libc::{c_int, c_uint, c_char};
@@ -35,8 +32,6 @@
use core::run;
use core::str;
use core::vec;
use std::oldmap::HashMap;
use std::sha1::sha1;
use syntax::ast;
use syntax::ast_map::{path, path_mod, path_name};
use syntax::attr;
@@ -175,11 +170,9 @@ pub mod write {
use lib::llvm::{False, True, ModuleRef, mk_pass_manager, mk_target_data};
use lib;
use core::char;
use core::libc::{c_char, c_int, c_uint};
use core::path::Path;
use core::str;
use core::vec;
pub fn is_object_or_assembly_or_exe(ot: output_type) -> bool {
if ot == output_type_assembly || ot == output_type_object ||
+7 -4
View File
@@ -198,16 +198,19 @@ pub fn minimize_rpaths(rpaths: &[Path]) -> ~[Path] {
#[cfg(unix)]
mod test {
// FIXME(#2119): the outer attribute should be #[cfg(unix, test)], then
// these redundant #[cfg(test)] blocks can be removed
#[cfg(test)]
use core::prelude::*;
#[cfg(test)]
use back::rpath::{get_absolute_rpath, get_install_prefix_rpath};
#[cfg(test)]
use back::rpath::{get_relative_to, get_rpath_relative_to_output};
#[cfg(test)]
use back::rpath::{minimize_rpaths, rpaths_to_flags};
#[cfg(test)]
use driver::session;
use core::os;
use core::str;
#[test]
pub fn test_rpaths_to_flags() {
let flags = rpaths_to_flags(~[Path("path1"),
-6
View File
@@ -23,23 +23,17 @@
use middle;
use util::ppaux;
use core::cmp;
use core::int;
use core::io::WriterUtil;
use core::io;
use core::option;
use core::os;
use core::result::{Ok, Err};
use core::str;
use core::vec;
use std::getopts::groups::{optopt, optmulti, optflag, optflagopt, getopts};
use std::getopts::groups;
use std::getopts::{opt_present};
use std::getopts;
use std::oldmap::HashMap;
use std;
use syntax::ast;
use syntax::ast_map;
use syntax::attr;
use syntax::codemap;
use syntax::diagnostic;
-5
View File
@@ -19,8 +19,6 @@
use metadata;
use middle::lint;
use core::cmp;
use core::option;
use syntax::ast::node_id;
use syntax::ast::{int_ty, uint_ty, float_ty};
use syntax::codemap::span;
@@ -346,13 +344,10 @@ pub fn sess_os_to_meta_os(os: os) -> metadata::loader::os {
#[cfg(test)]
pub mod test {
use core::prelude::*;
use driver::session::{bin_crate, building_library, lib_crate};
use driver::session::{unknown_crate};
use syntax::ast;
use syntax::ast_util;
use syntax::codemap;
pub fn make_crate_type_attr(+t: ~str) -> ast::attribute {
-1
View File
@@ -14,7 +14,6 @@
use core::vec;
use syntax::ast;
use syntax::ast_util::*;
use syntax::attr;
use syntax::codemap;
use syntax::codemap::dummy_sp;
-4
View File
@@ -12,15 +12,11 @@
use core::prelude::*;
use driver::session::Session;
use driver::session;
use front::config;
use core::dvec::DVec;
use core::option;
use core::vec;
use syntax::ast_util::*;
use syntax::attr::attrs_contains_name;
use syntax::attr;
use syntax::codemap::{dummy_sp, span, ExpandedFrom, CallInfo, NameAndSpan};
use syntax::codemap;
-5
View File
@@ -10,15 +10,10 @@
use core::prelude::*;
use core::cast;
use core::cmp;
use core::int;
use core::io;
use core::libc::{c_char, c_int, c_uint, c_longlong, c_ulonglong};
use core::option;
use core::ptr;
use core::str;
use core::uint;
use core::vec;
use std::oldmap::HashMap;
-3
View File
@@ -14,19 +14,16 @@
use core::prelude::*;
use metadata::cstore;
use metadata::common::*;
use metadata::decoder;
use metadata::filesearch::FileSearch;
use metadata::loader;
use core::either;
use core::option;
use core::vec;
use syntax::attr;
use syntax::codemap::{span, dummy_sp};
use syntax::diagnostic::span_handler;
use syntax::parse::token::ident_interner;
use syntax::print::pprust;
use syntax::visit;
use syntax::{ast, ast_util};
use std::oldmap::HashMap;
-5
View File
@@ -22,14 +22,9 @@
use core::dvec::DVec;
use core::vec;
use reader = std::ebml::reader;
use std::ebml;
use std::oldmap::HashMap;
use syntax::ast;
use syntax::ast_map;
use syntax::codemap::dummy_sp;
use syntax::ast_util;
use syntax::diagnostic::expect;
use syntax::diagnostic::span_handler;
pub struct ProvidedTraitMethodInfo {
ty: ty::method,
-4
View File
@@ -14,14 +14,10 @@
use core::prelude::*;
use metadata::creader;
use metadata::cstore;
use metadata::decoder;
use core::option;
use core::str;
use core::vec;
use std::oldmap::HashMap;
use std::oldmap;
use std;
use syntax::{ast, attr};
+1 -6
View File
@@ -20,13 +20,10 @@
use metadata::cstore;
use metadata::decoder;
use metadata::tydecode::{parse_ty_data, parse_def_id, parse_bounds_data};
use metadata::tydecode::{parse_ident};
use middle::{ty, resolve};
use util::ppaux::ty_to_str;
use core::cmp;
use core::dvec::DVec;
use core::dvec;
use core::dvec::DVec;
use core::hash::{Hash, HashUtil};
use core::int;
use core::io::WriterUtil;
@@ -36,8 +33,6 @@
use core::vec;
use std::ebml::reader;
use std::ebml;
use std::oldmap::HashMap;
use std::oldmap;
use std::serialize::Decodable;
use syntax::ast_map;
use syntax::attr;
-5
View File
@@ -14,11 +14,9 @@
use core::prelude::*;
use metadata::common::*;
use metadata::csearch;
use metadata::cstore;
use metadata::decoder;
use metadata::tyencode;
use middle::resolve;
use middle::ty::node_id_to_type;
use middle::ty;
use middle;
@@ -26,12 +24,10 @@
use core::dvec;
use core::flate;
use core::float;
use core::hash::{Hash, HashUtil};
use core::int;
use core::io::WriterUtil;
use core::io;
use core::str::to_bytes;
use core::str;
use core::to_bytes::IterBytes;
use core::uint;
@@ -47,7 +43,6 @@
use syntax::attr;
use syntax::diagnostic::span_handler;
use syntax::parse::token::special_idents;
use syntax::print::pprust;
use syntax::{ast_util, visit};
use syntax::opt_vec::OptVec;
use syntax::opt_vec;
-2
View File
@@ -18,14 +18,12 @@
use middle::ty;
use core::io;
use core::str;
use core::uint;
use core::vec;
use syntax::ast;
use syntax::ast::*;
use syntax::codemap::{respan, dummy_sp};
use std::oldmap::HashMap;
// Compact string representation for ty::t values. API ty_str &
// parse_from_str. Extra parameters are for converting to/from def_ids in the
+5 -9
View File
@@ -21,18 +21,13 @@
use metadata::tyencode;
use middle::freevars::freevar_entry;
use middle::typeck::{method_origin, method_map_entry, vtable_res};
use middle::typeck::{vtable_origin};
use middle::{ty, typeck, moves};
use middle;
use util::ppaux::ty_to_str;
use core::{dvec, io, option, vec};
use std::ebml::reader::get_doc;
use std::ebml::reader;
use std::ebml::writer::Encoder;
use std::ebml;
use std::oldmap::HashMap;
use std::prettyprint;
use std::serialize;
use std::serialize::{Encodable, EncoderHelpers, DecoderHelpers};
use std::serialize::Decodable;
@@ -41,15 +36,14 @@
use syntax::ast_util;
use syntax::codemap::span;
use syntax::codemap;
use syntax::diagnostic;
use syntax::fold::*;
use syntax::fold;
use syntax::parse;
use syntax::print::pprust;
use syntax::visit;
use syntax;
use writer = std::ebml::writer;
#[cfg(test)] use syntax::parse;
#[cfg(test)] use syntax::print::pprust;
// Auxiliary maps of things to be encoded
pub struct Maps {
mutbl_map: middle::borrowck::mutbl_map,
@@ -1235,6 +1229,8 @@ fn mk_ctxt() -> fake_ext_ctxt {
#[cfg(test)]
fn roundtrip(in_item: Option<@ast::item>) {
use std::prettyprint;
let in_item = in_item.get();
let bytes = do io::with_bytes_writer |wr| {
let ebml_w = writer::Encoder(wr);
@@ -31,10 +31,7 @@
use middle::ty;
use util::ppaux::ty_to_str;
use core::cmp;
use core::dvec::DVec;
use core::uint;
use core::vec;
use std::oldmap::HashMap;
use syntax::ast::{m_const, m_imm, m_mutbl};
use syntax::ast;
@@ -26,7 +26,6 @@
use middle::borrowck::loan;
use middle::mem_categorization::{cat_binding, cat_discr, cmt, comp_variant};
use middle::mem_categorization::{mem_categorization_ctxt};
use middle::mem_categorization::{opt_deref_kind};
use middle::pat_util;
use middle::ty::{ty_region};
use middle::ty;
+1 -10
View File
@@ -226,31 +226,22 @@
use core::prelude::*;
use middle::liveness;
use middle::mem_categorization::*;
use middle::region;
use middle::ty;
use middle::typeck;
use middle::moves;
use util::common::{indenter, stmt_set};
use util::ppaux::{expr_repr, note_and_explain_region};
use util::ppaux::{ty_to_str, region_to_str, explain_region};
use util::ppaux::note_and_explain_region;
use core::cmp;
use core::dvec::DVec;
use core::io;
use core::result::{Result, Ok, Err};
use core::to_bytes;
use std::list::{List, Cons, Nil};
use std::list;
use std::oldmap::{HashMap, Set};
use syntax::ast::{mutability, m_mutbl, m_imm, m_const};
use syntax::ast;
use syntax::ast_map;
use syntax::ast_util;
use syntax::codemap::span;
use syntax::print::pprust;
use syntax::visit;
pub mod check_loans;
pub mod gather_loans;
-1
View File
@@ -27,7 +27,6 @@
use middle::ty;
use util::common::indenter;
use syntax::ast::{m_const, m_imm, m_mutbl};
use syntax::ast;
pub enum PreserveCondition {
-1
View File
@@ -17,7 +17,6 @@
use util::ppaux;
use core::option;
use std::oldmap::HashMap;
use syntax::ast::*;
use syntax::codemap;
use syntax::{visit, ast_util, ast_map};
-3
View File
@@ -19,16 +19,13 @@
use middle::moves;
use util::ppaux::ty_to_str;
use core::cmp;
use core::option;
use core::uint;
use core::vec;
use std::oldmap::HashMap;
use std::sort;
use syntax::ast::*;
use syntax::ast_util::{variant_def_ids, unguarded_pat, walk_pat};
use syntax::codemap::{span, dummy_sp, spanned};
use syntax::print::pprust::pat_to_str;
use syntax::visit;
pub struct MatchCheckCtxt {
-1
View File
@@ -14,7 +14,6 @@
use middle::ty;
use middle;
use core::cmp;
use core::float;
use core::vec;
use syntax::{ast, ast_map, ast_util, visit};
-1
View File
@@ -20,7 +20,6 @@
use core::vec;
use std::oldmap::*;
use syntax::codemap::span;
use syntax::print::pprust::path_to_str;
use syntax::{ast, ast_util, visit};
// A vector of defs representing the free variables referred to in a function.
-2
View File
@@ -12,12 +12,10 @@
use middle::freevars::freevar_entry;
use middle::freevars;
use middle::lint::{non_implicitly_copyable_typarams, implicit_copies};
use middle::liveness;
use middle::pat_util;
use middle::ty;
use middle::typeck;
use middle;
use util::ppaux::{ty_to_str, tys_to_str};
use core::option;
-2
View File
@@ -25,7 +25,6 @@
use driver::session::Session;
use metadata::csearch::{each_lang_item, get_item_attrs};
use metadata::cstore::{iter_crate_data};
use metadata::decoder::{dl_def, dl_field, dl_impl};
use syntax::ast::{crate, def_fn, def_id, def_ty, lit_str, meta_item};
use syntax::ast::{meta_list, meta_name_value, meta_word};
use syntax::ast_util::{local_def};
@@ -34,7 +33,6 @@
use core::ptr;
use std::oldmap::HashMap;
use str_eq = core::str::eq;
pub enum LangItem {
ConstTraitLangItem, // 0
+1 -4
View File
@@ -12,7 +12,6 @@
use driver::session::Session;
use driver::session;
use middle::pat_util::{pat_bindings};
use middle::ty;
use util::ppaux::{ty_to_str};
@@ -24,7 +23,6 @@
use core::i32;
use core::i64;
use core::int;
use core::io::WriterUtil;
use core::str;
use core::u8;
use core::u16;
@@ -35,7 +33,6 @@
use std::oldmap::{Map, HashMap};
use std::oldmap;
use std::smallintmap::SmallIntMap;
use syntax::ast_util::{path_to_ident};
use syntax::attr;
use syntax::codemap::span;
use syntax::codemap;
@@ -132,7 +129,7 @@ pub fn get_lint_dict() -> LintDict {
@LintSpec {
lint: unused_imports,
desc: "imports that are never used",
default: allow
default: warn
}),
(@~"while_true",
@@ -54,8 +54,6 @@
use util::ppaux::{ty_to_str, region_to_str};
use util::common::indenter;
use core::cmp;
use core::to_bytes;
use core::uint;
use syntax::ast::{m_imm, m_const, m_mutbl};
use syntax::ast;
-3
View File
@@ -11,12 +11,9 @@
use core::prelude::*;
use middle::resolve;
use middle::ty;
use syntax::ast::*;
use syntax::ast_util::{path_to_ident, walk_pat};
use syntax::fold;
use syntax::fold::*;
use syntax::codemap::{span, respan};
use std::oldmap::HashMap;
-4
View File
@@ -25,13 +25,9 @@
use middle::ty::{region_variance, rv_covariant, rv_invariant};
use middle::ty::{rv_contravariant};
use middle::ty;
use util::common::stmt_set;
use core::cmp;
use core::dvec::DVec;
use core::vec;
use std::list;
use std::list::list;
use std::oldmap::HashMap;
use syntax::ast_map;
use syntax::codemap::span;
-6
View File
@@ -22,7 +22,6 @@
use middle::lint::{get_lint_level, get_lint_settings_level};
use middle::pat_util::{pat_bindings};
use core::cmp;
use core::str;
use core::vec;
use syntax::ast::{RegionTyParamBound, TraitTyParamBound, _mod, add, arm};
@@ -74,17 +73,12 @@
use syntax::visit::{visit_crate, visit_expr, visit_expr_opt, visit_fn};
use syntax::visit::{visit_foreign_item, visit_item, visit_method_helper};
use syntax::visit::{visit_mod, visit_ty, vt};
use syntax::opt_vec;
use syntax::opt_vec::OptVec;
use core::dvec::DVec;
use core::managed::ptr_eq;
use core::option::{Some, get, is_some, is_none};
use core::str::{connect, split_str};
use core::vec::pop;
use std::list::{Cons, List, Nil};
use std::oldmap::HashMap;
use str_eq = core::str::eq;
// Definition mapping
pub type DefMap = HashMap<node_id,def>;
-10
View File
@@ -26,10 +26,6 @@
use core::prelude::*;
use back::link::{mangle_exported_name};
use back::link::{mangle_internal_name_by_path_and_seq};
use back::link::{mangle_internal_name_by_path};
use back::link::{mangle_internal_name_by_seq};
use back::link::{mangle_internal_name_by_type_only};
use back::{link, abi, upcall};
use driver::session;
use driver::session::Session;
@@ -41,7 +37,6 @@
use metadata::{csearch, cstore, decoder, encoder};
use middle::astencode;
use middle::borrowck::RootInfo;
use middle::pat_util::*;
use middle::resolve;
use middle::trans::_match;
use middle::trans::base;
@@ -66,17 +61,14 @@
use middle::trans::type_of;
use middle::trans::type_of::*;
use middle::ty;
use middle::ty::arg;
use util::common::indenter;
use util::ppaux::{ty_to_str, ty_to_short_str};
use util::ppaux;
use core::either;
use core::hash;
use core::int;
use core::io;
use core::libc::{c_uint, c_ulonglong};
use core::option::{is_none, is_some};
use core::option;
use core::uint;
use std::oldmap::HashMap;
@@ -86,11 +78,9 @@
use syntax::ast_util::{def_id_of_def, local_def, path_to_ident};
use syntax::attr;
use syntax::codemap::span;
use syntax::diagnostic::expect;
use syntax::parse::token::special_idents;
use syntax::print::pprust::{expr_to_str, stmt_to_str, path_to_str};
use syntax::visit;
use syntax::visit::vt;
use syntax::{ast, ast_util, codemap, ast_map};
pub struct icx_popper {
+1 -4
View File
@@ -14,10 +14,9 @@
use lib::llvm::{ValueRef, TypeRef, BasicBlockRef, BuilderRef, ModuleRef};
use lib;
use middle::trans::common::*;
use middle::trans::machine::llsize_of_real;
use syntax::codemap::span;
use core::prelude::*;
use core::cast::transmute;
use core::cast;
use core::libc::{c_uint, c_int, c_ulonglong};
use core::libc;
@@ -26,8 +25,6 @@
use core::str;
use core::vec;
use std::oldmap::HashMap;
use syntax::codemap::span;
use syntax::codemap;
pub fn terminate(cx: block, _: &str) {
unsafe {
-1
View File
@@ -22,7 +22,6 @@
use core::libc::c_uint;
use core::option;
use core::option::Option;
use core::ptr;
use core::uint;
use core::vec;
-2
View File
@@ -39,14 +39,12 @@
use middle::trans::meth;
use middle::trans::monomorphize;
use middle::trans::type_of;
use middle::ty::ty_to_str;
use middle::ty;
use middle::typeck;
use util::common::indenter;
use syntax::ast;
use syntax::ast_map;
use syntax::print::pprust::{expr_to_str, stmt_to_str, path_to_str};
use syntax::visit;
// Represents a (possibly monomorphized) top-level fn item or method
-5
View File
@@ -12,7 +12,6 @@
use back::abi;
use back::link::{mangle_internal_name_by_path_and_seq};
use back::link::{mangle_internal_name_by_path};
use lib::llvm::{llvm, ValueRef, TypeRef};
use middle::moves;
use middle::trans::base::*;
@@ -27,14 +26,10 @@
use middle::ty;
use util::ppaux::ty_to_str;
use core::libc::c_uint;
use std::oldmap::HashMap;
use syntax::ast;
use syntax::ast_map::{path, path_mod, path_name};
use syntax::ast_util;
use syntax::codemap::span;
use syntax::parse::token::special_idents;
use syntax::print::pprust::expr_to_str;
// ___Good to know (tm)__________________________________________________
//
-4
View File
@@ -24,7 +24,6 @@
use lib::llvm::{llvm, TargetData, TypeNames, associate_type, name_has_type};
use lib;
use metadata::common::LinkMeta;
use metadata::{csearch};
use middle::astencode;
use middle::resolve;
use middle::trans::base;
@@ -34,7 +33,6 @@
use middle::trans::debuginfo;
use middle::trans::expr;
use middle::trans::glue;
use middle::trans::meth;
use middle::trans::reachable;
use middle::trans::shape;
use middle::trans::type_of;
@@ -45,7 +43,6 @@
use util::ppaux::{expr_repr, ty_to_str};
use core::cast;
use core::cmp;
use core::hash;
use core::libc::c_uint;
use core::ptr;
@@ -58,7 +55,6 @@
use syntax::ast_map::path;
use syntax::codemap::span;
use syntax::parse::token::ident_interner;
use syntax::print::pprust::expr_to_str;
use syntax::{ast, ast_map};
pub type namegen = @fn(~str) -> ident;
-1
View File
@@ -17,7 +17,6 @@
use middle::trans::build::*;
use middle::trans::callee;
use middle::trans::common::*;
use middle::trans::datum::*;
use middle::trans::debuginfo;
use middle::trans::expr;
use middle::trans::type_of::*;
-3
View File
@@ -100,15 +100,12 @@
use middle::trans::tvec;
use middle::trans::type_of;
use middle::ty;
use middle::typeck;
use util::common::indenter;
use util::ppaux::ty_to_str;
use core::cmp;
use core::option;
use core::to_bytes;
use core::uint;
use core::vec;
use syntax::ast;
use syntax::parse::token::special_idents;
-4
View File
@@ -13,9 +13,6 @@
use driver::session;
use lib::llvm::ValueRef;
use lib::llvm::llvm;
use middle::pat_util::*;
use middle::trans::base;
use middle::trans::build::B;
use middle::trans::common::*;
use middle::trans::machine;
use middle::trans::type_of;
@@ -28,7 +25,6 @@
use core::sys;
use std::oldmap::HashMap;
use std::oldmap;
use syntax::ast::Ty;
use syntax::codemap::{span, CharPos};
use syntax::parse::token::ident_interner;
use syntax::{ast, codemap, ast_util, ast_map};
-2
View File
@@ -125,7 +125,6 @@
use lib;
use lib::llvm::{ValueRef, TypeRef, llvm, True};
use middle::borrowck::root_map_key;
use middle::resolve;
use middle::trans::_match;
use middle::trans::base;
use middle::trans::base::*;
@@ -153,7 +152,6 @@
use syntax::print::pprust::{expr_to_str};
use syntax::ast;
use syntax::codemap;
use syntax::codemap::spanned;
// Destinations
-4
View File
@@ -16,8 +16,6 @@
use driver::session::arch_arm;
use driver::session::arch_mips;
use lib::llvm::{SequentiallyConsistent, Acquire, Release, Xchg};
use lib::llvm::{Struct, Array, ModuleRef, CallConv, Attribute};
use lib::llvm::{StructRetAttribute, ByValAttribute};
use lib::llvm::{llvm, TypeRef, ValueRef, Integer, Pointer, Float, Double};
use lib;
use middle::trans::base::*;
@@ -33,14 +31,12 @@
use middle::trans::machine::llsize_of;
use middle::trans::glue;
use middle::trans::machine;
use middle::trans::shape;
use middle::trans::type_of::*;
use middle::trans::type_of;
use middle::ty;
use middle::ty::{FnSig, arg};
use util::ppaux::ty_to_str;
use core::libc::c_uint;
use syntax::codemap::span;
use syntax::{ast, ast_util};
use syntax::{attr, ast_map};
-3
View File
@@ -16,9 +16,6 @@
use middle::trans::base::{impl_owned_self, impl_self, no_self};
use middle::trans::base::{trans_item, get_item_val, self_arg, trans_fn};
use middle::trans::common::*;
use middle::trans::common;
use middle::trans::inline;
use middle::trans::monomorphize;
use middle::ty;
use util::ppaux::ty_to_str;
-4
View File
@@ -12,7 +12,6 @@
use back::{link, abi};
use driver;
use lib::llvm::llvm::LLVMGetParam;
use lib::llvm::llvm;
use lib::llvm::{ValueRef, TypeRef};
use lib;
@@ -34,11 +33,8 @@
use util::common::indenter;
use util::ppaux::{ty_to_str, tys_to_str};
use core::libc::c_uint;
use std::oldmap::HashMap;
use syntax::ast_map::{path, path_mod, path_name, node_id_to_str};
use syntax::ast_util;
use syntax::print::pprust::expr_to_str;
use syntax::{ast, ast_map};
/**
@@ -24,7 +24,6 @@
use middle::trans::foreign;
use middle::trans::machine;
use middle::trans::meth;
use middle::trans::shape;
use middle::trans::type_of::type_of_fn_from_ty;
use middle::trans::type_of;
use middle::trans::type_use;
-1
View File
@@ -16,7 +16,6 @@
// reachable as well.
use driver::session::*;
use middle::resolve;
use middle::ty;
use middle::typeck;
-2
View File
@@ -9,7 +9,6 @@
// except according to those terms.
use back::abi;
use lib::llvm::{TypeRef, ValueRef};
use middle::trans::base::*;
use middle::trans::build::*;
@@ -27,7 +26,6 @@
use core::option::None;
use core::vec;
use std::oldmap::HashMap;
use syntax::ast::def_id;
use syntax::ast;
-15
View File
@@ -12,28 +12,13 @@
// This substitutes for the runtime tags used by e.g. MLs.
use back::abi;
use lib::llvm::llvm;
use lib::llvm::{True, False, ModuleRef, TypeRef, ValueRef};
use middle::trans::base;
use middle::trans::common::*;
use middle::trans::machine::*;
use middle::trans;
use middle::ty::field;
use middle::ty;
use util::ppaux::ty_to_str;
use core::dvec::DVec;
use core::option::is_some;
use core::str;
use core::vec;
use std::oldmap::HashMap;
use syntax::ast;
use syntax::codemap::dummy_sp;
use syntax::codemap::span;
use syntax::util::interner;
use ty_ctxt = middle::ty::ctxt;
pub struct Ctxt {
next_tag_id: u16,
-2
View File
@@ -31,8 +31,6 @@
use core::vec;
use syntax::ast;
use syntax::codemap;
use syntax::codemap::span;
use syntax::print::pprust::{expr_to_str};
// Boxed vector types are in some sense currently a "shorthand" for a box
// containing an unboxed vector. This expands a boxed vector type into such an
-2
View File
@@ -14,14 +14,12 @@
use middle::trans::base;
use middle::trans::common::*;
use middle::trans::common;
use middle::trans::expr;
use middle::trans::machine;
use middle::ty;
use util::ppaux;
use core::option::None;
use core::vec;
use std::oldmap::HashMap;
use syntax::ast;
pub fn type_of_explicit_arg(ccx: @CrateContext, arg: ty::arg) -> TypeRef {

Some files were not shown because too many files have changed in this diff Show More