From 5a7249c935d52e79db2301a6cccfd28dff9bf38e Mon Sep 17 00:00:00 2001 From: Haitao Li Date: Fri, 11 Nov 2011 00:41:42 +0800 Subject: [PATCH] Cleanup unused imports --- src/comp/back/link.rs | 5 ---- src/comp/back/target_strs.rs | 4 +-- src/comp/back/upcall.rs | 8 +++--- src/comp/back/x86.rs | 3 --- src/comp/back/x86_64.rs | 3 --- src/comp/driver/rustc.rs | 10 +++---- src/comp/driver/session.rs | 2 +- src/comp/front/attr.rs | 3 +-- src/comp/front/test.rs | 2 +- src/comp/lib/llvm.rs | 6 ++--- src/comp/metadata/creader.rs | 4 +-- src/comp/metadata/decoder.rs | 2 -- src/comp/metadata/encoder.rs | 3 +-- src/comp/metadata/tydecode.rs | 2 +- src/comp/metadata/tyencode.rs | 3 +-- src/comp/middle/alias.rs | 4 +-- src/comp/middle/ast_map.rs | 1 - src/comp/middle/check_const.rs | 1 - src/comp/middle/fn_usage.rs | 2 +- src/comp/middle/freevars.rs | 3 +-- src/comp/middle/gc.rs | 6 ++--- src/comp/middle/kind.rs | 2 +- src/comp/middle/resolve.rs | 5 ++-- src/comp/middle/shape.rs | 8 +++--- src/comp/middle/trans.rs | 17 +++++------- src/comp/middle/trans_alt.rs | 6 ++--- src/comp/middle/trans_build.rs | 4 +-- src/comp/middle/trans_common.rs | 26 +++++-------------- src/comp/middle/trans_objects.rs | 2 +- src/comp/middle/trans_vec.rs | 7 +++-- src/comp/middle/tstate/annotate.rs | 10 +++---- src/comp/middle/tstate/auxiliary.rs | 17 +++++------- src/comp/middle/tstate/bitvectors.rs | 4 +-- src/comp/middle/tstate/ck.rs | 13 ++++------ src/comp/middle/tstate/collect_locals.rs | 2 -- src/comp/middle/tstate/pre_post_conditions.rs | 12 ++++----- src/comp/middle/tstate/states.rs | 12 +++------ src/comp/middle/ty.rs | 2 -- src/comp/middle/typeck.rs | 17 +++++------- src/comp/syntax/ext/base.rs | 2 +- src/comp/syntax/ext/env.rs | 2 +- src/comp/syntax/ext/expand.rs | 2 +- src/comp/syntax/ext/fmt.rs | 2 +- src/comp/syntax/ext/ident_to_str.rs | 2 +- src/comp/syntax/ext/log_syntax.rs | 2 +- src/comp/syntax/ext/simplext.rs | 7 +++-- src/comp/syntax/parse/eval.rs | 2 +- src/comp/syntax/parse/lexer.rs | 3 +-- src/comp/syntax/parse/parser.rs | 1 - src/comp/syntax/parse/token.rs | 4 +-- src/comp/syntax/print/pprust.rs | 3 +-- src/comp/syntax/util/interner.rs | 2 +- src/comp/util/common.rs | 12 +++------ src/comp/util/filesearch.rs | 4 +-- src/comp/util/ppaux.rs | 4 +-- src/fuzzer/fuzzer.rs | 4 +-- src/lib/comm.rs | 2 -- src/lib/either.rs | 2 -- src/lib/generic_os.rs | 1 - src/lib/io.rs | 1 - src/lib/test.rs | 1 - 61 files changed, 104 insertions(+), 204 deletions(-) diff --git a/src/comp/back/link.rs b/src/comp/back/link.rs index 05cd3ba6d36..b7e697686f5 100644 --- a/src/comp/back/link.rs +++ b/src/comp/back/link.rs @@ -7,23 +7,18 @@ import metadata::{encoder, cstore}; import middle::trans_common::crate_ctxt; import std::str; import std::fs; -import std::os; import std::vec; import std::option; import std::run; import option::some; import option::none; import std::sha1::sha1; -import std::sort; import syntax::ast; import syntax::print::pprust; import lib::llvm::llvm::ModuleRef; -import lib::llvm::llvm::ValueRef; import lib::llvm::mk_pass_manager; import lib::llvm::mk_target_data; -import lib::llvm::mk_type_names; import lib::llvm::False; -import lib::llvm::True; import util::filesearch; tag output_type { diff --git a/src/comp/back/target_strs.rs b/src/comp/back/target_strs.rs index c3f70d83dfc..50ae70c872b 100644 --- a/src/comp/back/target_strs.rs +++ b/src/comp/back/target_strs.rs @@ -1,9 +1,7 @@ -import std::str; - type t = { module_asm: str, meta_sect_name: str, data_layout: str, target_triple: str, gcc_args: [str] -}; \ No newline at end of file +}; diff --git a/src/comp/back/upcall.rs b/src/comp/back/upcall.rs index cda0dcd7f31..ca0b0ca1bff 100644 --- a/src/comp/back/upcall.rs +++ b/src/comp/back/upcall.rs @@ -1,11 +1,9 @@ -import std::str; import driver::session; import middle::trans; -import trans::decl_cdecl_fn; -import middle::trans_common::{T_f32, T_f64, T_fn, T_bool, T_i1, T_i8, T_i32, - T_i64, T_int, T_vec, T_nil, T_opaque_chan_ptr, - T_opaque_vec, T_opaque_port_ptr, T_ptr, +import middle::trans_common::{T_fn, T_i1, T_i8, T_i32, + T_i64, T_int, T_nil, + T_opaque_vec, T_ptr, T_size_t, T_void, T_float}; import lib::llvm::type_names; import lib::llvm::llvm::ModuleRef; diff --git a/src/comp/back/x86.rs b/src/comp/back/x86.rs index 0aff0604389..1674604828b 100644 --- a/src/comp/back/x86.rs +++ b/src/comp/back/x86.rs @@ -1,6 +1,3 @@ -import lib::llvm::llvm; -import lib::llvm::llvm::ModuleRef; -import std::str; import driver::session; fn get_target_strs(target_os: session::os) -> target_strs::t { diff --git a/src/comp/back/x86_64.rs b/src/comp/back/x86_64.rs index a668e3ee2f0..14b423224c0 100644 --- a/src/comp/back/x86_64.rs +++ b/src/comp/back/x86_64.rs @@ -1,6 +1,3 @@ -import lib::llvm::llvm; -import lib::llvm::llvm::ModuleRef; -import std::str; import driver::session; fn get_target_strs(target_os: session::os) -> target_strs::t { diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs index 0c12161661a..f86e2f44682 100644 --- a/src/comp/driver/rustc.rs +++ b/src/comp/driver/rustc.rs @@ -2,20 +2,16 @@ // -*- rust -*- import metadata::{creader, cstore}; -import syntax::parse::{parser, token}; +import syntax::parse::{parser}; import syntax::{ast, codemap}; import front::attr; import middle::{trans, resolve, freevars, kind, ty, typeck, fn_usage}; -import middle::tstate::ck; import syntax::print::{pp, pprust}; -import util::{ppaux, common, filesearch}; +import util::{ppaux, filesearch}; import back::link; -import lib::llvm; -import std::{fs, option, str, vec, int, io, run, getopts, result}; -import std::map::mk_hashmap; +import std::{option, str, vec, int, io, getopts, result}; import std::option::{some, none}; import std::getopts::{optopt, optmulti, optflag, optflagopt, opt_present}; -import back::link::output_type; import back::{x86, x86_64}; tag pp_mode { ppm_normal; ppm_expanded; ppm_typed; ppm_identified; } diff --git a/src/comp/driver/session.rs b/src/comp/driver/session.rs index e766b7eb030..b8282c970d2 100644 --- a/src/comp/driver/session.rs +++ b/src/comp/driver/session.rs @@ -3,7 +3,7 @@ import syntax::{ast, codemap}; import syntax::ast::node_id; import codemap::span; import syntax::ast::ty_mach; -import std::{uint, map, option, str}; +import std::{option}; import std::option::{some, none}; import syntax::parse::parser::parse_sess; import util::filesearch; diff --git a/src/comp/front/attr.rs b/src/comp/front/attr.rs index 61b3032abd2..34b1e5c430b 100644 --- a/src/comp/front/attr.rs +++ b/src/comp/front/attr.rs @@ -1,8 +1,7 @@ // Functions dealing with attributes and meta_items -import std::{vec, str, map, option}; +import std::{vec, map, option}; import syntax::{ast, ast_util}; -import util::common; import driver::session; export attr_meta; diff --git a/src/comp/front/test.rs b/src/comp/front/test.rs index 4008725b687..517b2169002 100644 --- a/src/comp/front/test.rs +++ b/src/comp/front/test.rs @@ -1,6 +1,6 @@ // Code that generates a test runner to run all the tests in a crate -import std::{option, vec, str}; +import std::{option, vec}; import syntax::{ast, ast_util}; import syntax::ast_util::*; //import syntax::ast_util::dummy_sp; diff --git a/src/comp/lib/llvm.rs b/src/comp/lib/llvm.rs index acf27fb2a81..f5b0fbeec8d 100644 --- a/src/comp/lib/llvm.rs +++ b/src/comp/lib/llvm.rs @@ -1,10 +1,8 @@ import std::{vec, str, option}; import std::str::sbuf; -import llvm::{ModuleRef, ContextRef, TypeRef, TypeHandleRef, ValueRef, - BasicBlockRef, BuilderRef, ModuleProviderRef, MemoryBufferRef, - PassManagerRef, UseRef, TargetDataRef, Linkage, Attribute, - Visibility, CallConv, IntPredicate, RealPredicate, Opcode, +import llvm::{TypeRef, MemoryBufferRef, + PassManagerRef, TargetDataRef, ObjectFileRef, SectionIteratorRef}; type ULongLong = u64; diff --git a/src/comp/metadata/creader.rs b/src/comp/metadata/creader.rs index 82dfb839354..95929b3449c 100644 --- a/src/comp/metadata/creader.rs +++ b/src/comp/metadata/creader.rs @@ -4,11 +4,9 @@ import driver::session; import syntax::{ast, ast_util}; import lib::llvm::{False, llvm, mk_object_file, mk_section_iter}; import front::attr; -import middle::resolve; import syntax::visit; import syntax::codemap::span; -import back::x86; -import util::{common, filesearch}; +import util::{filesearch}; import std::{vec, str, fs, io, option}; import std::option::{none, some}; import std::map::{hashmap, new_int_hash}; diff --git a/src/comp/metadata/decoder.rs b/src/comp/metadata/decoder.rs index 12ec6ed8860..5c98bda66ed 100644 --- a/src/comp/metadata/decoder.rs +++ b/src/comp/metadata/decoder.rs @@ -1,13 +1,11 @@ // Decoding metadata from a single crate's metadata import std::{ebml, vec, option, str, io}; -import std::map::hashmap; import syntax::{ast, ast_util}; import front::attr; import middle::ty; import common::*; import tydecode::{parse_def_id, parse_ty_data}; -import driver::session; import syntax::print::pprust; import cstore; diff --git a/src/comp/metadata/encoder.rs b/src/comp/metadata/encoder.rs index a62783f78da..ec4e57ae56b 100644 --- a/src/comp/metadata/encoder.rs +++ b/src/comp/metadata/encoder.rs @@ -1,7 +1,6 @@ // Metadata encoding -import std::{vec, str, uint, io, option, ebml, map}; -import std::option::{some, none}; +import std::{vec, str, uint, io, ebml, map}; import syntax::ast::*; import syntax::ast_util; import syntax::ast_util::local_def; diff --git a/src/comp/metadata/tydecode.rs b/src/comp/metadata/tydecode.rs index 156761eff4e..75e65607329 100644 --- a/src/comp/metadata/tydecode.rs +++ b/src/comp/metadata/tydecode.rs @@ -1,6 +1,6 @@ // Type decoding -import std::{vec, str, uint, option}; +import std::{vec, str, uint}; import std::option::{none, some}; import syntax::ast; import syntax::ast::*; diff --git a/src/comp/metadata/tyencode.rs b/src/comp/metadata/tyencode.rs index 15c0b4d9e29..92cf4d1b2fc 100644 --- a/src/comp/metadata/tyencode.rs +++ b/src/comp/metadata/tyencode.rs @@ -1,12 +1,11 @@ // Type encoding -import std::{str, io, int, uint}; +import std::{io, int, uint}; import std::map::hashmap; import std::option::{some, none}; import syntax::ast::*; import middle::ty; import syntax::print::pprust::*; -import util::common; export ctxt; export ty_abbrev; diff --git a/src/comp/middle/alias.rs b/src/comp/middle/alias.rs index 940ce38fa40..b02e6c8f6c2 100644 --- a/src/comp/middle/alias.rs +++ b/src/comp/middle/alias.rs @@ -1,10 +1,10 @@ import syntax::{ast, ast_util}; -import ast::{ident, fn_ident, node_id, def_id}; +import ast::{ident, fn_ident, node_id}; import syntax::codemap::span; import syntax::visit; import visit::vt; -import std::{vec, str, option}; +import std::{vec, option}; import std::option::{some, none, is_none}; // This is not an alias-analyser (though it would merit from becoming one, or diff --git a/src/comp/middle/ast_map.rs b/src/comp/middle/ast_map.rs index 29d4c173cf3..1ed720322f3 100644 --- a/src/comp/middle/ast_map.rs +++ b/src/comp/middle/ast_map.rs @@ -2,7 +2,6 @@ import std::{smallintmap, option}; import syntax::ast::*; import syntax::ast_util; import syntax::{visit, codemap}; -import visit::vt; tag ast_node { node_item(@item); diff --git a/src/comp/middle/check_const.rs b/src/comp/middle/check_const.rs index 59bfdadf62f..a3174204a60 100644 --- a/src/comp/middle/check_const.rs +++ b/src/comp/middle/check_const.rs @@ -1,5 +1,4 @@ import syntax::ast::*; -import syntax::ast_util::{variant_def_ids, dummy_sp}; import syntax::visit; fn check_crate(tcx: ty::ctxt, crate: @crate) { diff --git a/src/comp/middle/fn_usage.rs b/src/comp/middle/fn_usage.rs index e7c3033ce1f..0b022ad35ad 100644 --- a/src/comp/middle/fn_usage.rs +++ b/src/comp/middle/fn_usage.rs @@ -1,7 +1,7 @@ import syntax::ast; import syntax::visit; import std::option::some; -import syntax::print::pprust::{expr_to_str, path_to_str}; +import syntax::print::pprust::expr_to_str; export check_crate_fn_usage; diff --git a/src/comp/middle/freevars.rs b/src/comp/middle/freevars.rs index 0128b3aad98..6bf2dd4555f 100644 --- a/src/comp/middle/freevars.rs +++ b/src/comp/middle/freevars.rs @@ -1,11 +1,10 @@ // A pass that annotates for each loops and functions with the free // variables that they contain. -import std::{map, option, int, str}; +import std::{int}; import std::map::*; import std::option::*; import syntax::{ast, ast_util, visit}; -import driver::session; import middle::resolve; import syntax::codemap::span; diff --git a/src/comp/middle/gc.rs b/src/comp/middle/gc.rs index 833864a8e7a..8f77011b562 100644 --- a/src/comp/middle/gc.rs +++ b/src/comp/middle/gc.rs @@ -1,13 +1,13 @@ // Routines useful for garbage collection. -import lib::llvm::{True, False}; +import lib::llvm::True; import lib::llvm::llvm::ValueRef; import middle::trans; import middle::trans::{get_tydesc, tps_normal}; import middle::trans_common::*; import middle::ty; -import std::option::{some, none}; -import std::{ptr, str, unsafe, vec}; +import std::option::none; +import std::str; import lll = lib::llvm::llvm; import bld = trans_build; diff --git a/src/comp/middle/kind.rs b/src/comp/middle/kind.rs index e76c95b6560..b71fdc02430 100644 --- a/src/comp/middle/kind.rs +++ b/src/comp/middle/kind.rs @@ -85,7 +85,7 @@ */ import syntax::{ast, ast_util, visit, codemap}; -import std::{vec, option, str}; +import std::{vec, option}; import ast::{kind, kind_unique, kind_shared, kind_pinned}; fn kind_lteq(a: kind, b: kind) -> bool { diff --git a/src/comp/middle/resolve.rs b/src/comp/middle/resolve.rs index 501d675564a..aa5d5ebaaa4 100644 --- a/src/comp/middle/resolve.rs +++ b/src/comp/middle/resolve.rs @@ -2,17 +2,16 @@ import syntax::{ast, ast_util, codemap}; import syntax::ast::*; import ast::{ident, fn_ident, def, def_id, node_id}; -import syntax::ast_util::{local_def, respan}; +import syntax::ast_util::local_def; import metadata::{csearch, cstore}; import driver::session::session; import util::common::*; import std::map::{new_int_hash, new_str_hash}; import syntax::codemap::span; -import middle::ty::constr_table; import syntax::visit; import visit::vt; -import std::{vec, int, list, option, str}; +import std::{vec, list, option, str}; import std::map::hashmap; import std::list::{list, nil, cons}; import std::option::{some, none, is_none}; diff --git a/src/comp/middle/shape.rs b/src/comp/middle/shape.rs index 7c54bde66b3..42435d808f4 100644 --- a/src/comp/middle/shape.rs +++ b/src/comp/middle/shape.rs @@ -4,14 +4,12 @@ import lib::llvm::True; import lib::llvm::llvm::{ModuleRef, TypeRef, ValueRef}; import middle::{trans, trans_common}; -import middle::trans::llsize_of; -import middle::trans_common::{crate_ctxt, val_ty, C_bytes, C_int, - C_named_struct, C_struct, C_uint, T_i8, T_ptr}; +import middle::trans_common::{crate_ctxt, val_ty, C_bytes, + C_named_struct, C_struct}; import middle::ty; -import middle::ty::{field, mt}; +import middle::ty::field; import syntax::ast; import syntax::ast_util::dummy_sp; -import syntax::codemap::span; import syntax::util::interner; import util::common; diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index b98f7d528b1..8478061bc88 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -12,32 +12,29 @@ // pcwalton). You can, instead, find out its TypeRef by calling val_ty, // but many TypeRefs correspond to one ty::t; for instance, tup(int, int, // int) and rec(x=int, y=int, z=int) will have the same TypeRef. -import std::{int, str, uint, map, option, fs, time, vec}; +import std::{str, uint, map, option, time, vec}; import std::map::hashmap; import std::map::{new_int_hash, new_str_hash}; import std::option::{some, none}; import driver::session; import middle::{ty, gc}; import middle::freevars::*; -import back::{link, x86, abi, upcall}; +import back::{link, abi, upcall}; import syntax::{ast, ast_util}; import syntax::visit; import syntax::codemap::span; -import syntax::print::pprust::{expr_to_str, path_to_str}; +import syntax::print::pprust::{expr_to_str}; import visit::vt; -import util::common; import util::common::*; -import lib::llvm::{llvm, target_data, type_names, - mk_target_data, mk_type_names}; -import lib::llvm::llvm::{ModuleRef, ValueRef, TypeRef, TypeHandleRef, - BuilderRef, BasicBlockRef}; -import lib::llvm::{Bool, True, False}; +import lib::llvm::{llvm, mk_target_data, mk_type_names}; +import lib::llvm::llvm::{ModuleRef, ValueRef, TypeRef, BasicBlockRef}; +import lib::llvm::{True, False}; import link::{mangle_internal_name_by_type_only, mangle_internal_name_by_seq, mangle_internal_name_by_path, mangle_internal_name_by_path_and_seq, mangle_exported_name}; -import metadata::{creader, csearch, cstore}; +import metadata::{csearch, cstore}; import util::ppaux::{ty_to_str, ty_to_short_str}; import trans_common::*; diff --git a/src/comp/middle/trans_alt.rs b/src/comp/middle/trans_alt.rs index 9990e9dbfef..319d6d00d83 100644 --- a/src/comp/middle/trans_alt.rs +++ b/src/comp/middle/trans_alt.rs @@ -1,12 +1,10 @@ -import std::{str, vec, option, int}; +import std::{str, vec, option}; import option::{some, none}; -import std::map::hashmap; import lib::llvm::llvm; -import lib::llvm::llvm::{ValueRef, TypeRef, BasicBlockRef}; +import lib::llvm::llvm::{ValueRef, BasicBlockRef}; import trans_build::*; import trans::{new_sub_block_ctxt, new_scope_block_ctxt, load_if_immediate}; -import ty::pat_ty; import syntax::ast; import syntax::ast_util; import syntax::ast_util::dummy_sp; diff --git a/src/comp/middle/trans_build.rs b/src/comp/middle/trans_build.rs index fbc96d5c21d..e888b00fa3a 100644 --- a/src/comp/middle/trans_build.rs +++ b/src/comp/middle/trans_build.rs @@ -3,8 +3,8 @@ import std::str::sbuf; import lib::llvm::llvm; import llvm::{ValueRef, TypeRef, BasicBlockRef, BuilderRef, Opcode, ModuleRef}; -import trans_common::{block_ctxt, T_ptr, T_nil, T_int, T_i8, T_i1, - val_ty, val_str, bcx_ccx, C_i32}; +import trans_common::{block_ctxt, T_ptr, T_nil, T_i8, T_i1, + val_ty, C_i32}; fn B(cx: @block_ctxt) -> BuilderRef { let b = *cx.fcx.lcx.ccx.builder; diff --git a/src/comp/middle/trans_common.rs b/src/comp/middle/trans_common.rs index 8580f53a624..f89d1dd930d 100644 --- a/src/comp/middle/trans_common.rs +++ b/src/comp/middle/trans_common.rs @@ -3,34 +3,20 @@ */ -import std::{int, vec, str, uint, map, option, fs, unsafe}; +import std::{int, vec, str, uint, option, unsafe}; import std::vec::to_ptr; import std::map::hashmap; -import std::option::{some, none}; +import std::option::some; import syntax::ast; import driver::session; import middle::ty; -import back::{link, x86, abi, upcall}; -import syntax::visit; -import visit::vt; -import util::common; +import back::{link, abi, upcall}; import util::common::*; -import std::map::{new_int_hash, new_str_hash}; import syntax::codemap::span; -import lib::llvm::{llvm, target_data, type_names, - mk_target_data, mk_type_names}; -import lib::llvm::llvm::{ModuleRef, ValueRef, TypeRef, TypeHandleRef, - BuilderRef, BasicBlockRef}; +import lib::llvm::{llvm, target_data, type_names}; +import lib::llvm::llvm::{ModuleRef, ValueRef, TypeRef, BasicBlockRef}; import lib::llvm::{True, False, Bool}; -import link::{mangle_internal_name_by_type_only, - mangle_internal_name_by_seq, - mangle_internal_name_by_path, - mangle_internal_name_by_path_and_seq, - mangle_exported_name}; -import metadata::{creader, csearch, cstore}; -import util::ppaux::{ty_to_str, ty_to_short_str}; -import syntax::print::pprust::{expr_to_str, path_to_str}; -import bld = trans_build; +import metadata::{csearch}; // FIXME: These should probably be pulled in here too. import trans::{type_of_fn, drop_ty}; diff --git a/src/comp/middle/trans_objects.rs b/src/comp/middle/trans_objects.rs index 73fed9205ac..399af0a61da 100644 --- a/src/comp/middle/trans_objects.rs +++ b/src/comp/middle/trans_objects.rs @@ -3,7 +3,7 @@ import std::{str, option, vec}; import option::{none, some}; -import lib::llvm::{llvm, Bool, True}; +import lib::llvm::{llvm, True}; import lib::llvm::llvm::{TypeRef, ValueRef}; import back::abi; diff --git a/src/comp/middle/trans_vec.rs b/src/comp/middle/trans_vec.rs index b63aee9ae1d..607e0567f40 100644 --- a/src/comp/middle/trans_vec.rs +++ b/src/comp/middle/trans_vec.rs @@ -4,11 +4,10 @@ import syntax::ast; import lib::llvm::llvm::{ValueRef, TypeRef}; import back::abi; import trans::{call_memmove, trans_shared_malloc, llsize_of, type_of_or_i8, - INIT, copy_val, load_if_immediate, alloca, size_of, - llderivedtydescs_block_ctxt, lazily_emit_tydesc_glue, - get_tydesc, load_inbounds, + INIT, copy_val, load_if_immediate, size_of, + get_tydesc, node_id_type, new_sub_block_ctxt, tps_normal, do_spill_noroot, - alloc_ty, dest}; + dest}; import trans_build::*; import trans_common::*; diff --git a/src/comp/middle/tstate/annotate.rs b/src/comp/middle/tstate/annotate.rs index cb97511c578..7eb317fdde1 100644 --- a/src/comp/middle/tstate/annotate.rs +++ b/src/comp/middle/tstate/annotate.rs @@ -1,15 +1,11 @@ -import std::{int, uint, str, option}; -import std::option::{some, none}; +import std::{int, uint}; import syntax::ast::*; import syntax::ast_util::pat_binding_ids; import syntax::visit; import syntax::codemap::span; -import std::map::new_str_hash; -import util::common::{log_expr_err, log_block_err, log_item_err, - log_stmt_err, log_expr, log_block, log_stmt}; -import aux::{fn_info, fn_info_map, num_constraints, get_fn_info, - crate_ctxt, add_node}; +import util::common::{log_stmt}; +import aux::{num_constraints, get_fn_info, crate_ctxt, add_node}; import middle::tstate::ann::empty_ann; fn collect_ids_expr(e: @expr, rs: @mutable [node_id]) { *rs += [e.id]; } diff --git a/src/comp/middle/tstate/auxiliary.rs b/src/comp/middle/tstate/auxiliary.rs index b8544e2b5ad..b4d22fcb118 100644 --- a/src/comp/middle/tstate/auxiliary.rs +++ b/src/comp/middle/tstate/auxiliary.rs @@ -1,26 +1,23 @@ -import std::{vec, int, uint, str, option}; +import std::{vec, int, uint, option}; import std::option::*; import syntax::ast::*; import syntax::ast_util::*; import syntax::codemap::span; import syntax::visit; -import util::common; -import util::common::log_block; -import std::map::{new_int_hash, new_uint_hash}; -import util::common::{log_expr_err, lit_eq}; +import std::map::{new_int_hash}; +import util::common::{lit_eq}; import syntax::print::pprust::path_to_str; import tstate::ann::{pre_and_post, pre_and_post_state, empty_ann, prestate, - poststate, precond, postcond, empty_states, pps_len, + poststate, precond, postcond, set_prestate, set_poststate, set_in_poststate_, extend_prestate, extend_poststate, set_precondition, - set_postcondition, set_in_postcond_, ts_ann, + set_postcondition, ts_ann, clear_in_postcond, - clear_in_poststate, clear_in_poststate_}; + clear_in_poststate_}; import tritv::*; import bitvectors::promises_; -import syntax::print::pprust::{constr_args_to_str, constr_arg_to_str, - lit_to_str}; +import syntax::print::pprust::{constr_args_to_str, lit_to_str}; // Used to communicate which operands should be invalidated // to helper functions diff --git a/src/comp/middle/tstate/bitvectors.rs b/src/comp/middle/tstate/bitvectors.rs index 9a0b1059bf2..c97f336fab9 100644 --- a/src/comp/middle/tstate/bitvectors.rs +++ b/src/comp/middle/tstate/bitvectors.rs @@ -5,8 +5,8 @@ import std::option::*; import aux::*; import tstate::ann::{pre_and_post, precond, postcond, prestate, poststate, relax_prestate, relax_precond, relax_poststate, - pps_len, true_precond, empty_prestate, - difference, union, intersect, clone, + pps_len, true_precond, + difference, union, clone, set_in_postcond, set_in_poststate, set_in_poststate_, clear_in_poststate, clear_in_prestate, clear_in_poststate_}; diff --git a/src/comp/middle/tstate/ck.rs b/src/comp/middle/tstate/ck.rs index 42bfe2f4db9..22bec5c7d8f 100644 --- a/src/comp/middle/tstate/ck.rs +++ b/src/comp/middle/tstate/ck.rs @@ -1,20 +1,17 @@ import syntax::ast; -import ast::{method, item, item_fn, _fn, obj_field, _obj, stmt, ident, - fn_ident, node_id, def_id, ty_param, crate, return_val, noreturn, +import ast::{_fn, stmt, + fn_ident, node_id, crate, return_val, noreturn, expr}; -import syntax::ast_util::local_def; import syntax::visit; import syntax::codemap::span; import middle::ty::{type_is_nil, ret_ty_of_fn}; -import tstate::ann::{ts_ann, empty_poststate, true_precond, true_postcond, - false_postcond, precond, postcond, poststate, prestate, +import tstate::ann::{ + precond, prestate, implies, ann_precond, ann_prestate}; -import std::{str, option}; -import std::option::{t, some, none}; +import std::{option}; import aux::*; import syntax::print::pprust::ty_to_str; -import util::common::log_stmt_err; import bitvectors::*; import annotate::annotate_crate; import collect_locals::mk_f_to_fn_info; diff --git a/src/comp/middle/tstate/collect_locals.rs b/src/comp/middle/tstate/collect_locals.rs index b3c8d71a3bf..ad25e7c59c8 100644 --- a/src/comp/middle/tstate/collect_locals.rs +++ b/src/comp/middle/tstate/collect_locals.rs @@ -1,11 +1,9 @@ -import std::{str, uint, int, vec}; import syntax::ast::*; import syntax::ast_util::*; import util::ppaux::fn_ident_to_string; import std::option::*; import syntax::visit; import aux::*; -import std::map::new_int_hash; import util::common::new_def_hash; import syntax::codemap::span; import syntax::ast_util::respan; diff --git a/src/comp/middle/tstate/pre_post_conditions.rs b/src/comp/middle/tstate/pre_post_conditions.rs index d0832142d3e..70fb32e5f11 100644 --- a/src/comp/middle/tstate/pre_post_conditions.rs +++ b/src/comp/middle/tstate/pre_post_conditions.rs @@ -1,20 +1,18 @@ -import std::{vec, str, option}; +import std::{vec, option}; import std::option::{none, some}; import tstate::ann::*; import aux::*; -import bitvectors::{bit_num, promises, seq_preconds, seq_postconds, - intersect_states, declare_var, gen_poststate, +import bitvectors::{bit_num, seq_preconds, seq_postconds, + intersect_states, relax_precond_block, gen}; import tritv::*; import syntax::ast::*; import syntax::ast_util::*; import syntax::visit; -import std::map::new_int_hash; -import util::common::{new_def_hash, log_expr, log_fn, field_exprs, - has_nonlocal_exits, log_stmt, log_stmt_err, - log_expr_err, log_block_err, log_block}; +import util::common::{new_def_hash, log_expr, field_exprs, + has_nonlocal_exits, log_stmt}; import syntax::codemap::span; import util::ppaux::fn_ident_to_string; diff --git a/src/comp/middle/tstate/states.rs b/src/comp/middle/tstate/states.rs index 2af37f22867..786df5facdc 100644 --- a/src/comp/middle/tstate/states.rs +++ b/src/comp/middle/tstate/states.rs @@ -1,7 +1,5 @@ -import syntax::print::pprust::path_to_str; -import util::ppaux::ty_to_str; -import std::{vec, str, option}; -import std::option::{get, is_none, none, some, maybe}; +import std::{vec, option}; +import std::option::{none, some}; import ann::*; import aux::*; import tritv::{tritv_clone, tritv_set, ttrue}; @@ -10,10 +8,8 @@ import bitvectors::*; import syntax::ast::*; import syntax::ast_util::*; import syntax::codemap::span; -import middle::ty::{expr_ty, type_is_nil, type_is_bot}; -import util::common::{new_def_hash, log_expr, log_block, log_block_err, - log_fn, field_exprs, has_nonlocal_exits, log_stmt, - log_stmt_err, log_expr_err}; +import middle::ty::{expr_ty, type_is_bot}; +import util::common::{field_exprs, has_nonlocal_exits}; fn forbid_upvar(fcx: fn_ctxt, rhs_id: node_id, sp: span, t: oper_type) { alt t { diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index fbfff0f7941..d20544e48e8 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -1,8 +1,6 @@ -import std::int; import std::vec; import std::str; import std::uint; -import std::box; import std::ufind; import std::map; import std::map::hashmap; diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs index e61a50c235e..fabd2b069bd 100644 --- a/src/comp/middle/typeck.rs +++ b/src/comp/middle/typeck.rs @@ -1,23 +1,20 @@ import syntax::{ast, ast_util}; -import ast::{mutability, spanned}; +import ast::spanned; import syntax::ast_util::{local_def, respan, ty_param_kind}; import syntax::visit; import metadata::csearch; import driver::session; -import util::common; import util::common::*; import syntax::codemap::span; import middle::ty; import middle::ty::{node_id_to_type, arg, bind_params_in_type, block_ty, - expr_ty, field, method, node_type_table, pat_ty, - ty_param_substs_opt_and_ty, ty_param_kinds_and_ty, - ty_nil}; + expr_ty, field, node_type_table, + ty_param_substs_opt_and_ty, ty_param_kinds_and_ty}; import util::ppaux::ty_to_str; -import middle::ty::unify::{ures_ok, ures_err, fixup_result, fix_ok, fix_err}; -import std::{int, vec, str, uint, map, option, smallintmap}; -import std::map::{hashmap, new_int_hash, new_str_hash}; -import std::option::{none, some, from_maybe}; -import middle::tstate::ann::ts_ann; +import middle::ty::unify::{ures_ok, ures_err, fix_ok, fix_err}; +import std::{int, vec, str, option, smallintmap}; +import std::map::{hashmap, new_int_hash}; +import std::option::{none, some}; import syntax::print::pprust::*; export check_crate; diff --git a/src/comp/syntax/ext/base.rs b/src/comp/syntax/ext/base.rs index fb3b7caa3ca..0fc352ac8be 100644 --- a/src/comp/syntax/ext/base.rs +++ b/src/comp/syntax/ext/base.rs @@ -1,4 +1,4 @@ -import std::{str, vec, option}; +import std::{vec, option}; import std::map::hashmap; import driver::session::session; import codemap::span; diff --git a/src/comp/syntax/ext/env.rs b/src/comp/syntax/ext/env.rs index 68b2ea87148..f017f7e6574 100644 --- a/src/comp/syntax/ext/env.rs +++ b/src/comp/syntax/ext/env.rs @@ -4,7 +4,7 @@ * should all get sucked into either the compiler syntax extension plugin * interface. */ -import std::{vec, str, option, generic_os}; +import std::{vec, option, generic_os}; import base::*; export expand_syntax_ext; diff --git a/src/comp/syntax/ext/expand.rs b/src/comp/syntax/ext/expand.rs index 81a50d2f0b7..a602ab49309 100644 --- a/src/comp/syntax/ext/expand.rs +++ b/src/comp/syntax/ext/expand.rs @@ -3,7 +3,7 @@ import driver::session; import std::option::{none, some}; import std::map::hashmap; -import std::{vec, str}; +import std::{vec}; import syntax::ast::{crate, expr_, expr_mac, mac_invoc}; import syntax::fold::*; diff --git a/src/comp/syntax/ext/fmt.rs b/src/comp/syntax/ext/fmt.rs index 575d49e15a6..b49f958a4d6 100644 --- a/src/comp/syntax/ext/fmt.rs +++ b/src/comp/syntax/ext/fmt.rs @@ -6,7 +6,7 @@ * compiler syntax extension plugin interface. */ import std::{vec, str, option}; -import std::option::{none, some}; +import std::option::{some}; import std::extfmt::ct::*; import base::*; import codemap::span; diff --git a/src/comp/syntax/ext/ident_to_str.rs b/src/comp/syntax/ext/ident_to_str.rs index e6e4f4e794e..5a08399da49 100644 --- a/src/comp/syntax/ext/ident_to_str.rs +++ b/src/comp/syntax/ext/ident_to_str.rs @@ -1,4 +1,4 @@ -import std::{vec, str, option}; +import std::{vec, option}; import base::*; import syntax::ast; diff --git a/src/comp/syntax/ext/log_syntax.rs b/src/comp/syntax/ext/log_syntax.rs index 4cda6b82f5b..67b92913602 100644 --- a/src/comp/syntax/ext/log_syntax.rs +++ b/src/comp/syntax/ext/log_syntax.rs @@ -1,4 +1,4 @@ -import std::{str, option}; +import std::{option}; import base::*; import syntax::ast; diff --git a/src/comp/syntax/ext/simplext.rs b/src/comp/syntax/ext/simplext.rs index 3adcfbccf4e..6a2a87de52c 100644 --- a/src/comp/syntax/ext/simplext.rs +++ b/src/comp/syntax/ext/simplext.rs @@ -1,16 +1,15 @@ use std; import codemap::span; -import std::{vec, str, option}; +import std::{vec, option}; import std::map::{hashmap, new_str_hash}; import option::{some, none}; -import base::{syntax_extension, ext_ctxt, normal, - expr_to_str, expr_to_ident}; +import base::{ext_ctxt, normal}; import fold::*; import ast_util::respan; -import ast::{ident, path, ty, blk, blk_, expr, expr_, path_, expr_path, +import ast::{ident, path, ty, blk_, expr, path_, expr_path, expr_vec, expr_mac, mac_invoc, node_id}; export add_new_extension; diff --git a/src/comp/syntax/parse/eval.rs b/src/comp/syntax/parse/eval.rs index e4b60c4c21e..03c65d79e75 100644 --- a/src/comp/syntax/parse/eval.rs +++ b/src/comp/syntax/parse/eval.rs @@ -1,5 +1,5 @@ -import std::{str, option, result, io, fs}; +import std::{option, result, io, fs}; import std::option::{some, none}; import syntax::ast; import syntax::parse::token; diff --git a/src/comp/syntax/parse/lexer.rs b/src/comp/syntax/parse/lexer.rs index 685b93941b9..df9683f6a93 100644 --- a/src/comp/syntax/parse/lexer.rs +++ b/src/comp/syntax/parse/lexer.rs @@ -1,6 +1,5 @@ -import std::{io, int, vec, str, map, option}; -import std::map::hashmap; +import std::{io, vec, str, option}; import std::option::{some, none}; import util::interner; import util::interner::intern; diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 214955b14a0..4fa5baa7af4 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -4,7 +4,6 @@ import std::option::{some, none}; import std::either::{left, right}; import std::map::{hashmap, new_str_hash}; import token::can_begin_expr; -import ex = ext::base; import codemap::span; import util::interner; import ast::{node_id, spanned}; diff --git a/src/comp/syntax/parse/token.rs b/src/comp/syntax/parse/token.rs index c89d99f0baf..ee02e24c7a8 100644 --- a/src/comp/syntax/parse/token.rs +++ b/src/comp/syntax/parse/token.rs @@ -1,10 +1,8 @@ import ast::ty_mach; import ast_util::ty_mach_to_str; -import std::map::new_str_hash; import util::interner; -import std::{int, uint, str, option}; -import option::{some, none}; +import std::{int, uint, str}; type str_num = uint; diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs index 4570b56cba9..d45c8a8a43a 100644 --- a/src/comp/syntax/print/pprust.rs +++ b/src/comp/syntax/print/pprust.rs @@ -2,11 +2,10 @@ import std::{vec, int, io, str, uint, option}; import parse::lexer; import syntax::codemap::codemap; -import syntax::visit; import ast; import ast_util; import option::{some, none}; -import pp::{printer, break_offset, word, huge_word, zero_word, +import pp::{break_offset, word, space, zerobreak, hardbreak, breaks, consistent, inconsistent, eof}; diff --git a/src/comp/syntax/util/interner.rs b/src/comp/syntax/util/interner.rs index dea86723af3..c814f168a4a 100644 --- a/src/comp/syntax/util/interner.rs +++ b/src/comp/syntax/util/interner.rs @@ -1,7 +1,7 @@ // An "interner" is a data structure that associates values with uint tags and // allows bidirectional lookup; i.e. given a value, one can easily find the // type, and vice versa. -import std::{vec, map, option}; +import std::{vec, map}; import std::map::{hashmap, hashfn, eqfn}; import std::option::{none, some}; diff --git a/src/comp/util/common.rs b/src/comp/util/common.rs index 2eb717f5109..99275d336d0 100644 --- a/src/comp/util/common.rs +++ b/src/comp/util/common.rs @@ -1,16 +1,12 @@ -import std::{str, map, uint, int, option}; +import std::{str, option}; import std::math::{max, min}; import std::map::hashmap; -import std::option::{none, some}; +import std::option::{some}; import syntax::ast; -import ast::{ty, pat, lit, path}; -import syntax::codemap::{codemap, span}; +import ast::{ty, pat}; +import syntax::codemap::{span}; import syntax::visit; -import std::io::{stdout, str_writer, string_writer}; import syntax::print; -import print::pprust::{print_block, print_item, print_expr, print_path, - print_decl, print_fn, print_type, print_literal}; -import print::pp::mk_printer; type flag = hashmap; diff --git a/src/comp/util/filesearch.rs b/src/comp/util/filesearch.rs index a619d7e6884..5e51f6c6840 100644 --- a/src/comp/util/filesearch.rs +++ b/src/comp/util/filesearch.rs @@ -5,9 +5,7 @@ import std::option; import std::fs; import std::vec; -import std::str; import std::os; -import back::link; export filesearch; export mk_filesearch; @@ -100,4 +98,4 @@ fn get_sysroot(maybe_sysroot: option::t) -> fs::path { option::some(sr) { sr } option::none. { get_default_sysroot() } } -} \ No newline at end of file +} diff --git a/src/comp/util/ppaux.rs b/src/comp/util/ppaux.rs index d18a91f0d00..b148b99cde8 100644 --- a/src/comp/util/ppaux.rs +++ b/src/comp/util/ppaux.rs @@ -3,13 +3,11 @@ import std::option::{none, some}; import middle::ty; import middle::ty::*; import metadata::encoder; -import syntax::print::{pp, pprust}; +import syntax::print::pprust; import syntax::print::pprust::{path_to_str, constr_args_to_str, proto_to_str}; -import pp::{word, eof, zerobreak, hardbreak}; import syntax::ast_util::ty_mach_to_str; import syntax::ast; import middle::ast_map; -import metadata::csearch; fn mode_str(m: ty::mode) -> str { alt m { diff --git a/src/fuzzer/fuzzer.rs b/src/fuzzer/fuzzer.rs index 480b45ae6b4..387036b76a3 100644 --- a/src/fuzzer/fuzzer.rs +++ b/src/fuzzer/fuzzer.rs @@ -1,6 +1,4 @@ -import std::{fs, io, getopts, math, vec, str, int, uint, option, result}; -import std::getopts::{optopt, opt_present, opt_str}; -import std::io::stdout; +import std::{fs, io, math, vec, str, int, uint, option, result}; import rustc::syntax::{ast, ast_util, fold, visit, codemap}; import rustc::syntax::parse::parser; diff --git a/src/lib/comm.rs b/src/lib/comm.rs index 4aa66ed28fc..841afaa9797 100644 --- a/src/lib/comm.rs +++ b/src/lib/comm.rs @@ -27,8 +27,6 @@ Example: */ import sys; -import ptr; -import unsafe; import task; export send; diff --git a/src/lib/either.rs b/src/lib/either.rs index a6774144599..c65373a8813 100644 --- a/src/lib/either.rs +++ b/src/lib/either.rs @@ -4,8 +4,6 @@ Module: either A type that represents one of two alternatives */ -import option; -import option::{some, none}; /* Tag: t diff --git a/src/lib/generic_os.rs b/src/lib/generic_os.rs index ebb157c621c..09b23694e2f 100644 --- a/src/lib/generic_os.rs +++ b/src/lib/generic_os.rs @@ -6,7 +6,6 @@ Some miscellaneous platform functions. These should be rolled into another module. */ -import str::sbuf; // Wow, this is an ugly way to write doc comments diff --git a/src/lib/io.rs b/src/lib/io.rs index a975f3490fe..016c6381a7d 100644 --- a/src/lib/io.rs +++ b/src/lib/io.rs @@ -1,4 +1,3 @@ -import os::libc; native "cdecl" mod rustrt { fn rust_get_stdin() -> os::libc::FILE; diff --git a/src/lib/test.rs b/src/lib/test.rs index e14ad433752..daa86bb8b40 100644 --- a/src/lib/test.rs +++ b/src/lib/test.rs @@ -3,7 +3,6 @@ // simplest interface possible for representing and running tests // while providing a base that other test frameworks may build off of. -import generic_os::getenv; import task::task; export test_name;