Convert 'import' to 'use'. Remove 'import' keyword.

This commit is contained in:
Brian Anderson
2012-09-07 18:08:21 -07:00
parent 1a8a0a77b1
commit 298eb8c726
78 changed files with 192 additions and 232 deletions

View File

@@ -296,7 +296,7 @@ fn building_library(req_crate_type: crate_type, crate: @ast::crate,
}
fn sess_os_to_meta_os(os: os) -> metadata::loader::os {
import metadata::loader;
use metadata::loader;
match os {
os_win32 => loader::os_win32,
@@ -308,7 +308,7 @@ fn sess_os_to_meta_os(os: os) -> metadata::loader::os {
#[cfg(test)]
mod test {
import syntax::ast_util;
use syntax::ast_util;
fn make_crate_type_attr(t: ~str) -> ast::attribute {
ast_util::respan(ast_util::dummy_sp(), {

View File

@@ -3,10 +3,8 @@
// no dependencies on rustc it can move into its own crate.
mod middle {
import ty = middle_::ty;
export ty;
import resolve = middle_::resolve;
export resolve;
pub use middle_::ty;
pub use middle_::resolve;
}
mod front {
@@ -19,11 +17,9 @@ mod driver {
}
mod util {
import ppaux = util_::ppaux;
export ppaux;
pub use util_::ppaux;
}
mod lib {
import llvm = lib_::llvm;
export llvm;
pub use lib_::llvm;
}

View File

@@ -55,7 +55,7 @@ fn dump_crates(crate_cache: DVec<cache_entry>) {
fn warn_if_multiple_versions(e: env, diag: span_handler,
crate_cache: ~[cache_entry]) {
import either::*;
use either::*;
if crate_cache.len() != 0u {
let name = loader::crate_name_from_metas(*crate_cache.last().metas);

View File

@@ -206,7 +206,7 @@ impl const_val: cmp::Eq {
// FIXME: issue #1417
fn eval_const_expr(tcx: middle::ty::ctxt, e: @expr) -> const_val {
import middle::ty;
use middle::ty;
fn fromb(b: bool) -> const_val { const_int(b as i64) }
match e.node {
expr_unary(neg, inner) => {

View File

@@ -1220,7 +1220,7 @@ fn with_scope_datumblock(bcx: block, opt_node_info: Option<node_info>,
name: ~str, f: fn(block) -> datum::DatumBlock)
-> datum::DatumBlock
{
import datum::DatumBlock;
use datum::DatumBlock;
let _icx = bcx.insn_ctxt("with_scope_result");
let scope_cx = scope_block(bcx, opt_node_info, name);

View File

@@ -293,7 +293,7 @@ impl reflector {
fn emit_calls_to_trait_visit_ty(bcx: block, t: ty::t,
visitor_val: ValueRef,
visitor_trait_id: def_id) -> block {
import syntax::parse::token::special_idents::tydesc;
use syntax::parse::token::special_idents::tydesc;
let final = sub_block(bcx, ~"final");
assert bcx.ccx().tcx.intrinsic_defs.contains_key(tydesc);
let (_, tydesc_ty) = bcx.ccx().tcx.intrinsic_defs.get(tydesc);