about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-09-07 18:08:21 -0700
committerBrian Anderson <banderson@mozilla.com>2012-09-10 19:04:26 -0700
commit298eb8c7260fe321e30d9c5e22f4ecefc82c4f64 (patch)
treeddd18bdc6c940595bd1df41cfa5d414ffa862a5d /src/test
parent1a8a0a77b14c44d98501cd9fb0f14ed88d4c38d9 (diff)
downloadrust-298eb8c7260fe321e30d9c5e22f4ecefc82c4f64.tar.gz
rust-298eb8c7260fe321e30d9c5e22f4ecefc82c4f64.zip
Convert 'import' to 'use'. Remove 'import' keyword.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/bench/pingpong.rs4
-rw-r--r--src/test/bench/shootout-threadring.rs2
-rw-r--r--src/test/compile-fail/import-glob-circular.rs6
-rw-r--r--src/test/compile-fail/issue-2611-3.rs3
-rw-r--r--src/test/compile-fail/issue-2611-4.rs3
-rw-r--r--src/test/compile-fail/issue-2611-5.rs3
-rw-r--r--src/test/compile-fail/issue-2848.rs2
-rw-r--r--src/test/compile-fail/regions-glb-free-free.rs2
-rw-r--r--src/test/compile-fail/unused-imports-warn.rs4
-rw-r--r--src/test/run-pass/export-glob-imports-target.rs2
-rw-r--r--src/test/run-pass/export-glob.rs2
-rw-r--r--src/test/run-pass/hashmap-memory.rs1
-rw-r--r--src/test/run-pass/import-from-foreign.rs2
-rw-r--r--src/test/run-pass/import-glob-1.rs6
-rw-r--r--src/test/run-pass/import-in-block.rs5
-rw-r--r--src/test/run-pass/import.rs4
-rw-r--r--src/test/run-pass/import5.rs2
-rw-r--r--src/test/run-pass/import6.rs2
-rw-r--r--src/test/run-pass/import7.rs2
-rw-r--r--src/test/run-pass/issue-2718.rs2
-rw-r--r--src/test/run-pass/mod-view-items.rs3
-rw-r--r--src/test/run-pass/module-polymorphism.rc6
-rw-r--r--src/test/run-pass/module-polymorphism2.rc12
-rw-r--r--src/test/run-pass/module-polymorphism3.rc6
-rw-r--r--src/test/run-pass/module-polymorphism4.rc4
-rw-r--r--src/test/run-pass/pipe-bank-proto.rs4
-rw-r--r--src/test/run-pass/pipe-pingpong-bounded.rs10
-rw-r--r--src/test/run-pass/pipe-pingpong-proto.rs8
-rw-r--r--src/test/run-pass/pipe-select-macro.rs2
-rw-r--r--src/test/run-pass/pipe-select.rs4
-rw-r--r--src/test/run-pass/pipe-sleep.rs2
-rw-r--r--src/test/run-pass/self-shadowing-import.rs2
-rw-r--r--src/test/run-pass/use.rs4
33 files changed, 60 insertions, 66 deletions
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<T: Send, Tb: Send, U>(+endp: pipes::RecvPacketBuffered<T, Tb>,
 // 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<C:Copy Const, D>(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<C:Copy, D>(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<C:Copy, D>(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