From 298eb8c7260fe321e30d9c5e22f4ecefc82c4f64 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 7 Sep 2012 18:08:21 -0700 Subject: [PATCH] Convert 'import' to 'use'. Remove 'import' keyword. --- src/compiletest/common.rs | 2 - src/compiletest/compiletest.rc | 2 +- src/compiletest/compiletest.rs | 26 +++--- src/compiletest/errors.rs | 4 +- src/compiletest/header.rs | 7 +- src/compiletest/procsrv.rs | 6 +- src/compiletest/runtest.rs | 18 ++--- src/compiletest/util.rs | 5 +- src/libcore/core.rc | 6 +- src/libcore/core.rs | 2 +- src/libcore/gc.rs | 8 +- src/libcore/int-template.rs | 6 +- src/libcore/libc.rs | 2 +- src/libcore/os.rs | 79 +++++++++---------- src/libcore/ptr.rs | 4 +- src/libcore/rt.rs | 2 +- src/libcore/run.rs | 4 +- src/libcore/send_map.rs | 2 +- src/libcore/str.rs | 2 +- src/libcore/uint-template.rs | 4 +- src/libstd/arc.rs | 2 +- src/libstd/c_vec.rs | 2 +- src/libstd/getopts.rs | 4 +- src/libstd/net_url.rs | 2 +- src/libstd/time.rs | 1 - src/libstd/timer.rs | 2 +- src/libsyntax/ext/auto_serialize.rs | 6 +- src/libsyntax/ext/base.rs | 6 +- src/libsyntax/ext/pipes/ast_builder.rs | 6 +- src/libsyntax/ext/pipes/pipec.rs | 8 +- src/libsyntax/parse/parser.rs | 12 --- src/libsyntax/parse/token.rs | 4 +- src/libsyntax/print/pprust.rs | 2 +- src/rustc/driver/session.rs | 4 +- src/rustc/metadata.rs | 12 +-- src/rustc/metadata/creader.rs | 2 +- src/rustc/middle/const_eval.rs | 2 +- src/rustc/middle/trans/base.rs | 2 +- src/rustc/middle/trans/reflect.rs | 2 +- src/rustdoc/astsrv.rs | 4 +- src/rustdoc/attr_parser.rs | 10 +-- src/rustdoc/config.rs | 2 +- src/rustdoc/markdown_writer.rs | 4 +- src/rustdoc/prune_hidden_pass.rs | 2 +- src/rustdoc/rustdoc.rc | 4 +- src/test/bench/pingpong.rs | 4 +- src/test/bench/shootout-threadring.rs | 2 +- src/test/compile-fail/import-glob-circular.rs | 6 +- src/test/compile-fail/issue-2611-3.rs | 3 +- src/test/compile-fail/issue-2611-4.rs | 3 +- src/test/compile-fail/issue-2611-5.rs | 3 +- src/test/compile-fail/issue-2848.rs | 2 +- .../compile-fail/regions-glb-free-free.rs | 2 +- src/test/compile-fail/unused-imports-warn.rs | 4 +- .../run-pass/export-glob-imports-target.rs | 2 +- src/test/run-pass/export-glob.rs | 2 +- src/test/run-pass/hashmap-memory.rs | 1 - src/test/run-pass/import-from-foreign.rs | 2 +- src/test/run-pass/import-glob-1.rs | 6 +- src/test/run-pass/import-in-block.rs | 5 +- src/test/run-pass/import.rs | 4 +- src/test/run-pass/import5.rs | 2 +- src/test/run-pass/import6.rs | 2 +- src/test/run-pass/import7.rs | 2 +- src/test/run-pass/issue-2718.rs | 2 +- src/test/run-pass/mod-view-items.rs | 3 +- src/test/run-pass/module-polymorphism.rc | 6 +- src/test/run-pass/module-polymorphism2.rc | 12 +-- src/test/run-pass/module-polymorphism3.rc | 6 +- src/test/run-pass/module-polymorphism4.rc | 4 +- src/test/run-pass/pipe-bank-proto.rs | 4 +- src/test/run-pass/pipe-pingpong-bounded.rs | 10 +-- src/test/run-pass/pipe-pingpong-proto.rs | 8 +- src/test/run-pass/pipe-select-macro.rs | 2 +- src/test/run-pass/pipe-select.rs | 4 +- src/test/run-pass/pipe-sleep.rs | 2 +- src/test/run-pass/self-shadowing-import.rs | 2 +- src/test/run-pass/use.rs | 4 +- 78 files changed, 192 insertions(+), 232 deletions(-) diff --git a/src/compiletest/common.rs b/src/compiletest/common.rs index 5a8b98cd857..a9f50492f2b 100644 --- a/src/compiletest/common.rs +++ b/src/compiletest/common.rs @@ -1,5 +1,3 @@ -import option; - enum mode { mode_compile_fail, mode_run_fail, mode_run_pass, mode_pretty, } impl mode : cmp::Eq { diff --git a/src/compiletest/compiletest.rc b/src/compiletest/compiletest.rc index 685f2009e26..201edcb0f26 100644 --- a/src/compiletest/compiletest.rc +++ b/src/compiletest/compiletest.rc @@ -7,7 +7,7 @@ use core(vers = "0.4"); use std(vers = "0.4"); -import core::*; +use core::*; mod procsrv; mod util; diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs index 121cf9df669..4b24c5fd295 100644 --- a/src/compiletest/compiletest.rs +++ b/src/compiletest/compiletest.rs @@ -1,20 +1,16 @@ -import option; -import std::getopts; -import std::test; -import str; -import vec; -import task; +use std::getopts; +use std::test; -import core::result; -import result::{Ok, Err}; +use core::result; +use result::{Ok, Err}; -import common::config; -import common::mode_run_pass; -import common::mode_run_fail; -import common::mode_compile_fail; -import common::mode_pretty; -import common::mode; -import util::logv; +use common::config; +use common::mode_run_pass; +use common::mode_run_fail; +use common::mode_compile_fail; +use common::mode_pretty; +use common::mode; +use util::logv; fn main(args: ~[~str]) { let config = parse_config(args); diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs index d321cde3142..e7d6593061d 100644 --- a/src/compiletest/errors.rs +++ b/src/compiletest/errors.rs @@ -1,5 +1,5 @@ -import common::config; -import io::ReaderUtil; +use common::config; +use io::ReaderUtil; export load_errors; export expected_error; diff --git a/src/compiletest/header.rs b/src/compiletest/header.rs index 0458d86f466..521b603f1b4 100644 --- a/src/compiletest/header.rs +++ b/src/compiletest/header.rs @@ -1,8 +1,5 @@ -import option; -import str; - -import common::config; -import io::ReaderUtil; +use common::config; +use io::ReaderUtil; export test_props; export load_props; diff --git a/src/compiletest/procsrv.rs b/src/compiletest/procsrv.rs index 1ab3bc55d9f..90f88ea9d7a 100644 --- a/src/compiletest/procsrv.rs +++ b/src/compiletest/procsrv.rs @@ -1,6 +1,6 @@ -import run::spawn_process; -import io::{ReaderUtil, WriterUtil}; -import libc::{c_int, pid_t}; +use run::spawn_process; +use io::{ReaderUtil, WriterUtil}; +use libc::{c_int, pid_t}; export run; diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index 65835e9b470..55f17c245dc 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -1,13 +1,13 @@ -import io::WriterUtil; +use io::WriterUtil; -import common::mode_run_pass; -import common::mode_run_fail; -import common::mode_compile_fail; -import common::mode_pretty; -import common::config; -import header::load_props; -import header::test_props; -import util::logv; +use common::mode_run_pass; +use common::mode_run_fail; +use common::mode_compile_fail; +use common::mode_pretty; +use common::config; +use header::load_props; +use header::test_props; +use util::logv; export run; diff --git a/src/compiletest/util.rs b/src/compiletest/util.rs index 30ba4c0a343..ac0b4b03596 100644 --- a/src/compiletest/util.rs +++ b/src/compiletest/util.rs @@ -1,7 +1,6 @@ -import option; -import os::getenv; +use os::getenv; -import common::config; +use common::config; fn make_new_path(path: ~str) -> ~str { diff --git a/src/libcore/core.rc b/src/libcore/core.rc index c0c9cf5f9b6..ea736d81a95 100644 --- a/src/libcore/core.rc +++ b/src/libcore/core.rc @@ -75,7 +75,7 @@ export priv; /// Operations and constants for `int` #[path = "int-template"] mod int { - import inst::{ hash, pow }; + use inst::{ hash, pow }; export hash, pow; #[path = "int.rs"] mod inst; @@ -112,7 +112,7 @@ mod i64 { /// Operations and constants for `uint` #[path = "uint-template"] mod uint { - import inst::{ + use inst::{ div_ceil, div_round, div_floor, hash, iterate, next_power_of_two }; @@ -126,7 +126,7 @@ mod uint { /// Operations and constants for `u8` #[path = "uint-template"] mod u8 { - import inst::is_ascii; + use inst::is_ascii; export is_ascii; #[path = "u8.rs"] diff --git a/src/libcore/core.rs b/src/libcore/core.rs index d763b84c162..6f2e5516c06 100644 --- a/src/libcore/core.rs +++ b/src/libcore/core.rs @@ -97,7 +97,7 @@ mod core { #[cfg(test)] mod std { use std(vers = "0.4"); - import std::test; + use std::test; } /** diff --git a/src/libcore/gc.rs b/src/libcore/gc.rs index 402e786d842..94bf4808352 100644 --- a/src/libcore/gc.rs +++ b/src/libcore/gc.rs @@ -25,10 +25,10 @@ with destructors. */ -import stackwalk::Word; -import libc::size_t; -import libc::uintptr_t; -import send_map::linear::LinearMap; +use stackwalk::Word; +use libc::size_t; +use libc::uintptr_t; +use send_map::linear::LinearMap; export Word; export gc; diff --git a/src/libcore/int-template.rs b/src/libcore/int-template.rs index e1b592522e6..7adf92f96b3 100644 --- a/src/libcore/int-template.rs +++ b/src/libcore/int-template.rs @@ -210,7 +210,7 @@ fn test_from_str() { #[test] #[ignore] fn test_parse_buf() { - import str::to_bytes; + use str::to_bytes; assert parse_buf(to_bytes(~"123"), 10u) == Some(123 as T); assert parse_buf(to_bytes(~"1001"), 2u) == Some(9 as T); assert parse_buf(to_bytes(~"123"), 8u) == Some(83 as T); @@ -263,7 +263,7 @@ fn test_interfaces() { #[test] fn test_times() { - import iter::Times; + use iter::Times; let ten = 10 as T; let mut accum = 0; for ten.times { accum += 1; } @@ -274,6 +274,6 @@ fn test_times() { #[should_fail] #[ignore(cfg(windows))] fn test_times_negative() { - import iter::Times; + use iter::Times; for (-10).times { log(error, ~"nope!"); } } diff --git a/src/libcore/libc.rs b/src/libcore/libc.rs index 0ba77d40663..491fe02ec31 100644 --- a/src/libcore/libc.rs +++ b/src/libcore/libc.rs @@ -1143,7 +1143,7 @@ mod funcs { #[cfg(target_os = "win32")] mod extra { - import types::os::arch::extra::*; + use types::os::arch::extra::*; #[abi = "stdcall"] extern mod kernel32 { diff --git a/src/libcore/os.rs b/src/libcore/os.rs index 4e42b69db6b..3967f549e4c 100644 --- a/src/libcore/os.rs +++ b/src/libcore/os.rs @@ -78,14 +78,14 @@ fn fill_charp_buf(f: fn(*mut c_char, size_t) -> bool) #[cfg(windows)] mod win32 { - import dword = libc::types::os::arch::extra::DWORD; + use dword = libc::types::os::arch::extra::DWORD; fn fill_utf16_buf_and_decode(f: fn(*mut u16, dword) -> dword) -> Option<~str> { // FIXME: remove these when export globs work properly. #1238 - import libc::funcs::extra::kernel32::*; - import libc::consts::os::extra::*; + use libc::funcs::extra::kernel32::*; + use libc::consts::os::extra::*; let mut n = tmpbuf_sz as dword; let mut res = None; @@ -233,9 +233,9 @@ mod global_env { #[cfg(windows)] fn getenv(n: &str) -> Option<~str> { - import libc::types::os::arch::extra::*; - import libc::funcs::extra::kernel32::*; - import win32::*; + use libc::types::os::arch::extra::*; + use libc::funcs::extra::kernel32::*; + use win32::*; do as_utf16_p(n) |u| { do fill_utf16_buf_and_decode() |buf, sz| { GetEnvironmentVariableW(u, buf, sz) @@ -248,7 +248,7 @@ mod global_env { fn setenv(n: &str, v: &str) { // FIXME: remove this when export globs work properly. #1238 - import libc::funcs::posix01::unistd::setenv; + use libc::funcs::posix01::unistd::setenv; do str::as_c_str(n) |nbuf| { do str::as_c_str(v) |vbuf| { setenv(nbuf, vbuf, 1i32); @@ -260,8 +260,8 @@ mod global_env { #[cfg(windows)] fn setenv(n: &str, v: &str) { // FIXME: remove imports when export globs work properly. #1238 - import libc::funcs::extra::kernel32::*; - import win32::*; + use libc::funcs::extra::kernel32::*; + use win32::*; do as_utf16_p(n) |nbuf| { do as_utf16_p(v) |vbuf| { SetEnvironmentVariableW(nbuf, vbuf); @@ -283,13 +283,13 @@ fn fdopen(fd: c_int) -> *FILE { #[cfg(windows)] fn fsync_fd(fd: c_int, _level: io::fsync::Level) -> c_int { - import libc::funcs::extra::msvcrt::*; + use libc::funcs::extra::msvcrt::*; return commit(fd); } #[cfg(target_os = "linux")] fn fsync_fd(fd: c_int, level: io::fsync::Level) -> c_int { - import libc::funcs::posix01::unistd::*; + use libc::funcs::posix01::unistd::*; match level { io::fsync::FSync | io::fsync::FullFSync => return fsync(fd), @@ -299,9 +299,9 @@ fn fsync_fd(fd: c_int, level: io::fsync::Level) -> c_int { #[cfg(target_os = "macos")] fn fsync_fd(fd: c_int, level: io::fsync::Level) -> c_int { - import libc::consts::os::extra::*; - import libc::funcs::posix88::fcntl::*; - import libc::funcs::posix01::unistd::*; + use libc::consts::os::extra::*; + use libc::funcs::posix88::fcntl::*; + use libc::funcs::posix01::unistd::*; match level { io::fsync::FSync => return fsync(fd), _ => { @@ -316,7 +316,7 @@ fn fsync_fd(fd: c_int, level: io::fsync::Level) -> c_int { #[cfg(target_os = "freebsd")] fn fsync_fd(fd: c_int, _l: io::fsync::Level) -> c_int { - import libc::funcs::posix01::unistd::*; + use libc::funcs::posix01::unistd::*; return fsync(fd); } @@ -328,7 +328,7 @@ fn waitpid(pid: pid_t) -> c_int { #[cfg(unix)] fn waitpid(pid: pid_t) -> c_int { - import libc::funcs::posix01::wait::*; + use libc::funcs::posix01::wait::*; let status = 0 as c_int; assert (waitpid(pid, ptr::mut_addr_of(status), @@ -350,7 +350,7 @@ fn pipe() -> {in: c_int, out: c_int} { #[cfg(windows)] fn pipe() -> {in: c_int, out: c_int} { // FIXME: remove this when export globs work properly. #1238 - import libc::consts::os::extra::*; + use libc::consts::os::extra::*; // Windows pipes work subtly differently than unix pipes, and their // inheritance has to be handled in a different way that I do not fully // understand. Here we explicitly make the pipe non-inheritable, which @@ -388,8 +388,8 @@ fn self_exe_path() -> Option { #[cfg(target_os = "freebsd")] fn load_self() -> Option<~str> { unsafe { - import libc::funcs::bsd44::*; - import libc::consts::os::extra::*; + use libc::funcs::bsd44::*; + use libc::consts::os::extra::*; do fill_charp_buf() |buf, sz| { let mib = ~[CTL_KERN as c_int, KERN_PROC as c_int, @@ -403,7 +403,7 @@ fn self_exe_path() -> Option { #[cfg(target_os = "linux")] fn load_self() -> Option<~str> { - import libc::funcs::posix01::unistd::readlink; + use libc::funcs::posix01::unistd::readlink; do fill_charp_buf() |buf, sz| { do as_c_charp("/proc/self/exe") |proc_self_buf| { readlink(proc_self_buf, buf, sz) != (-1 as ssize_t) @@ -414,7 +414,7 @@ fn self_exe_path() -> Option { #[cfg(target_os = "macos")] fn load_self() -> Option<~str> { // FIXME: remove imports when export globs work properly. #1238 - import libc::funcs::extra::*; + use libc::funcs::extra::*; do fill_charp_buf() |buf, sz| { _NSGetExecutablePath(buf, ptr::mut_addr_of(sz as u32)) == (0 as c_int) @@ -424,9 +424,9 @@ fn self_exe_path() -> Option { #[cfg(windows)] fn load_self() -> Option<~str> { // FIXME: remove imports when export globs work properly. #1238 - import libc::types::os::arch::extra::*; - import libc::funcs::extra::kernel32::*; - import win32::*; + use libc::types::os::arch::extra::*; + use libc::funcs::extra::kernel32::*; + use win32::*; do fill_utf16_buf_and_decode() |buf, sz| { GetModuleFileNameW(0u as dword, buf, sz) } @@ -592,9 +592,9 @@ fn make_dir(p: &Path, mode: c_int) -> bool { #[cfg(windows)] fn mkdir(p: &Path, _mode: c_int) -> bool { // FIXME: remove imports when export globs work properly. #1238 - import libc::types::os::arch::extra::*; - import libc::funcs::extra::kernel32::*; - import win32::*; + use libc::types::os::arch::extra::*; + use libc::funcs::extra::kernel32::*; + use win32::*; // FIXME: turn mode into something useful? #2623 do as_utf16_p(p.to_str()) |buf| { CreateDirectoryW(buf, unsafe { unsafe::reinterpret_cast(&0) }) @@ -641,9 +641,9 @@ fn remove_dir(p: &Path) -> bool { #[cfg(windows)] fn rmdir(p: &Path) -> bool { // FIXME: remove imports when export globs work properly. #1238 - import libc::funcs::extra::kernel32::*; - import libc::types::os::arch::extra::*; - import win32::*; + use libc::funcs::extra::kernel32::*; + use libc::types::os::arch::extra::*; + use win32::*; return do as_utf16_p(p.to_str()) |buf| { RemoveDirectoryW(buf) != (0 as BOOL) }; @@ -663,9 +663,9 @@ fn change_dir(p: &Path) -> bool { #[cfg(windows)] fn chdir(p: &Path) -> bool { // FIXME: remove imports when export globs work properly. #1238 - import libc::funcs::extra::kernel32::*; - import libc::types::os::arch::extra::*; - import win32::*; + use libc::funcs::extra::kernel32::*; + use libc::types::os::arch::extra::*; + use win32::*; return do as_utf16_p(p.to_str()) |buf| { SetCurrentDirectoryW(buf) != (0 as BOOL) }; @@ -686,9 +686,9 @@ fn copy_file(from: &Path, to: &Path) -> bool { #[cfg(windows)] fn do_copy_file(from: &Path, to: &Path) -> bool { // FIXME: remove imports when export globs work properly. #1238 - import libc::funcs::extra::kernel32::*; - import libc::types::os::arch::extra::*; - import win32::*; + use libc::funcs::extra::kernel32::*; + use libc::types::os::arch::extra::*; + use win32::*; return do as_utf16_p(from.to_str()) |fromp| { do as_utf16_p(to.to_str()) |top| { CopyFileW(fromp, top, (0 as BOOL)) != (0 as BOOL) @@ -750,9 +750,9 @@ fn remove_file(p: &Path) -> bool { fn unlink(p: &Path) -> bool { // FIXME (similar to Issue #2006): remove imports when export globs // work properly. - import libc::funcs::extra::kernel32::*; - import libc::types::os::arch::extra::*; - import win32::*; + use libc::funcs::extra::kernel32::*; + use libc::types::os::arch::extra::*; + use win32::*; return do as_utf16_p(p.to_str()) |buf| { DeleteFileW(buf) != (0 as BOOL) }; @@ -836,7 +836,6 @@ mod tests { } fn make_rand_name() -> ~str { - import rand; let rng: rand::Rng = rand::Rng(); let n = ~"TEST" + rng.gen_str(10u); assert option::is_none(getenv(n)); diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 6e8a2bb3611..be3ab40dfcd 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -263,8 +263,8 @@ fn test() { #[test] fn test_position() { - import str::as_c_str; - import libc::c_char; + use str::as_c_str; + use libc::c_char; let s = ~"hello"; unsafe { diff --git a/src/libcore/rt.rs b/src/libcore/rt.rs index 53ef4d99eb2..357c3fba744 100644 --- a/src/libcore/rt.rs +++ b/src/libcore/rt.rs @@ -8,7 +8,7 @@ use libc::c_void; use libc::size_t; use libc::uintptr_t; -import gc::{cleanup_stack_for_failure, gc, Word}; +use gc::{cleanup_stack_for_failure, gc, Word}; #[allow(non_camel_case_types)] type rust_task = c_void; diff --git a/src/libcore/run.rs b/src/libcore/run.rs index 22e01acef2a..aedc67b00f5 100644 --- a/src/libcore/run.rs +++ b/src/libcore/run.rs @@ -336,7 +336,7 @@ fn program_output(prog: &str, args: &[~str]) -> } fn writeclose(fd: c_int, s: &str) { - import io::WriterUtil; + use io::WriterUtil; error!("writeclose %d, %s", fd as int, s); let writer = io::fd_writer(fd, false); @@ -402,7 +402,7 @@ fn waitpid(pid: pid_t) -> int { #[cfg(test)] mod tests { - import io::WriterUtil; + use io::WriterUtil; // Regression test for memory leaks #[ignore(cfg(windows))] // FIXME (#2626) diff --git a/src/libcore/send_map.rs b/src/libcore/send_map.rs index 182a592dad2..3fe921aa1e7 100644 --- a/src/libcore/send_map.rs +++ b/src/libcore/send_map.rs @@ -362,7 +362,7 @@ mod linear { #[test] mod test { - import linear::LinearMap; + use linear::LinearMap; fn int_linear_map() -> LinearMap { return LinearMap(); diff --git a/src/libcore/str.rs b/src/libcore/str.rs index fc8dfbc7d33..86073915f41 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -2303,7 +2303,7 @@ impl &str: StrSlice { #[cfg(test)] mod tests { - import libc::c_char; + use libc::c_char; #[test] fn test_eq() { diff --git a/src/libcore/uint-template.rs b/src/libcore/uint-template.rs index 01668edf3b6..1da46d780be 100644 --- a/src/libcore/uint-template.rs +++ b/src/libcore/uint-template.rs @@ -276,7 +276,7 @@ fn test_from_str() { #[test] #[ignore] fn test_parse_buf() { - import str::to_bytes; + use str::to_bytes; assert parse_buf(to_bytes(~"123"), 10u) == Some(123u as T); assert parse_buf(to_bytes(~"1001"), 2u) == Some(9u as T); assert parse_buf(to_bytes(~"123"), 8u) == Some(83u as T); @@ -304,7 +304,7 @@ fn to_str_radix17() { #[test] fn test_times() { - import iter::Times; + use iter::Times; let ten = 10 as T; let mut accum = 0; for ten.times { accum += 1; } diff --git a/src/libstd/arc.rs b/src/libstd/arc.rs index 0776f22d6f4..a1f7beb57a7 100644 --- a/src/libstd/arc.rs +++ b/src/libstd/arc.rs @@ -444,7 +444,7 @@ impl &RWReadMode { #[cfg(test)] mod tests { - import comm::*; + use comm::*; #[test] fn manually_share_arc() { diff --git a/src/libstd/c_vec.rs b/src/libstd/c_vec.rs index 53964fb0ddb..c02fb9d75fc 100644 --- a/src/libstd/c_vec.rs +++ b/src/libstd/c_vec.rs @@ -138,7 +138,7 @@ unsafe fn ptr(t: CVec) -> *mut T { #[cfg(test)] mod tests { - import libc::*; + use libc::*; fn malloc(n: size_t) -> CVec { let mem = libc::malloc(n); diff --git a/src/libstd/getopts.rs b/src/libstd/getopts.rs index 711b91d57ba..36492834c2a 100644 --- a/src/libstd/getopts.rs +++ b/src/libstd/getopts.rs @@ -456,8 +456,8 @@ impl FailType : Eq { #[cfg(test)] mod tests { - import opt = getopts; - import result::{Err, Ok}; + use opt = getopts; + use result::{Err, Ok}; fn check_fail_type(+f: Fail_, ft: FailType) { match f { diff --git a/src/libstd/net_url.rs b/src/libstd/net_url.rs index a83cb8637b5..5652b81b55e 100644 --- a/src/libstd/net_url.rs +++ b/src/libstd/net_url.rs @@ -1087,7 +1087,7 @@ mod tests { #[test] fn test_decode_form_urlencoded() { - import map::hash_from_strs; + use map::hash_from_strs; assert decode_form_urlencoded(~[]).size() == 0; diff --git a/src/libstd/time.rs b/src/libstd/time.rs index c012ac8fa05..84d4e49ef90 100644 --- a/src/libstd/time.rs +++ b/src/libstd/time.rs @@ -848,7 +848,6 @@ impl Tm { #[cfg(test)] mod tests { - import task; #[test] fn test_get_time() { diff --git a/src/libstd/timer.rs b/src/libstd/timer.rs index bda489c3ba7..9b6a2b85852 100644 --- a/src/libstd/timer.rs +++ b/src/libstd/timer.rs @@ -181,7 +181,7 @@ mod test { for spec.each |spec| { let (times, maxms) = spec; do task::spawn { - import rand::*; + use rand::*; let rng = Rng(); for iter::repeat(times) { sleep(hl_loop, rng.next() as uint % maxms); diff --git a/src/libsyntax/ext/auto_serialize.rs b/src/libsyntax/ext/auto_serialize.rs index 1bb207adfc2..6a31dac2e8f 100644 --- a/src/libsyntax/ext/auto_serialize.rs +++ b/src/libsyntax/ext/auto_serialize.rs @@ -78,10 +78,8 @@ export expand; // Transitional reexports so qquote can find the paths it is looking for mod syntax { - import ext; - export ext; - import parse; - export parse; + pub use ext; + pub use parse; } type ser_tps_map = map::HashMap ~[@ast::stmt]>; diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 6de6be82ae2..7894a8d05d3 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -299,9 +299,9 @@ fn get_mac_body(cx: ext_ctxt, sp: span, args: ast::mac_body) // using new syntax. This will be obsolete when #old_macros go away. fn tt_args_to_original_flavor(cx: ext_ctxt, sp: span, arg: ~[ast::token_tree]) -> ast::mac_arg { - import ast::{matcher, matcher_, match_tok, match_seq, match_nonterminal}; - import parse::lexer::{new_tt_reader, reader}; - import tt::macro_parser::{parse_or_else, matched_seq, + use ast::{matcher, matcher_, match_tok, match_seq, match_nonterminal}; + use parse::lexer::{new_tt_reader, reader}; + use tt::macro_parser::{parse_or_else, matched_seq, matched_nonterminal}; // these spans won't matter, anyways diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index 9edf97daaee..a4512b7b098 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -10,10 +10,8 @@ use ext::base::mk_ctxt; // Transitional reexports so qquote can find the paths it is looking for mod syntax { - import ext; - export ext; - import parse; - export parse; + pub use ext; + pub use parse; } fn path(ids: ~[ident], span: span) -> @ast::path { diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs index 123628a28a2..600c30f1f8b 100644 --- a/src/libsyntax/ext/pipes/pipec.rs +++ b/src/libsyntax/ext/pipes/pipec.rs @@ -16,10 +16,8 @@ use ast_builder::{append_types, path, empty_span}; // Transitional reexports so qquote can find the paths it is looking for mod syntax { - import ext; - export ext; - import parse; - export parse; + pub use ext; + pub use parse; } trait gen_send { @@ -321,7 +319,7 @@ impl protocol: gen_init { }; cx.parse_item(fmt!("fn init%s() -> (client::%s, server::%s)\ - { import pipes::HasBuffer; %s }", + { use pipes::HasBuffer; %s }", start_state.ty_params.to_source(cx), start_state.to_ty(cx).to_source(cx), start_state.to_ty(cx).to_source(cx), diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 6cec730d83d..74370d005ce 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3345,15 +3345,6 @@ impl parser { vis: visibility, span: mk_sp(lo, self.last_span.hi) }); - } else if self.eat_keyword(~"import") { - let view_paths = self.parse_view_paths(); - self.expect(token::SEMI); - return iovi_view_item(@{ - node: view_item_import(view_paths), - attrs: attrs, - vis: visibility, - span: mk_sp(lo, self.last_span.hi) - }); } else if self.eat_keyword(~"export") { let view_paths = self.parse_view_paths(); self.expect(token::SEMI); @@ -3506,7 +3497,6 @@ impl parser { next_tok = self.look_ahead(2); }; self.token_is_keyword(~"use", tok) - || self.token_is_keyword(~"import", tok) || self.token_is_keyword(~"export", tok) || (self.token_is_keyword(~"extern", tok) && self.token_is_keyword(~"mod", next_tok)) @@ -3516,8 +3506,6 @@ impl parser { let lo = self.span.lo, vis = self.parse_visibility(); let node = if self.eat_keyword(~"use") { self.parse_use(vis) - } else if self.eat_keyword(~"import") { - view_item_import(self.parse_view_paths()) } else if self.eat_keyword(~"export") { view_item_export(self.parse_view_paths()) } else if self.eat_keyword(~"extern") { diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 5f1bdf2ff3e..cfef2f96581 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -279,7 +279,7 @@ pure fn is_bar(t: token) -> bool { mod special_idents { - import ast::ident; + use ast::ident; const underscore : ident = 0u; const anon : ident = 1u; const dtor : ident = 2u; // 'drop', but that's reserved @@ -433,7 +433,7 @@ fn strict_keyword_table() -> HashMap<~str, ()> { ~"do", ~"drop", ~"else", ~"enum", ~"export", ~"extern", ~"false", ~"for", - ~"if", ~"import", + ~"if", ~"let", ~"log", ~"loop", ~"match", ~"mod", ~"move", ~"mut", ~"pure", diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 46faa67114e..62ec882e345 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1757,7 +1757,7 @@ fn print_view_item(s: ps, item: @ast::view_item) { } ast::view_item_import(vps) => { - head(s, ~"import"); + head(s, ~"use"); print_view_paths(s, vps); } diff --git a/src/rustc/driver/session.rs b/src/rustc/driver/session.rs index 0665c73137c..ec41d144ce1 100644 --- a/src/rustc/driver/session.rs +++ b/src/rustc/driver/session.rs @@ -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(), { diff --git a/src/rustc/metadata.rs b/src/rustc/metadata.rs index af28556fd33..66e53cf4540 100644 --- a/src/rustc/metadata.rs +++ b/src/rustc/metadata.rs @@ -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; } diff --git a/src/rustc/metadata/creader.rs b/src/rustc/metadata/creader.rs index ab7ee46dc64..1d007fbfdd0 100644 --- a/src/rustc/metadata/creader.rs +++ b/src/rustc/metadata/creader.rs @@ -55,7 +55,7 @@ fn dump_crates(crate_cache: DVec) { 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); diff --git a/src/rustc/middle/const_eval.rs b/src/rustc/middle/const_eval.rs index beceec4cfd3..d51d07259a3 100644 --- a/src/rustc/middle/const_eval.rs +++ b/src/rustc/middle/const_eval.rs @@ -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) => { diff --git a/src/rustc/middle/trans/base.rs b/src/rustc/middle/trans/base.rs index 3b07f375051..2f2d0392a7f 100644 --- a/src/rustc/middle/trans/base.rs +++ b/src/rustc/middle/trans/base.rs @@ -1220,7 +1220,7 @@ fn with_scope_datumblock(bcx: block, opt_node_info: Option, 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); diff --git a/src/rustc/middle/trans/reflect.rs b/src/rustc/middle/trans/reflect.rs index 680d2be7a50..e29d6956261 100644 --- a/src/rustc/middle/trans/reflect.rs +++ b/src/rustc/middle/trans/reflect.rs @@ -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); diff --git a/src/rustdoc/astsrv.rs b/src/rustdoc/astsrv.rs index 9f32e8f4c61..cda89e3b083 100644 --- a/src/rustdoc/astsrv.rs +++ b/src/rustdoc/astsrv.rs @@ -104,7 +104,7 @@ fn exec( fn build_ctxt(sess: session, ast: @ast::crate) -> ctxt { - import rustc::front::config; + use rustc::front::config; let ast = config::strip_unconfigured_items(ast); let ast = syntax::ext::expand::expand_crate(sess.parse_sess, @@ -201,7 +201,7 @@ fn srv_should_build_ast_map() { #[test] fn should_ignore_external_import_paths_that_dont_exist() { - let source = ~"use forble; import forble::bippy;"; + let source = ~"use forble; use forble::bippy;"; from_str(source, |_srv| { } ) } diff --git a/src/rustdoc/attr_parser.rs b/src/rustdoc/attr_parser.rs index 8663e377c0d..ebb892e5212 100644 --- a/src/rustdoc/attr_parser.rs +++ b/src/rustdoc/attr_parser.rs @@ -21,11 +21,11 @@ type crate_attrs = { mod test { fn parse_attributes(source: ~str) -> ~[ast::attribute] { - import syntax::parse; - import parse::parser; - import parse::attr::parser_attr; - import syntax::codemap; - import syntax::diagnostic; + use syntax::parse; + use parse::parser; + use parse::attr::parser_attr; + use syntax::codemap; + use syntax::diagnostic; let parse_sess = syntax::parse::new_parse_sess(None); let parser = parse::new_parser_from_source_str( diff --git a/src/rustdoc/config.rs b/src/rustdoc/config.rs index b0c01025320..3e6f46dbe26 100644 --- a/src/rustdoc/config.rs +++ b/src/rustdoc/config.rs @@ -71,7 +71,7 @@ fn opts() -> ~[(getopts::Opt, ~str)] { } fn usage() { - import io::println; + use io::println; println(~"Usage: rustdoc ~[options] \n"); println(~"Options:\n"); diff --git a/src/rustdoc/markdown_writer.rs b/src/rustdoc/markdown_writer.rs index 00c80366084..5e895c73674 100644 --- a/src/rustdoc/markdown_writer.rs +++ b/src/rustdoc/markdown_writer.rs @@ -89,7 +89,7 @@ fn pandoc_writer( ]; do generic_writer |markdown| { - import io::WriterUtil; + use io::WriterUtil; debug!("pandoc cmd: %s", pandoc_cmd); debug!("pandoc args: %s", str::connect(pandoc_args, ~" ")); @@ -255,7 +255,7 @@ mod test { } fn write_file(path: &Path, s: ~str) { - import io::WriterUtil; + use io::WriterUtil; match io::file_writer(path, ~[io::Create, io::Truncate]) { result::Ok(writer) => { diff --git a/src/rustdoc/prune_hidden_pass.rs b/src/rustdoc/prune_hidden_pass.rs index 292e37d93c4..9125cadd693 100644 --- a/src/rustdoc/prune_hidden_pass.rs +++ b/src/rustdoc/prune_hidden_pass.rs @@ -34,7 +34,7 @@ fn fold_mod( } fn is_hidden(srv: astsrv::srv, doc: doc::itemdoc) -> bool { - import syntax::ast_map; + use syntax::ast_map; let id = doc.id; do astsrv::exec(srv) |ctxt| { diff --git a/src/rustdoc/rustdoc.rc b/src/rustdoc/rustdoc.rc index 4129a325627..d0e073986ef 100644 --- a/src/rustdoc/rustdoc.rc +++ b/src/rustdoc/rustdoc.rc @@ -19,8 +19,8 @@ use std(vers = "0.4"); use rustc(vers = "0.4"); use syntax(vers = "0.4"); -import core::*; -import std::par; +use core::*; +use std::par; mod config; mod parse; diff --git a/src/test/bench/pingpong.rs b/src/test/bench/pingpong.rs index 5e0f9072f6c..9ffe3a14b34 100644 --- a/src/test/bench/pingpong.rs +++ b/src/test/bench/pingpong.rs @@ -72,7 +72,7 @@ fn switch(+endp: pipes::RecvPacketBuffered, // Here's the benchmark fn bounded(count: uint) { - import pingpong::*; + use pingpong::*; let mut ch = do spawn_service(init) |ch| { let mut count = count; @@ -99,7 +99,7 @@ fn bounded(count: uint) { } fn unbounded(count: uint) { - import pingpong_unbounded::*; + use pingpong_unbounded::*; let mut ch = do spawn_service(init) |ch| { let mut count = count; diff --git a/src/test/bench/shootout-threadring.rs b/src/test/bench/shootout-threadring.rs index 702f53e5693..6f5fe08d0ef 100644 --- a/src/test/bench/shootout-threadring.rs +++ b/src/test/bench/shootout-threadring.rs @@ -4,7 +4,7 @@ use std; const n_threads: int = 503; fn start(+token: int) { - import iter::*; + use iter::*; let p = comm::Port(); let mut ch = comm::Chan(p); diff --git a/src/test/compile-fail/import-glob-circular.rs b/src/test/compile-fail/import-glob-circular.rs index 637b78e4eed..a3847c989d1 100644 --- a/src/test/compile-fail/import-glob-circular.rs +++ b/src/test/compile-fail/import-glob-circular.rs @@ -1,7 +1,7 @@ // error-pattern: unresolved mod circ1 { - import circ1::*; + use circ1::*; export f1; export f2; export common; @@ -10,7 +10,7 @@ mod circ1 { } mod circ2 { - import circ2::*; + use circ2::*; export f1; export f2; export common; @@ -19,7 +19,7 @@ mod circ2 { } mod test { - import circ1::*; + use circ1::*; fn test() { f1066(); } } diff --git a/src/test/compile-fail/issue-2611-3.rs b/src/test/compile-fail/issue-2611-3.rs index 5545c0b2a13..786e2a99a94 100644 --- a/src/test/compile-fail/issue-2611-3.rs +++ b/src/test/compile-fail/issue-2611-3.rs @@ -3,8 +3,7 @@ // we let an impl method can have more permissive bounds than the trait // method it's implementing, the return type might be less specific than // needed. Just punt and make it invariant. -import iter; -import iter::BaseIter; +use iter::BaseIter; trait A { fn b(x: C) -> C; diff --git a/src/test/compile-fail/issue-2611-4.rs b/src/test/compile-fail/issue-2611-4.rs index 22674c06595..777c89d5862 100644 --- a/src/test/compile-fail/issue-2611-4.rs +++ b/src/test/compile-fail/issue-2611-4.rs @@ -1,7 +1,6 @@ // Tests that an impl method's bounds aren't *more* restrictive // than the trait method it's implementing -import iter; -import iter::BaseIter; +use iter::BaseIter; trait A { fn b(x: C) -> C; diff --git a/src/test/compile-fail/issue-2611-5.rs b/src/test/compile-fail/issue-2611-5.rs index b01342282b2..e125aa61578 100644 --- a/src/test/compile-fail/issue-2611-5.rs +++ b/src/test/compile-fail/issue-2611-5.rs @@ -1,7 +1,6 @@ // Tests that ty params get matched correctly when comparing // an impl against a trait -import iter; -import iter::BaseIter; +use iter::BaseIter; trait A { fn b(x: C) -> C; diff --git a/src/test/compile-fail/issue-2848.rs b/src/test/compile-fail/issue-2848.rs index cb5f59bb694..b091dc71357 100644 --- a/src/test/compile-fail/issue-2848.rs +++ b/src/test/compile-fail/issue-2848.rs @@ -7,7 +7,7 @@ mod bar { } fn main() { - import bar::{alpha, charlie}; + use bar::{alpha, charlie}; match alpha { alpha | beta => {} //~ ERROR variable `beta` from pattern #2 is not bound in pattern #1 charlie => {} diff --git a/src/test/compile-fail/regions-glb-free-free.rs b/src/test/compile-fail/regions-glb-free-free.rs index 28c6e7222e2..9edf19cf514 100644 --- a/src/test/compile-fail/regions-glb-free-free.rs +++ b/src/test/compile-fail/regions-glb-free-free.rs @@ -1,7 +1,7 @@ mod argparse { use std; - import either::{Either, Left, Right}; + use either::{Either, Left, Right}; struct Flag { name: &str, diff --git a/src/test/compile-fail/unused-imports-warn.rs b/src/test/compile-fail/unused-imports-warn.rs index 6130bf38d7c..da1fb692c06 100644 --- a/src/test/compile-fail/unused-imports-warn.rs +++ b/src/test/compile-fail/unused-imports-warn.rs @@ -9,8 +9,8 @@ mod foo { mod bar { mod c { - import foo::point; - import foo::square; + use foo::point; + use foo::square; fn cc(p: point) -> str { return 2 * (p.x + p.y); } } } diff --git a/src/test/run-pass/export-glob-imports-target.rs b/src/test/run-pass/export-glob-imports-target.rs index 5ae34b4209f..915393f05e1 100644 --- a/src/test/run-pass/export-glob-imports-target.rs +++ b/src/test/run-pass/export-glob-imports-target.rs @@ -4,7 +4,7 @@ // Modified to not use export since it's going away. --pcw mod foo { - import bar::*; + use bar::*; mod bar { const a : int = 10; } diff --git a/src/test/run-pass/export-glob.rs b/src/test/run-pass/export-glob.rs index c14fb80f3f6..666bc7ef3ac 100644 --- a/src/test/run-pass/export-glob.rs +++ b/src/test/run-pass/export-glob.rs @@ -4,7 +4,7 @@ // Modified to not use export since it's going away. --pcw mod foo { - import bar::*; + use bar::*; export a; mod bar { const a : int = 10; diff --git a/src/test/run-pass/hashmap-memory.rs b/src/test/run-pass/hashmap-memory.rs index 98bcc8ed36f..5498be31b1d 100644 --- a/src/test/run-pass/hashmap-memory.rs +++ b/src/test/run-pass/hashmap-memory.rs @@ -6,7 +6,6 @@ use std; -use option = option; use option::Some; use option::None; use std::map; diff --git a/src/test/run-pass/import-from-foreign.rs b/src/test/run-pass/import-from-foreign.rs index 51cd4ea4984..9b71b0862dd 100644 --- a/src/test/run-pass/import-from-foreign.rs +++ b/src/test/run-pass/import-from-foreign.rs @@ -5,7 +5,7 @@ mod spam { #[abi = "cdecl"] extern mod rustrt { - import spam::{ham, eggs}; + use spam::{ham, eggs}; export ham; export eggs; } diff --git a/src/test/run-pass/import-glob-1.rs b/src/test/run-pass/import-glob-1.rs index 29435b88f4a..49bbc7d5881 100644 --- a/src/test/run-pass/import-glob-1.rs +++ b/src/test/run-pass/import-glob-1.rs @@ -4,14 +4,14 @@ mod a1 { // mod b1 { // - import a2::b1::*; + use a2::b1::*; // <-\ export word_traveler; // | } // | mod b2 { // | - import a2::b2::*; + use a2::b2::*; // <-\ -\ | export word_traveler; // | | | } // | | | @@ -24,7 +24,7 @@ mod a2 { #[nolink] extern mod b1 { // | | | - import a1::b2::*; + use a1::b2::*; // | <-/ -/ export word_traveler; // | } diff --git a/src/test/run-pass/import-in-block.rs b/src/test/run-pass/import-in-block.rs index 02837529af4..e2c893c725b 100644 --- a/src/test/run-pass/import-in-block.rs +++ b/src/test/run-pass/import-in-block.rs @@ -1,11 +1,10 @@ use std; fn main() { - import vec; - import vec::to_mut; + use vec::to_mut; log(debug, vec::len(to_mut(~[1, 2]))); { - import vec::*; + use vec::*; log(debug, len(~[2])); } } diff --git a/src/test/run-pass/import.rs b/src/test/run-pass/import.rs index 49a576ac1b1..b0ee5439370 100644 --- a/src/test/run-pass/import.rs +++ b/src/test/run-pass/import.rs @@ -3,8 +3,8 @@ mod foo { } mod bar { - import foo::x; - import z = foo::x; + use foo::x; + use z = foo::x; fn thing() { x(10); z(10); } } diff --git a/src/test/run-pass/import5.rs b/src/test/run-pass/import5.rs index 8f6f8cebe72..3fab08badb9 100644 --- a/src/test/run-pass/import5.rs +++ b/src/test/run-pass/import5.rs @@ -1,6 +1,6 @@ use foo::bar; mod foo { - import zed::bar; + use zed::bar; export bar; mod zed { fn bar() { debug!("foo"); } diff --git a/src/test/run-pass/import6.rs b/src/test/run-pass/import6.rs index 4c5cfeb7367..800429857e8 100644 --- a/src/test/run-pass/import6.rs +++ b/src/test/run-pass/import6.rs @@ -6,7 +6,7 @@ mod foo { } } mod bar { - import zed::baz; + use zed::baz; export baz; } fn main() { baz(); } diff --git a/src/test/run-pass/import7.rs b/src/test/run-pass/import7.rs index eb98f625fb1..5f2e8caaa79 100644 --- a/src/test/run-pass/import7.rs +++ b/src/test/run-pass/import7.rs @@ -6,7 +6,7 @@ mod foo { } } mod bar { - import zed::baz; + use zed::baz; export baz; mod foo { mod zed { } diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index 6f6b6e2cd39..053cc0abce0 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -1,5 +1,5 @@ mod pipes { - import unsafe::{forget, transmute}; + use unsafe::{forget, transmute}; enum state { empty, diff --git a/src/test/run-pass/mod-view-items.rs b/src/test/run-pass/mod-view-items.rs index 9104469d435..cb99d211baf 100644 --- a/src/test/run-pass/mod-view-items.rs +++ b/src/test/run-pass/mod-view-items.rs @@ -5,8 +5,7 @@ // begin failing. mod m { - use std; - import vec; + use core::vec; fn f() -> ~[int] { vec::from_elem(1u, 0) } } diff --git a/src/test/run-pass/module-polymorphism.rc b/src/test/run-pass/module-polymorphism.rc index 3f93608e53a..938a594ccae 100644 --- a/src/test/run-pass/module-polymorphism.rc +++ b/src/test/run-pass/module-polymorphism.rc @@ -2,7 +2,7 @@ mod my_float { // The type of the float - import inst::T; + use inst::T; // Define T as float #[path = "inst_float.rs"] @@ -17,7 +17,7 @@ mod my_float { #[path = "module-polymorphism-files"] mod my_f64 { - import inst::T; + use inst::T; // Define T as f64 #[path = "inst_f64.rs"] @@ -31,7 +31,7 @@ mod my_f64 { #[path = "module-polymorphism-files"] mod my_f32 { - import inst::T; + use inst::T; #[path = "inst_f32.rs"] mod inst; diff --git a/src/test/run-pass/module-polymorphism2.rc b/src/test/run-pass/module-polymorphism2.rc index bc801bcb4a3..0c25f454625 100644 --- a/src/test/run-pass/module-polymorphism2.rc +++ b/src/test/run-pass/module-polymorphism2.rc @@ -4,10 +4,10 @@ mod mystd { #[path = "float-template"] mod float { // The type of the float - import inst::T; + use inst::T; // Unfortunate - import template::*; + use template::*; export plus; // Define T as float @@ -23,10 +23,10 @@ mod mystd { #[path = "float-template"] mod f64 { - import inst::T; + use inst::T; // Unfortunate - import template::*; + use template::*; export plus; // Define T as f64 @@ -41,10 +41,10 @@ mod mystd { #[path = "float-template"] mod f32 { - import inst::T; + use inst::T; // Unfortunate - import template::*; + use template::*; export plus; #[path = "inst_f32.rs"] diff --git a/src/test/run-pass/module-polymorphism3.rc b/src/test/run-pass/module-polymorphism3.rc index 3ed7be15ff5..3b3a5133b52 100644 --- a/src/test/run-pass/module-polymorphism3.rc +++ b/src/test/run-pass/module-polymorphism3.rc @@ -8,7 +8,7 @@ mod mystd { #[path = "float-template"] mod float { // The type of the float - import inst::T; + use inst::T; // Define T as appropriate for platform #[path = "inst_float.rs"] @@ -19,7 +19,7 @@ mod mystd { #[path = "float-template"] mod f64 { - import inst::T; + use inst::T; // Define T as f64 #[path = "inst_f64.rs"] @@ -28,7 +28,7 @@ mod mystd { #[path = "float-template"] mod f32 { - import inst::T; + use inst::T; #[path = "inst_f32.rs"] mod inst; diff --git a/src/test/run-pass/module-polymorphism4.rc b/src/test/run-pass/module-polymorphism4.rc index b6be5ae8086..6218948b814 100644 --- a/src/test/run-pass/module-polymorphism4.rc +++ b/src/test/run-pass/module-polymorphism4.rc @@ -2,7 +2,7 @@ #[path = "module-polymorphism4-files"] mod cat { - import inst::*; + use inst::*; #[path = "cat.rs"] mod inst; @@ -15,7 +15,7 @@ mod cat { #[path = "module-polymorphism4-files"] mod dog { - import inst::*; + use inst::*; #[path = "dog.rs"] mod inst; diff --git a/src/test/run-pass/pipe-bank-proto.rs b/src/test/run-pass/pipe-bank-proto.rs index f484e635e49..bf8338e5ee5 100644 --- a/src/test/run-pass/pipe-bank-proto.rs +++ b/src/test/run-pass/pipe-bank-proto.rs @@ -57,7 +57,7 @@ macro_rules! follow ( ) fn client_follow(+bank: bank::client::login) { - import bank::*; + use bank::*; let bank = client::login(bank, ~"theincredibleholk", ~"1234"); let bank = switch(bank, follow! ( @@ -78,7 +78,7 @@ fn client_follow(+bank: bank::client::login) { } fn bank_client(+bank: bank::client::login) { - import bank::*; + use bank::*; let bank = client::login(bank, ~"theincredibleholk", ~"1234"); let bank = match try_recv(bank) { diff --git a/src/test/run-pass/pipe-pingpong-bounded.rs b/src/test/run-pass/pipe-pingpong-bounded.rs index 29f97023e8e..2c8359991de 100644 --- a/src/test/run-pass/pipe-pingpong-bounded.rs +++ b/src/test/run-pass/pipe-pingpong-bounded.rs @@ -7,7 +7,7 @@ // This was generated initially by the pipe compiler, but it's been // modified in hopefully straightforward ways. mod pingpong { - import pipes::*; + use pipes::*; type packets = { // This is probably a resolve bug, I forgot to export packet, @@ -67,11 +67,11 @@ mod pingpong { } mod test { - import pipes::recv; - import pingpong::{ping, pong}; + use pipes::recv; + use pingpong::{ping, pong}; fn client(-chan: pingpong::client::ping) { - import pingpong::client; + use pingpong::client; let chan = client::ping(chan); return; log(error, "Sent ping"); @@ -80,7 +80,7 @@ mod test { } fn server(-chan: pingpong::server::ping) { - import pingpong::server; + use pingpong::server; let ping(chan) = recv(chan); return; log(error, "Received ping"); diff --git a/src/test/run-pass/pipe-pingpong-proto.rs b/src/test/run-pass/pipe-pingpong-proto.rs index e1a346cbc08..7d70e2bdb68 100644 --- a/src/test/run-pass/pipe-pingpong-proto.rs +++ b/src/test/run-pass/pipe-pingpong-proto.rs @@ -13,11 +13,11 @@ proto! pingpong ( ) mod test { - import pipes::recv; - import pingpong::{ping, pong}; + use pipes::recv; + use pingpong::{ping, pong}; fn client(-chan: pingpong::client::ping) { - import pingpong::client; + use pingpong::client; let chan = client::ping(chan); log(error, ~"Sent ping"); @@ -26,7 +26,7 @@ mod test { } fn server(-chan: pingpong::server::ping) { - import pingpong::server; + use pingpong::server; let ping(chan) = recv(chan); log(error, ~"Received ping"); diff --git a/src/test/run-pass/pipe-select-macro.rs b/src/test/run-pass/pipe-select-macro.rs index 1e868d3d249..8554659a2ee 100644 --- a/src/test/run-pass/pipe-select-macro.rs +++ b/src/test/run-pass/pipe-select-macro.rs @@ -28,7 +28,7 @@ fn macros() { // Code fn test(+foo: foo::client::foo, +bar: bar::client::bar) { - import bar::do_baz; + use bar::do_baz; select! ( foo => { diff --git a/src/test/run-pass/pipe-select.rs b/src/test/run-pass/pipe-select.rs index 29504d477a1..a963736f28b 100644 --- a/src/test/run-pass/pipe-select.rs +++ b/src/test/run-pass/pipe-select.rs @@ -20,8 +20,8 @@ proto! stream ( ) fn main() { - import oneshot::client::*; - import stream::client::*; + use oneshot::client::*; + use stream::client::*; let iotask = uv::global_loop::get(); diff --git a/src/test/run-pass/pipe-sleep.rs b/src/test/run-pass/pipe-sleep.rs index 468e39c40cd..5bdb38c7d3d 100644 --- a/src/test/run-pass/pipe-sleep.rs +++ b/src/test/run-pass/pipe-sleep.rs @@ -12,7 +12,7 @@ proto! oneshot ( ) fn main() { - import oneshot::client::*; + use oneshot::client::*; let c = pipes::spawn_service(oneshot::init, |p| { recv(p); }); diff --git a/src/test/run-pass/self-shadowing-import.rs b/src/test/run-pass/self-shadowing-import.rs index af2d419c1d6..0fec03d6b9b 100644 --- a/src/test/run-pass/self-shadowing-import.rs +++ b/src/test/run-pass/self-shadowing-import.rs @@ -7,7 +7,7 @@ mod a { } mod c { - import a::b::a; + use a::b::a; fn bar() { assert (a::foo() == 1); } } diff --git a/src/test/run-pass/use.rs b/src/test/run-pass/use.rs index 4fba3ca24be..6ecf7422757 100644 --- a/src/test/run-pass/use.rs +++ b/src/test/run-pass/use.rs @@ -7,8 +7,8 @@ use bar(name = "core", vers = "0.4"); use core::str; use x = zed::str; mod baz { - import bar::str; - import x = core::str; + use bar::str; + use x = core::str; } fn main() { } \ No newline at end of file