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

@ -1,5 +1,3 @@
import option;
enum mode { mode_compile_fail, mode_run_fail, mode_run_pass, mode_pretty, } enum mode { mode_compile_fail, mode_run_fail, mode_run_pass, mode_pretty, }
impl mode : cmp::Eq { impl mode : cmp::Eq {

View File

@ -7,7 +7,7 @@
use core(vers = "0.4"); use core(vers = "0.4");
use std(vers = "0.4"); use std(vers = "0.4");
import core::*; use core::*;
mod procsrv; mod procsrv;
mod util; mod util;

View File

@ -1,20 +1,16 @@
import option; use std::getopts;
import std::getopts; use std::test;
import std::test;
import str;
import vec;
import task;
import core::result; use core::result;
import result::{Ok, Err}; use result::{Ok, Err};
import common::config; use common::config;
import common::mode_run_pass; use common::mode_run_pass;
import common::mode_run_fail; use common::mode_run_fail;
import common::mode_compile_fail; use common::mode_compile_fail;
import common::mode_pretty; use common::mode_pretty;
import common::mode; use common::mode;
import util::logv; use util::logv;
fn main(args: ~[~str]) { fn main(args: ~[~str]) {
let config = parse_config(args); let config = parse_config(args);

View File

@ -1,5 +1,5 @@
import common::config; use common::config;
import io::ReaderUtil; use io::ReaderUtil;
export load_errors; export load_errors;
export expected_error; export expected_error;

View File

@ -1,8 +1,5 @@
import option; use common::config;
import str; use io::ReaderUtil;
import common::config;
import io::ReaderUtil;
export test_props; export test_props;
export load_props; export load_props;

View File

@ -1,6 +1,6 @@
import run::spawn_process; use run::spawn_process;
import io::{ReaderUtil, WriterUtil}; use io::{ReaderUtil, WriterUtil};
import libc::{c_int, pid_t}; use libc::{c_int, pid_t};
export run; export run;

View File

@ -1,13 +1,13 @@
import io::WriterUtil; use io::WriterUtil;
import common::mode_run_pass; use common::mode_run_pass;
import common::mode_run_fail; use common::mode_run_fail;
import common::mode_compile_fail; use common::mode_compile_fail;
import common::mode_pretty; use common::mode_pretty;
import common::config; use common::config;
import header::load_props; use header::load_props;
import header::test_props; use header::test_props;
import util::logv; use util::logv;
export run; export run;

View File

@ -1,7 +1,6 @@
import option; use os::getenv;
import os::getenv;
import common::config; use common::config;
fn make_new_path(path: ~str) -> ~str { fn make_new_path(path: ~str) -> ~str {

View File

@ -75,7 +75,7 @@ export priv;
/// Operations and constants for `int` /// Operations and constants for `int`
#[path = "int-template"] #[path = "int-template"]
mod int { mod int {
import inst::{ hash, pow }; use inst::{ hash, pow };
export hash, pow; export hash, pow;
#[path = "int.rs"] #[path = "int.rs"]
mod inst; mod inst;
@ -112,7 +112,7 @@ mod i64 {
/// Operations and constants for `uint` /// Operations and constants for `uint`
#[path = "uint-template"] #[path = "uint-template"]
mod uint { mod uint {
import inst::{ use inst::{
div_ceil, div_round, div_floor, hash, iterate, div_ceil, div_round, div_floor, hash, iterate,
next_power_of_two next_power_of_two
}; };
@ -126,7 +126,7 @@ mod uint {
/// Operations and constants for `u8` /// Operations and constants for `u8`
#[path = "uint-template"] #[path = "uint-template"]
mod u8 { mod u8 {
import inst::is_ascii; use inst::is_ascii;
export is_ascii; export is_ascii;
#[path = "u8.rs"] #[path = "u8.rs"]

View File

@ -97,7 +97,7 @@ mod core {
#[cfg(test)] #[cfg(test)]
mod std { mod std {
use std(vers = "0.4"); use std(vers = "0.4");
import std::test; use std::test;
} }
/** /**

View File

@ -25,10 +25,10 @@ with destructors.
*/ */
import stackwalk::Word; use stackwalk::Word;
import libc::size_t; use libc::size_t;
import libc::uintptr_t; use libc::uintptr_t;
import send_map::linear::LinearMap; use send_map::linear::LinearMap;
export Word; export Word;
export gc; export gc;

View File

@ -210,7 +210,7 @@ fn test_from_str() {
#[test] #[test]
#[ignore] #[ignore]
fn test_parse_buf() { 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(~"123"), 10u) == Some(123 as T);
assert parse_buf(to_bytes(~"1001"), 2u) == Some(9 as T); assert parse_buf(to_bytes(~"1001"), 2u) == Some(9 as T);
assert parse_buf(to_bytes(~"123"), 8u) == Some(83 as T); assert parse_buf(to_bytes(~"123"), 8u) == Some(83 as T);
@ -263,7 +263,7 @@ fn test_interfaces() {
#[test] #[test]
fn test_times() { fn test_times() {
import iter::Times; use iter::Times;
let ten = 10 as T; let ten = 10 as T;
let mut accum = 0; let mut accum = 0;
for ten.times { accum += 1; } for ten.times { accum += 1; }
@ -274,6 +274,6 @@ fn test_times() {
#[should_fail] #[should_fail]
#[ignore(cfg(windows))] #[ignore(cfg(windows))]
fn test_times_negative() { fn test_times_negative() {
import iter::Times; use iter::Times;
for (-10).times { log(error, ~"nope!"); } for (-10).times { log(error, ~"nope!"); }
} }

View File

@ -1143,7 +1143,7 @@ mod funcs {
#[cfg(target_os = "win32")] #[cfg(target_os = "win32")]
mod extra { mod extra {
import types::os::arch::extra::*; use types::os::arch::extra::*;
#[abi = "stdcall"] #[abi = "stdcall"]
extern mod kernel32 { extern mod kernel32 {

View File

@ -78,14 +78,14 @@ fn fill_charp_buf(f: fn(*mut c_char, size_t) -> bool)
#[cfg(windows)] #[cfg(windows)]
mod win32 { 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) fn fill_utf16_buf_and_decode(f: fn(*mut u16, dword) -> dword)
-> Option<~str> { -> Option<~str> {
// FIXME: remove these when export globs work properly. #1238 // FIXME: remove these when export globs work properly. #1238
import libc::funcs::extra::kernel32::*; use libc::funcs::extra::kernel32::*;
import libc::consts::os::extra::*; use libc::consts::os::extra::*;
let mut n = tmpbuf_sz as dword; let mut n = tmpbuf_sz as dword;
let mut res = None; let mut res = None;
@ -233,9 +233,9 @@ mod global_env {
#[cfg(windows)] #[cfg(windows)]
fn getenv(n: &str) -> Option<~str> { fn getenv(n: &str) -> Option<~str> {
import libc::types::os::arch::extra::*; use libc::types::os::arch::extra::*;
import libc::funcs::extra::kernel32::*; use libc::funcs::extra::kernel32::*;
import win32::*; use win32::*;
do as_utf16_p(n) |u| { do as_utf16_p(n) |u| {
do fill_utf16_buf_and_decode() |buf, sz| { do fill_utf16_buf_and_decode() |buf, sz| {
GetEnvironmentVariableW(u, buf, sz) GetEnvironmentVariableW(u, buf, sz)
@ -248,7 +248,7 @@ mod global_env {
fn setenv(n: &str, v: &str) { fn setenv(n: &str, v: &str) {
// FIXME: remove this when export globs work properly. #1238 // 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(n) |nbuf| {
do str::as_c_str(v) |vbuf| { do str::as_c_str(v) |vbuf| {
setenv(nbuf, vbuf, 1i32); setenv(nbuf, vbuf, 1i32);
@ -260,8 +260,8 @@ mod global_env {
#[cfg(windows)] #[cfg(windows)]
fn setenv(n: &str, v: &str) { fn setenv(n: &str, v: &str) {
// FIXME: remove imports when export globs work properly. #1238 // FIXME: remove imports when export globs work properly. #1238
import libc::funcs::extra::kernel32::*; use libc::funcs::extra::kernel32::*;
import win32::*; use win32::*;
do as_utf16_p(n) |nbuf| { do as_utf16_p(n) |nbuf| {
do as_utf16_p(v) |vbuf| { do as_utf16_p(v) |vbuf| {
SetEnvironmentVariableW(nbuf, vbuf); SetEnvironmentVariableW(nbuf, vbuf);
@ -283,13 +283,13 @@ fn fdopen(fd: c_int) -> *FILE {
#[cfg(windows)] #[cfg(windows)]
fn fsync_fd(fd: c_int, _level: io::fsync::Level) -> c_int { 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); return commit(fd);
} }
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
fn fsync_fd(fd: c_int, level: io::fsync::Level) -> c_int { fn fsync_fd(fd: c_int, level: io::fsync::Level) -> c_int {
import libc::funcs::posix01::unistd::*; use libc::funcs::posix01::unistd::*;
match level { match level {
io::fsync::FSync io::fsync::FSync
| io::fsync::FullFSync => return fsync(fd), | 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")] #[cfg(target_os = "macos")]
fn fsync_fd(fd: c_int, level: io::fsync::Level) -> c_int { fn fsync_fd(fd: c_int, level: io::fsync::Level) -> c_int {
import libc::consts::os::extra::*; use libc::consts::os::extra::*;
import libc::funcs::posix88::fcntl::*; use libc::funcs::posix88::fcntl::*;
import libc::funcs::posix01::unistd::*; use libc::funcs::posix01::unistd::*;
match level { match level {
io::fsync::FSync => return fsync(fd), 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")] #[cfg(target_os = "freebsd")]
fn fsync_fd(fd: c_int, _l: io::fsync::Level) -> c_int { 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); return fsync(fd);
} }
@ -328,7 +328,7 @@ fn waitpid(pid: pid_t) -> c_int {
#[cfg(unix)] #[cfg(unix)]
fn waitpid(pid: pid_t) -> c_int { fn waitpid(pid: pid_t) -> c_int {
import libc::funcs::posix01::wait::*; use libc::funcs::posix01::wait::*;
let status = 0 as c_int; let status = 0 as c_int;
assert (waitpid(pid, ptr::mut_addr_of(status), assert (waitpid(pid, ptr::mut_addr_of(status),
@ -350,7 +350,7 @@ fn pipe() -> {in: c_int, out: c_int} {
#[cfg(windows)] #[cfg(windows)]
fn pipe() -> {in: c_int, out: c_int} { fn pipe() -> {in: c_int, out: c_int} {
// FIXME: remove this when export globs work properly. #1238 // 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 // Windows pipes work subtly differently than unix pipes, and their
// inheritance has to be handled in a different way that I do not fully // inheritance has to be handled in a different way that I do not fully
// understand. Here we explicitly make the pipe non-inheritable, which // understand. Here we explicitly make the pipe non-inheritable, which
@ -388,8 +388,8 @@ fn self_exe_path() -> Option<Path> {
#[cfg(target_os = "freebsd")] #[cfg(target_os = "freebsd")]
fn load_self() -> Option<~str> { fn load_self() -> Option<~str> {
unsafe { unsafe {
import libc::funcs::bsd44::*; use libc::funcs::bsd44::*;
import libc::consts::os::extra::*; use libc::consts::os::extra::*;
do fill_charp_buf() |buf, sz| { do fill_charp_buf() |buf, sz| {
let mib = ~[CTL_KERN as c_int, let mib = ~[CTL_KERN as c_int,
KERN_PROC as c_int, KERN_PROC as c_int,
@ -403,7 +403,7 @@ fn self_exe_path() -> Option<Path> {
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
fn load_self() -> Option<~str> { fn load_self() -> Option<~str> {
import libc::funcs::posix01::unistd::readlink; use libc::funcs::posix01::unistd::readlink;
do fill_charp_buf() |buf, sz| { do fill_charp_buf() |buf, sz| {
do as_c_charp("/proc/self/exe") |proc_self_buf| { do as_c_charp("/proc/self/exe") |proc_self_buf| {
readlink(proc_self_buf, buf, sz) != (-1 as ssize_t) readlink(proc_self_buf, buf, sz) != (-1 as ssize_t)
@ -414,7 +414,7 @@ fn self_exe_path() -> Option<Path> {
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
fn load_self() -> Option<~str> { fn load_self() -> Option<~str> {
// FIXME: remove imports when export globs work properly. #1238 // FIXME: remove imports when export globs work properly. #1238
import libc::funcs::extra::*; use libc::funcs::extra::*;
do fill_charp_buf() |buf, sz| { do fill_charp_buf() |buf, sz| {
_NSGetExecutablePath(buf, ptr::mut_addr_of(sz as u32)) _NSGetExecutablePath(buf, ptr::mut_addr_of(sz as u32))
== (0 as c_int) == (0 as c_int)
@ -424,9 +424,9 @@ fn self_exe_path() -> Option<Path> {
#[cfg(windows)] #[cfg(windows)]
fn load_self() -> Option<~str> { fn load_self() -> Option<~str> {
// FIXME: remove imports when export globs work properly. #1238 // FIXME: remove imports when export globs work properly. #1238
import libc::types::os::arch::extra::*; use libc::types::os::arch::extra::*;
import libc::funcs::extra::kernel32::*; use libc::funcs::extra::kernel32::*;
import win32::*; use win32::*;
do fill_utf16_buf_and_decode() |buf, sz| { do fill_utf16_buf_and_decode() |buf, sz| {
GetModuleFileNameW(0u as dword, buf, sz) GetModuleFileNameW(0u as dword, buf, sz)
} }
@ -592,9 +592,9 @@ fn make_dir(p: &Path, mode: c_int) -> bool {
#[cfg(windows)] #[cfg(windows)]
fn mkdir(p: &Path, _mode: c_int) -> bool { fn mkdir(p: &Path, _mode: c_int) -> bool {
// FIXME: remove imports when export globs work properly. #1238 // FIXME: remove imports when export globs work properly. #1238
import libc::types::os::arch::extra::*; use libc::types::os::arch::extra::*;
import libc::funcs::extra::kernel32::*; use libc::funcs::extra::kernel32::*;
import win32::*; use win32::*;
// FIXME: turn mode into something useful? #2623 // FIXME: turn mode into something useful? #2623
do as_utf16_p(p.to_str()) |buf| { do as_utf16_p(p.to_str()) |buf| {
CreateDirectoryW(buf, unsafe { unsafe::reinterpret_cast(&0) }) CreateDirectoryW(buf, unsafe { unsafe::reinterpret_cast(&0) })
@ -641,9 +641,9 @@ fn remove_dir(p: &Path) -> bool {
#[cfg(windows)] #[cfg(windows)]
fn rmdir(p: &Path) -> bool { fn rmdir(p: &Path) -> bool {
// FIXME: remove imports when export globs work properly. #1238 // FIXME: remove imports when export globs work properly. #1238
import libc::funcs::extra::kernel32::*; use libc::funcs::extra::kernel32::*;
import libc::types::os::arch::extra::*; use libc::types::os::arch::extra::*;
import win32::*; use win32::*;
return do as_utf16_p(p.to_str()) |buf| { return do as_utf16_p(p.to_str()) |buf| {
RemoveDirectoryW(buf) != (0 as BOOL) RemoveDirectoryW(buf) != (0 as BOOL)
}; };
@ -663,9 +663,9 @@ fn change_dir(p: &Path) -> bool {
#[cfg(windows)] #[cfg(windows)]
fn chdir(p: &Path) -> bool { fn chdir(p: &Path) -> bool {
// FIXME: remove imports when export globs work properly. #1238 // FIXME: remove imports when export globs work properly. #1238
import libc::funcs::extra::kernel32::*; use libc::funcs::extra::kernel32::*;
import libc::types::os::arch::extra::*; use libc::types::os::arch::extra::*;
import win32::*; use win32::*;
return do as_utf16_p(p.to_str()) |buf| { return do as_utf16_p(p.to_str()) |buf| {
SetCurrentDirectoryW(buf) != (0 as BOOL) SetCurrentDirectoryW(buf) != (0 as BOOL)
}; };
@ -686,9 +686,9 @@ fn copy_file(from: &Path, to: &Path) -> bool {
#[cfg(windows)] #[cfg(windows)]
fn do_copy_file(from: &Path, to: &Path) -> bool { fn do_copy_file(from: &Path, to: &Path) -> bool {
// FIXME: remove imports when export globs work properly. #1238 // FIXME: remove imports when export globs work properly. #1238
import libc::funcs::extra::kernel32::*; use libc::funcs::extra::kernel32::*;
import libc::types::os::arch::extra::*; use libc::types::os::arch::extra::*;
import win32::*; use win32::*;
return do as_utf16_p(from.to_str()) |fromp| { return do as_utf16_p(from.to_str()) |fromp| {
do as_utf16_p(to.to_str()) |top| { do as_utf16_p(to.to_str()) |top| {
CopyFileW(fromp, top, (0 as BOOL)) != (0 as BOOL) CopyFileW(fromp, top, (0 as BOOL)) != (0 as BOOL)
@ -750,9 +750,9 @@ fn remove_file(p: &Path) -> bool {
fn unlink(p: &Path) -> bool { fn unlink(p: &Path) -> bool {
// FIXME (similar to Issue #2006): remove imports when export globs // FIXME (similar to Issue #2006): remove imports when export globs
// work properly. // work properly.
import libc::funcs::extra::kernel32::*; use libc::funcs::extra::kernel32::*;
import libc::types::os::arch::extra::*; use libc::types::os::arch::extra::*;
import win32::*; use win32::*;
return do as_utf16_p(p.to_str()) |buf| { return do as_utf16_p(p.to_str()) |buf| {
DeleteFileW(buf) != (0 as BOOL) DeleteFileW(buf) != (0 as BOOL)
}; };
@ -836,7 +836,6 @@ mod tests {
} }
fn make_rand_name() -> ~str { fn make_rand_name() -> ~str {
import rand;
let rng: rand::Rng = rand::Rng(); let rng: rand::Rng = rand::Rng();
let n = ~"TEST" + rng.gen_str(10u); let n = ~"TEST" + rng.gen_str(10u);
assert option::is_none(getenv(n)); assert option::is_none(getenv(n));

View File

@ -263,8 +263,8 @@ fn test() {
#[test] #[test]
fn test_position() { fn test_position() {
import str::as_c_str; use str::as_c_str;
import libc::c_char; use libc::c_char;
let s = ~"hello"; let s = ~"hello";
unsafe { unsafe {

View File

@ -8,7 +8,7 @@ use libc::c_void;
use libc::size_t; use libc::size_t;
use libc::uintptr_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)] #[allow(non_camel_case_types)]
type rust_task = c_void; type rust_task = c_void;

View File

@ -336,7 +336,7 @@ fn program_output(prog: &str, args: &[~str]) ->
} }
fn writeclose(fd: c_int, s: &str) { fn writeclose(fd: c_int, s: &str) {
import io::WriterUtil; use io::WriterUtil;
error!("writeclose %d, %s", fd as int, s); error!("writeclose %d, %s", fd as int, s);
let writer = io::fd_writer(fd, false); let writer = io::fd_writer(fd, false);
@ -402,7 +402,7 @@ fn waitpid(pid: pid_t) -> int {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
import io::WriterUtil; use io::WriterUtil;
// Regression test for memory leaks // Regression test for memory leaks
#[ignore(cfg(windows))] // FIXME (#2626) #[ignore(cfg(windows))] // FIXME (#2626)

View File

@ -362,7 +362,7 @@ mod linear {
#[test] #[test]
mod test { mod test {
import linear::LinearMap; use linear::LinearMap;
fn int_linear_map<V>() -> LinearMap<uint,V> { fn int_linear_map<V>() -> LinearMap<uint,V> {
return LinearMap(); return LinearMap();

View File

@ -2303,7 +2303,7 @@ impl &str: StrSlice {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
import libc::c_char; use libc::c_char;
#[test] #[test]
fn test_eq() { fn test_eq() {

View File

@ -276,7 +276,7 @@ fn test_from_str() {
#[test] #[test]
#[ignore] #[ignore]
fn test_parse_buf() { 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(~"123"), 10u) == Some(123u as T);
assert parse_buf(to_bytes(~"1001"), 2u) == Some(9u as T); assert parse_buf(to_bytes(~"1001"), 2u) == Some(9u as T);
assert parse_buf(to_bytes(~"123"), 8u) == Some(83u as T); assert parse_buf(to_bytes(~"123"), 8u) == Some(83u as T);
@ -304,7 +304,7 @@ fn to_str_radix17() {
#[test] #[test]
fn test_times() { fn test_times() {
import iter::Times; use iter::Times;
let ten = 10 as T; let ten = 10 as T;
let mut accum = 0; let mut accum = 0;
for ten.times { accum += 1; } for ten.times { accum += 1; }

View File

@ -444,7 +444,7 @@ impl<T: Const Send> &RWReadMode<T> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
import comm::*; use comm::*;
#[test] #[test]
fn manually_share_arc() { fn manually_share_arc() {

View File

@ -138,7 +138,7 @@ unsafe fn ptr<T>(t: CVec<T>) -> *mut T {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
import libc::*; use libc::*;
fn malloc(n: size_t) -> CVec<u8> { fn malloc(n: size_t) -> CVec<u8> {
let mem = libc::malloc(n); let mem = libc::malloc(n);

View File

@ -456,8 +456,8 @@ impl FailType : Eq {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
import opt = getopts; use opt = getopts;
import result::{Err, Ok}; use result::{Err, Ok};
fn check_fail_type(+f: Fail_, ft: FailType) { fn check_fail_type(+f: Fail_, ft: FailType) {
match f { match f {

View File

@ -1087,7 +1087,7 @@ mod tests {
#[test] #[test]
fn test_decode_form_urlencoded() { fn test_decode_form_urlencoded() {
import map::hash_from_strs; use map::hash_from_strs;
assert decode_form_urlencoded(~[]).size() == 0; assert decode_form_urlencoded(~[]).size() == 0;

View File

@ -848,7 +848,6 @@ impl Tm {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
import task;
#[test] #[test]
fn test_get_time() { fn test_get_time() {

View File

@ -181,7 +181,7 @@ mod test {
for spec.each |spec| { for spec.each |spec| {
let (times, maxms) = spec; let (times, maxms) = spec;
do task::spawn { do task::spawn {
import rand::*; use rand::*;
let rng = Rng(); let rng = Rng();
for iter::repeat(times) { for iter::repeat(times) {
sleep(hl_loop, rng.next() as uint % maxms); sleep(hl_loop, rng.next() as uint % maxms);

View File

@ -78,10 +78,8 @@ export expand;
// Transitional reexports so qquote can find the paths it is looking for // Transitional reexports so qquote can find the paths it is looking for
mod syntax { mod syntax {
import ext; pub use ext;
export ext; pub use parse;
import parse;
export parse;
} }
type ser_tps_map = map::HashMap<ast::ident, fn@(@ast::expr) -> ~[@ast::stmt]>; type ser_tps_map = map::HashMap<ast::ident, fn@(@ast::expr) -> ~[@ast::stmt]>;

View File

@ -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. // 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]) fn tt_args_to_original_flavor(cx: ext_ctxt, sp: span, arg: ~[ast::token_tree])
-> ast::mac_arg { -> ast::mac_arg {
import ast::{matcher, matcher_, match_tok, match_seq, match_nonterminal}; use ast::{matcher, matcher_, match_tok, match_seq, match_nonterminal};
import parse::lexer::{new_tt_reader, reader}; use parse::lexer::{new_tt_reader, reader};
import tt::macro_parser::{parse_or_else, matched_seq, use tt::macro_parser::{parse_or_else, matched_seq,
matched_nonterminal}; matched_nonterminal};
// these spans won't matter, anyways // these spans won't matter, anyways

View File

@ -10,10 +10,8 @@ use ext::base::mk_ctxt;
// Transitional reexports so qquote can find the paths it is looking for // Transitional reexports so qquote can find the paths it is looking for
mod syntax { mod syntax {
import ext; pub use ext;
export ext; pub use parse;
import parse;
export parse;
} }
fn path(ids: ~[ident], span: span) -> @ast::path { fn path(ids: ~[ident], span: span) -> @ast::path {

View File

@ -16,10 +16,8 @@ use ast_builder::{append_types, path, empty_span};
// Transitional reexports so qquote can find the paths it is looking for // Transitional reexports so qquote can find the paths it is looking for
mod syntax { mod syntax {
import ext; pub use ext;
export ext; pub use parse;
import parse;
export parse;
} }
trait gen_send { trait gen_send {
@ -321,7 +319,7 @@ impl protocol: gen_init {
}; };
cx.parse_item(fmt!("fn init%s() -> (client::%s, server::%s)\ 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.ty_params.to_source(cx),
start_state.to_ty(cx).to_source(cx), start_state.to_ty(cx).to_source(cx),
start_state.to_ty(cx).to_source(cx), start_state.to_ty(cx).to_source(cx),

View File

@ -3345,15 +3345,6 @@ impl parser {
vis: visibility, vis: visibility,
span: mk_sp(lo, self.last_span.hi) 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") { } else if self.eat_keyword(~"export") {
let view_paths = self.parse_view_paths(); let view_paths = self.parse_view_paths();
self.expect(token::SEMI); self.expect(token::SEMI);
@ -3506,7 +3497,6 @@ impl parser {
next_tok = self.look_ahead(2); next_tok = self.look_ahead(2);
}; };
self.token_is_keyword(~"use", tok) self.token_is_keyword(~"use", tok)
|| self.token_is_keyword(~"import", tok)
|| self.token_is_keyword(~"export", tok) || self.token_is_keyword(~"export", tok)
|| (self.token_is_keyword(~"extern", tok) && || (self.token_is_keyword(~"extern", tok) &&
self.token_is_keyword(~"mod", next_tok)) self.token_is_keyword(~"mod", next_tok))
@ -3516,8 +3506,6 @@ impl parser {
let lo = self.span.lo, vis = self.parse_visibility(); let lo = self.span.lo, vis = self.parse_visibility();
let node = if self.eat_keyword(~"use") { let node = if self.eat_keyword(~"use") {
self.parse_use(vis) self.parse_use(vis)
} else if self.eat_keyword(~"import") {
view_item_import(self.parse_view_paths())
} else if self.eat_keyword(~"export") { } else if self.eat_keyword(~"export") {
view_item_export(self.parse_view_paths()) view_item_export(self.parse_view_paths())
} else if self.eat_keyword(~"extern") { } else if self.eat_keyword(~"extern") {

View File

@ -279,7 +279,7 @@ pure fn is_bar(t: token) -> bool {
mod special_idents { mod special_idents {
import ast::ident; use ast::ident;
const underscore : ident = 0u; const underscore : ident = 0u;
const anon : ident = 1u; const anon : ident = 1u;
const dtor : ident = 2u; // 'drop', but that's reserved const dtor : ident = 2u; // 'drop', but that's reserved
@ -433,7 +433,7 @@ fn strict_keyword_table() -> HashMap<~str, ()> {
~"do", ~"drop", ~"do", ~"drop",
~"else", ~"enum", ~"export", ~"extern", ~"else", ~"enum", ~"export", ~"extern",
~"false", ~"for", ~"false", ~"for",
~"if", ~"import", ~"if",
~"let", ~"log", ~"loop", ~"let", ~"log", ~"loop",
~"match", ~"mod", ~"move", ~"mut", ~"match", ~"mod", ~"move", ~"mut",
~"pure", ~"pure",

View File

@ -1757,7 +1757,7 @@ fn print_view_item(s: ps, item: @ast::view_item) {
} }
ast::view_item_import(vps) => { ast::view_item_import(vps) => {
head(s, ~"import"); head(s, ~"use");
print_view_paths(s, vps); print_view_paths(s, vps);
} }

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 { fn sess_os_to_meta_os(os: os) -> metadata::loader::os {
import metadata::loader; use metadata::loader;
match os { match os {
os_win32 => loader::os_win32, os_win32 => loader::os_win32,
@ -308,7 +308,7 @@ fn sess_os_to_meta_os(os: os) -> metadata::loader::os {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
import syntax::ast_util; use syntax::ast_util;
fn make_crate_type_attr(t: ~str) -> ast::attribute { fn make_crate_type_attr(t: ~str) -> ast::attribute {
ast_util::respan(ast_util::dummy_sp(), { ast_util::respan(ast_util::dummy_sp(), {

View File

@ -3,10 +3,8 @@
// no dependencies on rustc it can move into its own crate. // no dependencies on rustc it can move into its own crate.
mod middle { mod middle {
import ty = middle_::ty; pub use middle_::ty;
export ty; pub use middle_::resolve;
import resolve = middle_::resolve;
export resolve;
} }
mod front { mod front {
@ -19,11 +17,9 @@ mod driver {
} }
mod util { mod util {
import ppaux = util_::ppaux; pub use util_::ppaux;
export ppaux;
} }
mod lib { mod lib {
import llvm = lib_::llvm; pub use lib_::llvm;
export 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, fn warn_if_multiple_versions(e: env, diag: span_handler,
crate_cache: ~[cache_entry]) { crate_cache: ~[cache_entry]) {
import either::*; use either::*;
if crate_cache.len() != 0u { if crate_cache.len() != 0u {
let name = loader::crate_name_from_metas(*crate_cache.last().metas); 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 // FIXME: issue #1417
fn eval_const_expr(tcx: middle::ty::ctxt, e: @expr) -> const_val { 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) } fn fromb(b: bool) -> const_val { const_int(b as i64) }
match e.node { match e.node {
expr_unary(neg, inner) => { 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) name: ~str, f: fn(block) -> datum::DatumBlock)
-> datum::DatumBlock -> datum::DatumBlock
{ {
import datum::DatumBlock; use datum::DatumBlock;
let _icx = bcx.insn_ctxt("with_scope_result"); let _icx = bcx.insn_ctxt("with_scope_result");
let scope_cx = scope_block(bcx, opt_node_info, name); 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, fn emit_calls_to_trait_visit_ty(bcx: block, t: ty::t,
visitor_val: ValueRef, visitor_val: ValueRef,
visitor_trait_id: def_id) -> block { 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"); let final = sub_block(bcx, ~"final");
assert bcx.ccx().tcx.intrinsic_defs.contains_key(tydesc); assert bcx.ccx().tcx.intrinsic_defs.contains_key(tydesc);
let (_, tydesc_ty) = bcx.ccx().tcx.intrinsic_defs.get(tydesc); let (_, tydesc_ty) = bcx.ccx().tcx.intrinsic_defs.get(tydesc);

View File

@ -104,7 +104,7 @@ fn exec<T:Send>(
fn build_ctxt(sess: session, fn build_ctxt(sess: session,
ast: @ast::crate) -> ctxt { ast: @ast::crate) -> ctxt {
import rustc::front::config; use rustc::front::config;
let ast = config::strip_unconfigured_items(ast); let ast = config::strip_unconfigured_items(ast);
let ast = syntax::ext::expand::expand_crate(sess.parse_sess, let ast = syntax::ext::expand::expand_crate(sess.parse_sess,
@ -201,7 +201,7 @@ fn srv_should_build_ast_map() {
#[test] #[test]
fn should_ignore_external_import_paths_that_dont_exist() { 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| { } ) from_str(source, |_srv| { } )
} }

View File

@ -21,11 +21,11 @@ type crate_attrs = {
mod test { mod test {
fn parse_attributes(source: ~str) -> ~[ast::attribute] { fn parse_attributes(source: ~str) -> ~[ast::attribute] {
import syntax::parse; use syntax::parse;
import parse::parser; use parse::parser;
import parse::attr::parser_attr; use parse::attr::parser_attr;
import syntax::codemap; use syntax::codemap;
import syntax::diagnostic; use syntax::diagnostic;
let parse_sess = syntax::parse::new_parse_sess(None); let parse_sess = syntax::parse::new_parse_sess(None);
let parser = parse::new_parser_from_source_str( let parser = parse::new_parser_from_source_str(

View File

@ -71,7 +71,7 @@ fn opts() -> ~[(getopts::Opt, ~str)] {
} }
fn usage() { fn usage() {
import io::println; use io::println;
println(~"Usage: rustdoc ~[options] <cratefile>\n"); println(~"Usage: rustdoc ~[options] <cratefile>\n");
println(~"Options:\n"); println(~"Options:\n");

View File

@ -89,7 +89,7 @@ fn pandoc_writer(
]; ];
do generic_writer |markdown| { do generic_writer |markdown| {
import io::WriterUtil; use io::WriterUtil;
debug!("pandoc cmd: %s", pandoc_cmd); debug!("pandoc cmd: %s", pandoc_cmd);
debug!("pandoc args: %s", str::connect(pandoc_args, ~" ")); debug!("pandoc args: %s", str::connect(pandoc_args, ~" "));
@ -255,7 +255,7 @@ mod test {
} }
fn write_file(path: &Path, s: ~str) { fn write_file(path: &Path, s: ~str) {
import io::WriterUtil; use io::WriterUtil;
match io::file_writer(path, ~[io::Create, io::Truncate]) { match io::file_writer(path, ~[io::Create, io::Truncate]) {
result::Ok(writer) => { result::Ok(writer) => {

View File

@ -34,7 +34,7 @@ fn fold_mod(
} }
fn is_hidden(srv: astsrv::srv, doc: doc::itemdoc) -> bool { fn is_hidden(srv: astsrv::srv, doc: doc::itemdoc) -> bool {
import syntax::ast_map; use syntax::ast_map;
let id = doc.id; let id = doc.id;
do astsrv::exec(srv) |ctxt| { do astsrv::exec(srv) |ctxt| {

View File

@ -19,8 +19,8 @@ use std(vers = "0.4");
use rustc(vers = "0.4"); use rustc(vers = "0.4");
use syntax(vers = "0.4"); use syntax(vers = "0.4");
import core::*; use core::*;
import std::par; use std::par;
mod config; mod config;
mod parse; mod parse;

View File

@ -72,7 +72,7 @@ fn switch<T: Send, Tb: Send, U>(+endp: pipes::RecvPacketBuffered<T, Tb>,
// Here's the benchmark // Here's the benchmark
fn bounded(count: uint) { fn bounded(count: uint) {
import pingpong::*; use pingpong::*;
let mut ch = do spawn_service(init) |ch| { let mut ch = do spawn_service(init) |ch| {
let mut count = count; let mut count = count;
@ -99,7 +99,7 @@ fn bounded(count: uint) {
} }
fn unbounded(count: uint) { fn unbounded(count: uint) {
import pingpong_unbounded::*; use pingpong_unbounded::*;
let mut ch = do spawn_service(init) |ch| { let mut ch = do spawn_service(init) |ch| {
let mut count = count; let mut count = count;

View File

@ -4,7 +4,7 @@ use std;
const n_threads: int = 503; const n_threads: int = 503;
fn start(+token: int) { fn start(+token: int) {
import iter::*; use iter::*;
let p = comm::Port(); let p = comm::Port();
let mut ch = comm::Chan(p); let mut ch = comm::Chan(p);

View File

@ -1,7 +1,7 @@
// error-pattern: unresolved // error-pattern: unresolved
mod circ1 { mod circ1 {
import circ1::*; use circ1::*;
export f1; export f1;
export f2; export f2;
export common; export common;
@ -10,7 +10,7 @@ mod circ1 {
} }
mod circ2 { mod circ2 {
import circ2::*; use circ2::*;
export f1; export f1;
export f2; export f2;
export common; export common;
@ -19,7 +19,7 @@ mod circ2 {
} }
mod test { mod test {
import circ1::*; use circ1::*;
fn test() { f1066(); } fn test() { f1066(); }
} }

View File

@ -3,8 +3,7 @@
// we let an impl method can have more permissive bounds than the trait // 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 // method it's implementing, the return type might be less specific than
// needed. Just punt and make it invariant. // needed. Just punt and make it invariant.
import iter; use iter::BaseIter;
import iter::BaseIter;
trait A { trait A {
fn b<C:Copy Const, D>(x: C) -> C; fn b<C:Copy Const, D>(x: C) -> C;

View File

@ -1,7 +1,6 @@
// Tests that an impl method's bounds aren't *more* restrictive // Tests that an impl method's bounds aren't *more* restrictive
// than the trait method it's implementing // than the trait method it's implementing
import iter; use iter::BaseIter;
import iter::BaseIter;
trait A { trait A {
fn b<C:Copy, D>(x: C) -> C; fn b<C:Copy, D>(x: C) -> C;

View File

@ -1,7 +1,6 @@
// Tests that ty params get matched correctly when comparing // Tests that ty params get matched correctly when comparing
// an impl against a trait // an impl against a trait
import iter; use iter::BaseIter;
import iter::BaseIter;
trait A { trait A {
fn b<C:Copy, D>(x: C) -> C; fn b<C:Copy, D>(x: C) -> C;

View File

@ -7,7 +7,7 @@ mod bar {
} }
fn main() { fn main() {
import bar::{alpha, charlie}; use bar::{alpha, charlie};
match alpha { match alpha {
alpha | beta => {} //~ ERROR variable `beta` from pattern #2 is not bound in pattern #1 alpha | beta => {} //~ ERROR variable `beta` from pattern #2 is not bound in pattern #1
charlie => {} charlie => {}

View File

@ -1,7 +1,7 @@
mod argparse { mod argparse {
use std; use std;
import either::{Either, Left, Right}; use either::{Either, Left, Right};
struct Flag { struct Flag {
name: &str, name: &str,

View File

@ -9,8 +9,8 @@ mod foo {
mod bar { mod bar {
mod c { mod c {
import foo::point; use foo::point;
import foo::square; use foo::square;
fn cc(p: point) -> str { return 2 * (p.x + p.y); } fn cc(p: point) -> str { return 2 * (p.x + p.y); }
} }
} }

View File

@ -4,7 +4,7 @@
// Modified to not use export since it's going away. --pcw // Modified to not use export since it's going away. --pcw
mod foo { mod foo {
import bar::*; use bar::*;
mod bar { mod bar {
const a : int = 10; const a : int = 10;
} }

View File

@ -4,7 +4,7 @@
// Modified to not use export since it's going away. --pcw // Modified to not use export since it's going away. --pcw
mod foo { mod foo {
import bar::*; use bar::*;
export a; export a;
mod bar { mod bar {
const a : int = 10; const a : int = 10;

View File

@ -6,7 +6,6 @@
use std; use std;
use option = option;
use option::Some; use option::Some;
use option::None; use option::None;
use std::map; use std::map;

View File

@ -5,7 +5,7 @@ mod spam {
#[abi = "cdecl"] #[abi = "cdecl"]
extern mod rustrt { extern mod rustrt {
import spam::{ham, eggs}; use spam::{ham, eggs};
export ham; export ham;
export eggs; export eggs;
} }

View File

@ -4,14 +4,14 @@ mod a1 {
// //
mod b1 { mod b1 {
// //
import a2::b1::*; use a2::b1::*;
// <-\ // <-\
export word_traveler; // | export word_traveler; // |
} }
// | // |
mod b2 { mod b2 {
// | // |
import a2::b2::*; use a2::b2::*;
// <-\ -\ | // <-\ -\ |
export word_traveler; // | | | export word_traveler; // | | |
} // | | | } // | | |
@ -24,7 +24,7 @@ mod a2 {
#[nolink] #[nolink]
extern mod b1 { extern mod b1 {
// | | | // | | |
import a1::b2::*; use a1::b2::*;
// | <-/ -/ // | <-/ -/
export word_traveler; // | export word_traveler; // |
} }

View File

@ -1,11 +1,10 @@
use std; use std;
fn main() { fn main() {
import vec; use vec::to_mut;
import vec::to_mut;
log(debug, vec::len(to_mut(~[1, 2]))); log(debug, vec::len(to_mut(~[1, 2])));
{ {
import vec::*; use vec::*;
log(debug, len(~[2])); log(debug, len(~[2]));
} }
} }

View File

@ -3,8 +3,8 @@ mod foo {
} }
mod bar { mod bar {
import foo::x; use foo::x;
import z = foo::x; use z = foo::x;
fn thing() { x(10); z(10); } fn thing() { x(10); z(10); }
} }

View File

@ -1,6 +1,6 @@
use foo::bar; use foo::bar;
mod foo { mod foo {
import zed::bar; use zed::bar;
export bar; export bar;
mod zed { mod zed {
fn bar() { debug!("foo"); } fn bar() { debug!("foo"); }

View File

@ -6,7 +6,7 @@ mod foo {
} }
} }
mod bar { mod bar {
import zed::baz; use zed::baz;
export baz; export baz;
} }
fn main() { baz(); } fn main() { baz(); }

View File

@ -6,7 +6,7 @@ mod foo {
} }
} }
mod bar { mod bar {
import zed::baz; use zed::baz;
export baz; export baz;
mod foo { mod foo {
mod zed { } mod zed { }

View File

@ -1,5 +1,5 @@
mod pipes { mod pipes {
import unsafe::{forget, transmute}; use unsafe::{forget, transmute};
enum state { enum state {
empty, empty,

View File

@ -5,8 +5,7 @@
// begin failing. // begin failing.
mod m { mod m {
use std; use core::vec;
import vec;
fn f() -> ~[int] { vec::from_elem(1u, 0) } fn f() -> ~[int] { vec::from_elem(1u, 0) }
} }

View File

@ -2,7 +2,7 @@
mod my_float { mod my_float {
// The type of the float // The type of the float
import inst::T; use inst::T;
// Define T as float // Define T as float
#[path = "inst_float.rs"] #[path = "inst_float.rs"]
@ -17,7 +17,7 @@ mod my_float {
#[path = "module-polymorphism-files"] #[path = "module-polymorphism-files"]
mod my_f64 { mod my_f64 {
import inst::T; use inst::T;
// Define T as f64 // Define T as f64
#[path = "inst_f64.rs"] #[path = "inst_f64.rs"]
@ -31,7 +31,7 @@ mod my_f64 {
#[path = "module-polymorphism-files"] #[path = "module-polymorphism-files"]
mod my_f32 { mod my_f32 {
import inst::T; use inst::T;
#[path = "inst_f32.rs"] #[path = "inst_f32.rs"]
mod inst; mod inst;

View File

@ -4,10 +4,10 @@ mod mystd {
#[path = "float-template"] #[path = "float-template"]
mod float { mod float {
// The type of the float // The type of the float
import inst::T; use inst::T;
// Unfortunate // Unfortunate
import template::*; use template::*;
export plus; export plus;
// Define T as float // Define T as float
@ -23,10 +23,10 @@ mod mystd {
#[path = "float-template"] #[path = "float-template"]
mod f64 { mod f64 {
import inst::T; use inst::T;
// Unfortunate // Unfortunate
import template::*; use template::*;
export plus; export plus;
// Define T as f64 // Define T as f64
@ -41,10 +41,10 @@ mod mystd {
#[path = "float-template"] #[path = "float-template"]
mod f32 { mod f32 {
import inst::T; use inst::T;
// Unfortunate // Unfortunate
import template::*; use template::*;
export plus; export plus;
#[path = "inst_f32.rs"] #[path = "inst_f32.rs"]

View File

@ -8,7 +8,7 @@ mod mystd {
#[path = "float-template"] #[path = "float-template"]
mod float { mod float {
// The type of the float // The type of the float
import inst::T; use inst::T;
// Define T as appropriate for platform // Define T as appropriate for platform
#[path = "inst_float.rs"] #[path = "inst_float.rs"]
@ -19,7 +19,7 @@ mod mystd {
#[path = "float-template"] #[path = "float-template"]
mod f64 { mod f64 {
import inst::T; use inst::T;
// Define T as f64 // Define T as f64
#[path = "inst_f64.rs"] #[path = "inst_f64.rs"]
@ -28,7 +28,7 @@ mod mystd {
#[path = "float-template"] #[path = "float-template"]
mod f32 { mod f32 {
import inst::T; use inst::T;
#[path = "inst_f32.rs"] #[path = "inst_f32.rs"]
mod inst; mod inst;

View File

@ -2,7 +2,7 @@
#[path = "module-polymorphism4-files"] #[path = "module-polymorphism4-files"]
mod cat { mod cat {
import inst::*; use inst::*;
#[path = "cat.rs"] #[path = "cat.rs"]
mod inst; mod inst;
@ -15,7 +15,7 @@ mod cat {
#[path = "module-polymorphism4-files"] #[path = "module-polymorphism4-files"]
mod dog { mod dog {
import inst::*; use inst::*;
#[path = "dog.rs"] #[path = "dog.rs"]
mod inst; mod inst;

View File

@ -57,7 +57,7 @@ macro_rules! follow (
) )
fn client_follow(+bank: bank::client::login) { fn client_follow(+bank: bank::client::login) {
import bank::*; use bank::*;
let bank = client::login(bank, ~"theincredibleholk", ~"1234"); let bank = client::login(bank, ~"theincredibleholk", ~"1234");
let bank = switch(bank, follow! ( let bank = switch(bank, follow! (
@ -78,7 +78,7 @@ fn client_follow(+bank: bank::client::login) {
} }
fn bank_client(+bank: bank::client::login) { fn bank_client(+bank: bank::client::login) {
import bank::*; use bank::*;
let bank = client::login(bank, ~"theincredibleholk", ~"1234"); let bank = client::login(bank, ~"theincredibleholk", ~"1234");
let bank = match try_recv(bank) { let bank = match try_recv(bank) {

View File

@ -7,7 +7,7 @@
// This was generated initially by the pipe compiler, but it's been // This was generated initially by the pipe compiler, but it's been
// modified in hopefully straightforward ways. // modified in hopefully straightforward ways.
mod pingpong { mod pingpong {
import pipes::*; use pipes::*;
type packets = { type packets = {
// This is probably a resolve bug, I forgot to export packet, // This is probably a resolve bug, I forgot to export packet,
@ -67,11 +67,11 @@ mod pingpong {
} }
mod test { mod test {
import pipes::recv; use pipes::recv;
import pingpong::{ping, pong}; use pingpong::{ping, pong};
fn client(-chan: pingpong::client::ping) { fn client(-chan: pingpong::client::ping) {
import pingpong::client; use pingpong::client;
let chan = client::ping(chan); return; let chan = client::ping(chan); return;
log(error, "Sent ping"); log(error, "Sent ping");
@ -80,7 +80,7 @@ mod test {
} }
fn server(-chan: pingpong::server::ping) { fn server(-chan: pingpong::server::ping) {
import pingpong::server; use pingpong::server;
let ping(chan) = recv(chan); return; let ping(chan) = recv(chan); return;
log(error, "Received ping"); log(error, "Received ping");

View File

@ -13,11 +13,11 @@ proto! pingpong (
) )
mod test { mod test {
import pipes::recv; use pipes::recv;
import pingpong::{ping, pong}; use pingpong::{ping, pong};
fn client(-chan: pingpong::client::ping) { fn client(-chan: pingpong::client::ping) {
import pingpong::client; use pingpong::client;
let chan = client::ping(chan); let chan = client::ping(chan);
log(error, ~"Sent ping"); log(error, ~"Sent ping");
@ -26,7 +26,7 @@ mod test {
} }
fn server(-chan: pingpong::server::ping) { fn server(-chan: pingpong::server::ping) {
import pingpong::server; use pingpong::server;
let ping(chan) = recv(chan); let ping(chan) = recv(chan);
log(error, ~"Received ping"); log(error, ~"Received ping");

View File

@ -28,7 +28,7 @@ fn macros() {
// Code // Code
fn test(+foo: foo::client::foo, +bar: bar::client::bar) { fn test(+foo: foo::client::foo, +bar: bar::client::bar) {
import bar::do_baz; use bar::do_baz;
select! ( select! (
foo => { foo => {

View File

@ -20,8 +20,8 @@ proto! stream (
) )
fn main() { fn main() {
import oneshot::client::*; use oneshot::client::*;
import stream::client::*; use stream::client::*;
let iotask = uv::global_loop::get(); let iotask = uv::global_loop::get();

View File

@ -12,7 +12,7 @@ proto! oneshot (
) )
fn main() { fn main() {
import oneshot::client::*; use oneshot::client::*;
let c = pipes::spawn_service(oneshot::init, |p| { recv(p); }); let c = pipes::spawn_service(oneshot::init, |p| { recv(p); });

View File

@ -7,7 +7,7 @@ mod a {
} }
mod c { mod c {
import a::b::a; use a::b::a;
fn bar() { assert (a::foo() == 1); } fn bar() { assert (a::foo() == 1); }
} }

View File

@ -7,8 +7,8 @@ use bar(name = "core", vers = "0.4");
use core::str; use core::str;
use x = zed::str; use x = zed::str;
mod baz { mod baz {
import bar::str; use bar::str;
import x = core::str; use x = core::str;
} }
fn main() { } fn main() { }