]> git.lizzy.rs Git - rust.git/commitdiff
Remove re-exports of std::io::stdio::{print, println} in the prelude.
authorBrendan Zabarauskas <bjzaba@yahoo.com.au>
Thu, 9 Jan 2014 10:06:55 +0000 (21:06 +1100)
committerBrendan Zabarauskas <bjzaba@yahoo.com.au>
Fri, 10 Jan 2014 23:46:00 +0000 (10:46 +1100)
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.

130 files changed:
doc/guide-conditions.md
doc/guide-container.md
doc/guide-pointers.md
doc/guide-rustpkg.md
doc/guide-tasks.md
doc/rust.md
doc/tutorial.md
src/compiletest/compiletest.rs
src/compiletest/util.rs
src/libextra/getopts.rs
src/libextra/test.rs
src/libextra/url.rs
src/libextra/uuid.rs
src/libextra/workcache.rs
src/librustc/lib.rs
src/librustc/metadata/encoder.rs
src/librustc/middle/borrowck/mod.rs
src/librustc/middle/trans/base.rs
src/librustdoc/lib.rs
src/librustpkg/context.rs
src/librustpkg/lib.rs
src/librustpkg/source_control.rs
src/librustpkg/testsuite/fail/src/no-inferred-crates/src/zzyzx.rs
src/librustpkg/testsuite/pass/src/c-dependencies/pkg.rs
src/librustpkg/testsuite/pass/src/hello-world/main.rs
src/librustpkg/usage.rs
src/libstd/bool.rs
src/libstd/condition.rs
src/libstd/io/mod.rs
src/libstd/io/signal.rs
src/libstd/iter.rs
src/libstd/ops.rs
src/libstd/option.rs
src/libstd/prelude.rs
src/libstd/rand/mod.rs
src/libstd/rand/reseeding.rs
src/libstd/repr.rs
src/libstd/str.rs
src/libstd/vec.rs
src/libsyntax/ast_util.rs
src/libsyntax/ext/expand.rs
src/libsyntax/ext/log_syntax.rs
src/libsyntax/parse/lexer.rs
src/test/auxiliary/explicit_self_xcrate.rs
src/test/auxiliary/moves_based_on_type_lib.rs
src/test/bench/core-map.rs
src/test/bench/core-set.rs
src/test/bench/noise.rs
src/test/bench/shootout-binarytrees.rs
src/test/bench/shootout-chameneos-redux.rs
src/test/bench/shootout-fannkuch-redux.rs
src/test/bench/shootout-k-nucleotide-pipes.rs
src/test/bench/shootout-mandelbrot.rs
src/test/bench/shootout-meteor.rs
src/test/bench/shootout-pidigits.rs
src/test/compile-fail/borrowck-loan-local-as-both-mut-and-imm.rs
src/test/compile-fail/borrowck-move-out-of-struct-with-dtor.rs
src/test/compile-fail/borrowck-ref-into-rvalue.rs
src/test/compile-fail/by-move-pattern-binding.rs
src/test/compile-fail/circular_modules_hello.rs
src/test/compile-fail/closure-reform-bad.rs
src/test/compile-fail/drop-on-non-struct.rs
src/test/compile-fail/explicit-call-to-dtor.rs
src/test/compile-fail/explicit-call-to-supertrait-dtor.rs
src/test/compile-fail/functional-struct-update-noncopyable.rs
src/test/compile-fail/issue-10412.rs
src/test/compile-fail/issue-2548.rs
src/test/compile-fail/issue-3953.rs
src/test/compile-fail/issue-3973.rs
src/test/compile-fail/issue-5060-fail.rs
src/test/compile-fail/match-vec-unreachable.rs
src/test/compile-fail/moves-based-on-type-block-bad.rs
src/test/compile-fail/moves-based-on-type-capture-clause-bad.rs
src/test/compile-fail/no-implicit-prelude-nested.rs
src/test/compile-fail/no-implicit-prelude.rs
src/test/compile-fail/refutable-pattern-in-fn-arg.rs
src/test/compile-fail/repeat-to-run-dtor-twice.rs
src/test/compile-fail/uninhabited-enum-cast.rs
src/test/compile-fail/unique-object-noncopyable.rs
src/test/compile-fail/use-after-move-based-on-type.rs
src/test/compile-fail/use-after-move-self-based-on-type.rs
src/test/compile-fail/use-after-move-self.rs
src/test/debug-info/function-arg-initialization.rs
src/test/debug-info/function-prologue-stepping-no-split-stack.rs
src/test/run-pass/anon-trait-static-method.rs
src/test/run-pass/anon_trait_static_method_exe.rs
src/test/run-pass/auto-ref-bounded-ty-param.rs
src/test/run-pass/bare-static-string.rs
src/test/run-pass/boxed-trait-with-vstore.rs
src/test/run-pass/closure-reform.rs
src/test/run-pass/default-method-simple.rs
src/test/run-pass/drop-trait-generic.rs
src/test/run-pass/drop-trait.rs
src/test/run-pass/expr-repeat-vstore.rs
src/test/run-pass/extern-mod-syntax.rs
src/test/run-pass/float-literal-inference.rs
src/test/run-pass/fn-pattern-expected-type-2.rs
src/test/run-pass/hello.rs
src/test/run-pass/impl-privacy-xc-2.rs
src/test/run-pass/issue-3389.rs
src/test/run-pass/issue-3447.rs
src/test/run-pass/issue-3702.rs
src/test/run-pass/issue-3847.rs
src/test/run-pass/issue-4025.rs
src/test/run-pass/issue-4241.rs
src/test/run-pass/issue-4446.rs
src/test/run-pass/issue-4541.rs
src/test/run-pass/issue-5060.rs
src/test/run-pass/issue-5321-immediates-with-bare-self.rs
src/test/run-pass/issue-5708.rs
src/test/run-pass/issue-7012.rs
src/test/run-pass/issue-7563.rs
src/test/run-pass/issue-8498.rs
src/test/run-pass/let-assignability.rs
src/test/run-pass/match-drop-strs-issue-4541.rs
src/test/run-pass/move-self.rs
src/test/run-pass/moves-based-on-type-capture-clause.rs
src/test/run-pass/multibyte.rs
src/test/run-pass/new-impl-syntax.rs
src/test/run-pass/new-import-syntax.rs
src/test/run-pass/option-ext.rs
src/test/run-pass/pattern-in-closure.rs
src/test/run-pass/shebang.rs
src/test/run-pass/tag-disr-val-shape.rs
src/test/run-pass/trait-coercion-generic.rs
src/test/run-pass/trait-coercion.rs
src/test/run-pass/trait-inheritance-self.rs
src/test/run-pass/trait-region-pointer-simple.rs
src/test/run-pass/trait-static-method-overwriting.rs
src/test/run-pass/unit-like-struct.rs

index 2b5b9bbd5fe989f09690c0971e64994d091f7fc1..d7b6608ad45a4e4e83c4fe25eab2e440ca9bfc0e 100644 (file)
@@ -275,7 +275,7 @@ fn main() {
 
     };
     if result.is_err() {
-            println("parsing failed");
+            println!("parsing failed");
     }
 }
 
index ef37db53da7a8fd730e80982afae9e786c8d3455..668e263697c9da5aafefcd58d8c3d040ef395fdf 100644 (file)
@@ -218,12 +218,12 @@ let xs = [2u, 3, 5, 7, 11, 13, 17];
 
 // print out all the elements in the vector
 for x in xs.iter() {
-    println(x.to_str())
+    println!("{}", *x)
 }
 
 // print out all but the first 3 elements in the vector
 for x in xs.iter().skip(3) {
-    println(x.to_str())
+    println!("{}", *x)
 }
 ~~~
 
index 57a0b773d433ac3434dfd70dc74920e5e672ca27..caa149c6e140f8406bc0988b87fd4d00a8586de7 100644 (file)
@@ -222,7 +222,7 @@ struct Point {
 fn main() {
     let a = Point { x: 10, y: 20 };
     do spawn {
-        println(a.x.to_str());
+        println!("{}", a.x);
     }
 }
 ~~~
@@ -239,7 +239,7 @@ struct Point {
 fn main() {
     let a = ~Point { x: 10, y: 20 };
     do spawn {
-        println(a.x.to_str());
+        println!("{}", a.x);
     }
 }
 ~~~
@@ -270,18 +270,22 @@ struct Point {
 fn main() {
     let a = ~Point { x: 10, y: 20 };
     let b = a;
-    println(b.x.to_str());
-    println(a.x.to_str());
+    println!("{}", b.x);
+    println!("{}", a.x);
 }
 ~~~
 
 You'll get this error:
 
 ~~~ {.notrust}
-test.rs:10:12: 10:13 error: use of moved value: `a`
-test.rs:10     println(a.x.to_str());
-                       ^
-test.rs:8:8: 8:9 note: `a` moved here because it has type `~Point`, which is moved by default (use `ref` to override)
+test.rs:10:20: 10:21 error: use of moved value: `a`
+test.rs:10     println!("{}", a.x);
+                              ^
+note: in expansion of format_args!
+<std-macros>:158:27: 158:81 note: expansion site
+<std-macros>:157:5: 159:6 note: in expansion of println!
+test.rs:10:5: 10:25 note: expansion site
+test.rs:8:9: 8:10 note: `a` moved here because it has type `~Point`, which is moved by default (use `ref` to override)
 test.rs:8     let b = a;
                   ^
 ~~~
@@ -297,8 +301,8 @@ struct Point {
 fn main() {
     let a = @Point { x: 10, y: 20 };
     let b = a;
-    println(b.x.to_str());
-    println(a.x.to_str());
+    println!("{}", b.x);
+    println!("{}", a.x);
 }
 ~~~
 
@@ -367,7 +371,7 @@ compile?
 
 ~~~rust{.xfail-test}
 fn main() {
-    println(x.to_str());
+    println!("{}", x);
     let x = 5;
 }
 ~~~
index a8265cc5b7a68fa50b01895e1bd751d1d5ae7634..eccdf249156a93c6142b5c4121baf7e9ee623c6b 100644 (file)
@@ -143,7 +143,7 @@ Next, let's add a source file:
 #[license = "MIT"];
 
 pub fn world() {
-    println("Hello, world.");
+    println!("Hello, world.");
 }
 ~~~
 
index 57ed788aa2aea15043c2e77b6a0baf24a36498e4..80261314d2abd8e211cbe5d7d18c47590d7113e3 100644 (file)
@@ -72,15 +72,15 @@ closure in the new task.
 # use std::task::spawn;
 
 // Print something profound in a different task using a named function
-fn print_message() { println("I am running in a different task!"); }
+fn print_message() { println!("I am running in a different task!"); }
 spawn(print_message);
 
 // Print something more profound in a different task using a lambda expression
-spawn(proc() println("I am also running in a different task!") );
+spawn(proc() println!("I am also running in a different task!") );
 
 // The canonical way to spawn is using `do` notation
 do spawn {
-    println("I too am running in a different task!");
+    println!("I too am running in a different task!");
 }
 ~~~~
 
index 0024bb71116579c1827c9089d1a5d8c14cf48655..8e967ea780e046092b8a939ef1a5e92b517062bf 100644 (file)
@@ -2668,7 +2668,7 @@ An example:
 let mut i = 0;
 
 while i < 10 {
-    println("hello\n");
+    println!("hello");
     i = i + 1;
 }
 ~~~~
@@ -3267,7 +3267,7 @@ impl Printable for int {
 }
 
 fn print(a: @Printable) {
-   println(a.to_string());
+   println!("{}", a.to_string());
 }
 
 fn main() {
index bb1ce35d8736c8452d4d219f4324ccbb87e42c3e..bb5e1bdd7bc77a079029f43a531db1878c28a1eb 100644 (file)
@@ -130,7 +130,7 @@ we have a file `hello.rs` containing this program:
 
 ~~~~
 fn main() {
-    println("hello?");
+    println!("hello?");
 }
 ~~~~
 
@@ -140,12 +140,12 @@ Windows) which, upon running, will likely do exactly what you expect.
 
 The Rust compiler tries to provide useful information when it encounters an
 error. If you introduce an error into the program (for example, by changing
-`println` to some nonexistent function), and then compile it, you'll see
+`println!` to some nonexistent macro), and then compile it, you'll see
 an error message like this:
 
 ~~~~ {.notrust}
-hello.rs:2:4: 2:16 error: unresolved name: print_with_unicorns
-hello.rs:2     print_with_unicorns("hello?");
+hello.rs:2:5: 2:24 error: macro undefined: 'print_with_unicorns'
+hello.rs:2     print_with_unicorns!("hello?");
                ^~~~~~~~~~~~~~~~~~~
 ~~~~
 
@@ -424,11 +424,11 @@ compulsory, an `if` can have an optional `else` clause, and multiple
 
 ~~~~
 if false {
-    println("that's odd");
+    println!("that's odd");
 } else if true {
-    println("right");
+    println!("right");
 } else {
-    println("neither true nor false");
+    println!("neither true nor false");
 }
 ~~~~
 
@@ -456,10 +456,10 @@ executes its corresponding arm.
 ~~~~
 # let my_number = 1;
 match my_number {
-  0     => println("zero"),
-  1 | 2 => println("one or two"),
-  3..10 => println("three to ten"),
-  _     => println("something else")
+  0     => println!("zero"),
+  1 | 2 => println!("one or two"),
+  3..10 => println!("three to ten"),
+  _     => println!("something else")
 }
 ~~~~
 
@@ -484,8 +484,8 @@ commas are optional.
 ~~~
 # let my_number = 1;
 match my_number {
-  0 => { println("zero") }
-  _ => { println("something else") }
+  0 => { println!("zero") }
+  _ => { println!("something else") }
 }
 ~~~
 
@@ -563,7 +563,7 @@ let mut x = 5u;
 loop {
     x += x - 3;
     if x % 5 == 0 { break; }
-    println(x.to_str());
+    println!("{}", x);
 }
 ~~~~
 
@@ -613,8 +613,8 @@ origin.y += 1.0; // ERROR: assigning to immutable field
 # struct Point { x: f64, y: f64 }
 # let mypoint = Point { x: 0.0, y: 0.0 };
 match mypoint {
-    Point { x: 0.0, y: yy } => { println(yy.to_str());                     }
-    Point { x: xx,  y: yy } => { println(xx.to_str() + " " + yy.to_str()); }
+    Point { x: 0.0, y: yy } => println!("{}", yy),
+    Point { x: xx,  y: yy } => println!("{} {}", xx, yy),
 }
 ~~~~
 
@@ -629,7 +629,7 @@ reuses the field name as the binding name.
 # struct Point { x: f64, y: f64 }
 # let mypoint = Point { x: 0.0, y: 0.0 };
 match mypoint {
-    Point { x, .. } => { println(x.to_str()) }
+    Point { x, .. } => println!("{}", x),
 }
 ~~~
 
@@ -1777,7 +1777,7 @@ structure.
 ~~~~
 # fn call_it(op: proc(v: int)) { }
 call_it(proc(n) {
-    println(n.to_str());
+    println!("{}", n);
 });
 ~~~~
 
@@ -1787,7 +1787,7 @@ call for these functions.
 ~~~~
 # fn call_it(op: proc(v: int)) { }
 do call_it() |n| {
-    println(n.to_str());
+    println!("{}", n);
 }
 ~~~~
 
@@ -2124,7 +2124,7 @@ struct TimeBomb {
 impl Drop for TimeBomb {
     fn drop(&mut self) {
         for _ in range(0, self.explosivity) {
-            println("blam!");
+            println!("blam!");
         }
     }
 }
@@ -2168,7 +2168,7 @@ impl Printable for int {
 }
 
 impl Printable for ~str {
-    fn print(&self) { println(*self) }
+    fn print(&self) { println!("{}", *self) }
 }
 
 # 1.print();
@@ -2214,7 +2214,7 @@ trait Printable {
 impl Printable for int {}
 
 impl Printable for ~str {
-    fn print(&self) { println(*self) }
+    fn print(&self) { println!("{}", *self) }
 }
 
 impl Printable for bool {}
@@ -2561,7 +2561,7 @@ For example, for a simple hello world program your crate only consists of this c
 ~~~~
 // main.rs
 fn main() {
-    println("Hello world!");
+    println!("Hello world!");
 }
 ~~~~
 
@@ -2583,18 +2583,18 @@ All modules in a crate below the crate root are declared with the `mod` keyword:
 mod farm {
     // This is the body of module 'farm' declared in the crate root.
 
-    fn chicken() { println("cluck cluck"); }
-    fn cow() { println("mooo"); }
+    fn chicken() { println!("cluck cluck"); }
+    fn cow() { println!("mooo"); }
 
     mod barn {
         // Body of module 'barn'
 
-        fn hay() { println("..."); }
+        fn hay() { println!("..."); }
     }
 }
 
 fn main() {
-    println("Hello farm!");
+    println!("Hello farm!");
 }
 ~~~~
 
@@ -2611,12 +2611,12 @@ One way to do it is to simply fully qualifying it:
 
 ~~~~ {.xfail-test}
 mod farm {
-    fn chicken() { println("cluck cluck"); }
+    fn chicken() { println!("cluck cluck"); }
     // ...
 }
 
 fn main() {
-    println("Hello chicken!");
+    println!("Hello chicken!");
 
     ::farm::chicken(); // Won't compile yet, see further down
 }
@@ -2639,13 +2639,13 @@ _public_ with `pub`:
 
 ~~~~
 mod farm {
-    pub fn chicken() { println("cluck cluck"); }
-    pub fn cow() { println("mooo"); }
+    pub fn chicken() { println!("cluck cluck"); }
+    pub fn cow() { println!("mooo"); }
     // ...
 }
 
 fn main() {
-    println("Hello chicken!");
+    println!("Hello chicken!");
     ::farm::chicken(); // This compiles now
 }
 ~~~~
@@ -2725,18 +2725,18 @@ So, if we want to move the content of `mod farm` into it's own file, it would lo
 mod farm; // Compiler will look for 'farm.rs' and 'farm/mod.rs'
 
 fn main() {
-    println("Hello farm!");
+    println!("Hello farm!");
     ::farm::cow();
 }
 ~~~~
 
 ~~~~
 // farm.rs - contains body of module 'farm' in the crate root
-pub fn chicken() { println("cluck cluck"); }
-pub fn cow() { println("mooo"); }
+pub fn chicken() { println!("cluck cluck"); }
+pub fn cow() { println!("mooo"); }
 
 pub mod barn {
-    pub fn hay() { println("..."); }
+    pub fn hay() { println!("..."); }
 }
 # fn main() { }
 ~~~~
@@ -2843,7 +2843,7 @@ without the `::` prefix. For example, this imports `cow` into the local scope:
 
 ~~~
 use farm::cow;
-# mod farm { pub fn cow() { println("I'm a hidden ninja cow!") } }
+# mod farm { pub fn cow() { println!("I'm a hidden ninja cow!") } }
 # fn main() { cow() }
 ~~~
 
@@ -2861,7 +2861,7 @@ while adding a `self::` prefix will start in the current module:
 
 ~~~
 # mod workaround {
-# pub fn some_parent_item(){ println("...") }
+# pub fn some_parent_item(){ println!("...") }
 # mod foo {
 use super::some_parent_item;
 use self::some_child_module::some_item;
@@ -2883,8 +2883,8 @@ scope with corresponding `use` statements.
 # // XXX: Allow unused import in doc test
 use farm::cow;
 // ...
-# mod farm { pub fn cow() { println("Hidden ninja cow is hidden.") } }
-fn cow() { println("Mooo!") }
+# mod farm { pub fn cow() { println!("Hidden ninja cow is hidden.") } }
+fn cow() { println!("Mooo!") }
 
 fn main() {
     cow() // resolves to the locally defined cow() function
@@ -2902,7 +2902,7 @@ even if they refer to things inside them:
 ~~~
 use farm::cow;
 mod farm {
-    pub fn cow() { println("Moooooo?") }
+    pub fn cow() { println!("Moooooo?") }
 }
 
 fn main() { cow() }
@@ -2916,16 +2916,16 @@ use farm::cow;
 use farm::barn;
 
 mod farm {
-    pub fn chicken() { println("cluck cluck"); }
-    pub fn cow() { println("mooo"); }
+    pub fn chicken() { println!("cluck cluck"); }
+    pub fn cow() { println!("mooo"); }
 
     pub mod barn {
-        pub fn hay() { println("..."); }
+        pub fn hay() { println!("..."); }
     }
 }
 
 fn main() {
-    println("Hello farm!");
+    println!("Hello farm!");
 
     // Can now refer to those names directly:
     chicken();
@@ -2952,7 +2952,7 @@ pub fn foo() { bar(); }
 
 ~~~
 // c.rs
-pub fn bar() { println("Baz!"); }
+pub fn bar() { println!("Baz!"); }
 # fn main() {}
 ~~~
 
@@ -2963,8 +2963,8 @@ There also exist two short forms for importing multiple names at once:
 ~~~
 use farm::{chicken, cow};
 # mod farm {
-#     pub fn cow() { println("Did I already mention how hidden and ninja I am?") }
-#     pub fn chicken() { println("I'm Bat-chicken, guardian of the hidden tutorial code.") }
+#     pub fn cow() { println!("Did I already mention how hidden and ninja I am?") }
+#     pub fn chicken() { println!("I'm Bat-chicken, guardian of the hidden tutorial code.") }
 # }
 # fn main() { cow(); chicken() }
 ~~~
@@ -2974,8 +2974,8 @@ use farm::{chicken, cow};
 ~~~
 use farm::*;
 # mod farm {
-#     pub fn cow() { println("Bat-chicken? What a stupid name!") }
-#     pub fn chicken() { println("Says the 'hidden ninja' cow.") }
+#     pub fn cow() { println!("Bat-chicken? What a stupid name!") }
+#     pub fn chicken() { println!("Says the 'hidden ninja' cow.") }
 # }
 # fn main() { cow(); chicken() }
 ~~~
@@ -2988,7 +2988,7 @@ However, that's not all. You can also rename an item while you're bringing it in
 
 ~~~
 use egg_layer = farm::chicken;
-# mod farm { pub fn chicken() { println("Laying eggs is fun!")  } }
+# mod farm { pub fn chicken() { println!("Laying eggs is fun!")  } }
 // ...
 
 fn main() {
@@ -3010,11 +3010,11 @@ For that, you write `pub use`:
 mod farm {
     pub use self::barn::hay;
 
-    pub fn chicken() { println("cluck cluck"); }
-    pub fn cow() { println("mooo"); }
+    pub fn chicken() { println!("cluck cluck"); }
+    pub fn cow() { println!("mooo"); }
 
     mod barn {
-        pub fn hay() { println("..."); }
+        pub fn hay() { println!("..."); }
     }
 }
 
@@ -3082,7 +3082,7 @@ use farm::dog;
 use extra::rational::Ratio;
 
 mod farm {
-    pub fn dog() { println("woof"); }
+    pub fn dog() { println!("woof"); }
 }
 
 fn main() {
@@ -3180,7 +3180,7 @@ pub fn explore() -> &'static str { "world" }
 ~~~~ {.xfail-test}
 // main.rs
 extern mod world;
-fn main() { println("hello " + world::explore()); }
+fn main() { println!("hello {}", world::explore()); }
 ~~~~
 
 Now compile and run like this (adjust to your platform if necessary):
@@ -3200,7 +3200,7 @@ a hash representing the crates package ID.
 ## The standard library and the prelude
 
 While reading the examples in this tutorial, you might have asked yourself where all
-those magical predefined items like `println()` are coming from.
+those magical predefined items like `range` are coming from.
 
 The truth is, there's nothing magical about them: They are all defined normally
 in the `std` library, which is a crate that ships with Rust.
@@ -3219,19 +3219,24 @@ use std::prelude::*;
 
 The role of the `prelude` module is to re-export common definitions from `std`.
 
-This allows you to use common types and functions like `Option<T>` or `println`
+This allows you to use common types and functions like `Option<T>` or `range`
 without needing to import them. And if you need something from `std` that's not in the prelude,
 you just have to import it with an `use` statement.
 
-For example, it re-exports `println` which is defined in `std::io::stdio::println`:
+For example, it re-exports `range` which is defined in `std::iter::range`:
 
 ~~~
-use puts = std::io::stdio::println;
+use iter_range = std::iter::range;
 
 fn main() {
-    println("println is imported per default.");
-    puts("Doesn't hinder you from importing it under a different name yourself.");
-    ::std::io::stdio::println("Or from not using the automatic import.");
+    // range is imported by default
+    for _ in range(0, 10) {}
+
+    // Doesn't hinder you from importing it under a different name yourself
+    for _ in iter_range(0, 10) {}
+
+    // Or from not using the automatic import.
+    for _ in ::std::iter::range(0, 10) {}
 }
 ~~~
 
index 89b6f06abfc7f979aba79cb1c25dd6b815bf8351..2e1384a110df226c2cbec51fda47429abfcb893f 100644 (file)
@@ -84,8 +84,8 @@ pub fn parse_config(args: ~[~str]) -> config {
     let args_ = args.tail();
     if args[1] == ~"-h" || args[1] == ~"--help" {
         let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0);
-        println(getopts::groups::usage(message, groups));
-        println("");
+        println!("{}", getopts::groups::usage(message, groups));
+        println!("");
         fail!()
     }
 
@@ -97,8 +97,8 @@ pub fn parse_config(args: ~[~str]) -> config {
 
     if matches.opt_present("h") || matches.opt_present("help") {
         let message = format!("Usage: {} [OPTIONS]  [TESTNAME...]", argv0);
-        println(getopts::groups::usage(message, groups));
-        println("");
+        println!("{}", getopts::groups::usage(message, groups));
+        println!("");
         fail!()
     }
 
@@ -219,8 +219,8 @@ pub fn run_tests(config: &config) {
     if config.target == ~"arm-linux-androideabi" {
         match config.mode{
             mode_debug_info => {
-                println("arm-linux-androideabi debug-info \
-                        test uses tcp 5039 port. please reserve it");
+                println!("arm-linux-androideabi debug-info \
+                         test uses tcp 5039 port. please reserve it");
                 //arm-linux-androideabi debug-info test uses remote debugger
                 //so, we test 1 task at once
                 os::setenv("RUST_TEST_TASKS","1");
index 52081648978bfcf16d11a2a20114fbd907daaf8e..d127269ab41ba47641a816565df4110db54f0d6d 100644 (file)
@@ -53,5 +53,5 @@ pub fn lib_path_env_var() -> ~str { ~"PATH" }
 
 pub fn logv(config: &config, s: ~str) {
     debug!("{}", s);
-    if config.verbose { println(s); }
+    if config.verbose { println!("{}", s); }
 }
index 78baa4f7ec8bf36f28b6dc078b44e9c16055ecd4..bf86bf526a29de3da6d404811faca4ad188a0f6c 100644 (file)
 //! use std::os;
 //!
 //! fn do_work(inp: &str, out: Option<~str>) {
-//!     println(inp);
-//!     println(match out {
-//!         Some(x) => x,
-//!         None => ~"No Output"
-//!     });
+//!     println!("{}", inp);
+//!     match out {
+//!         Some(x) => println!("{}", x),
+//!         None => println!("No Output"),
+//!     }
 //! }
 //!
 //! fn print_usage(program: &str, _opts: &[Opt]) {
 //!     println!("Usage: {} [options]", program);
-//!     println("-o\t\tOutput");
-//!     println("-h --help\tUsage");
+//!     println!("-o\t\tOutput");
+//!     println!("-h --help\tUsage");
 //! }
 //!
 //! fn main() {
index 6881d1044428978e5249d487fbe10a6f05750ed7..a978d1f65beefe4fbf738a5f7dcba80b5cfa99d0 100644 (file)
@@ -226,10 +226,10 @@ fn optgroups() -> ~[getopts::groups::OptGroup] {
 
 fn usage(binary: &str, helpstr: &str) {
     let message = format!("Usage: {} [OPTIONS] [FILTER]", binary);
-    println(groups::usage(message, optgroups()));
-    println("");
+    println!("{}", groups::usage(message, optgroups()));
+    println!("");
     if helpstr == "help" {
-        println("\
+        println!("{}", "\
 The FILTER is matched against the name of all tests to run, and if any tests
 have a substring match, only those tests are run.
 
index 79886273a15413a17ab670cacfb113b9218640fb..657ff1737df116ce57f89a2b7f606e6c64498845 100644 (file)
@@ -393,7 +393,7 @@ fn query_from_str(rawquery: &str) -> Query {
  * use extra::url;
  *
  * let query = ~[(~"title", ~"The Village"), (~"north", ~"52.91"), (~"west", ~"4.10")];
- * println(url::query_to_str(&query));  // title=The%20Village&north=52.91&west=4.10
+ * println!("{}", url::query_to_str(&query));  // title=The%20Village&north=52.91&west=4.10
  * ```
  */
 pub fn query_to_str(query: &Query) -> ~str {
index 5a5b3814b742c774ed062868f54bafd9663124c8..b9e3e817414a555b7021245f5a390b9a132423cf 100644 (file)
@@ -34,7 +34,7 @@
 
 fn main() {
     let uuid1 = Uuid::new_v4();
-    println(uuid1.to_str());
+    println!("{}", uuid1.to_str());
 }
  ```
 
index 31f5091dd5fec99a90d8305c7c35d97814fb7e3f..db4666c42b60b6a7bb3f6a6429a8a5adce28312b 100644 (file)
@@ -536,5 +536,5 @@ fn make_path(filename: ~str) -> Path {
         }
     });
 
-    println(s);
+    println!("{}", s);
 }
index 82fed27b56521334b0d53b915b3a6f676b147ca6..f997c69b159d160a84fc5c87b265f52890af8e3f 100644 (file)
@@ -160,7 +160,7 @@ pub fn usage(argv0: &str) {
 }
 
 pub fn describe_warnings() {
-    println("
+    println!("
 Available lint options:
     -W <foo>           Warn about <foo>
     -A <foo>           Allow <foo>
@@ -181,7 +181,7 @@ pub fn describe_warnings() {
     fn padded(max: uint, s: &str) -> ~str {
         " ".repeat(max - s.len()) + s
     }
-    println("\nAvailable lint checks:\n");
+    println!("{}", "\nAvailable lint checks:\n"); // FIXME: #9970
     println!("    {}  {:7.7s}  {}",
              padded(max_key, "name"), "default", "meaning");
     println!("    {}  {:7.7s}  {}\n",
@@ -193,11 +193,11 @@ fn padded(max: uint, s: &str) -> ~str {
                  lint::level_to_str(spec.default),
                  spec.desc);
     }
-    println("");
+    println!("");
 }
 
 pub fn describe_debug_flags() {
-    println("\nAvailable debug options:\n");
+    println!("{}", "\nAvailable debug options:\n"); // FIXME: #9970
     let r = session::debugging_opts_map();
     for tuple in r.iter() {
         match *tuple {
@@ -312,10 +312,10 @@ pub fn run_compiler(args: &[~str], demitter: @diagnostic::Emitter) {
                 }
             };
             if crate_id {
-                println(crateid.to_str());
+                println!("{}", crateid.to_str());
             }
             if crate_name {
-                println(crateid.name);
+                println!("{}", crateid.name);
             }
         }
 
index a860b148aa9d29ad4bb34d4ba96a7102abcf19d5..5848744ec1cda6e8b16b3d1162a4d86438cce09f 100644 (file)
@@ -1905,7 +1905,7 @@ fn encode_metadata_inner(wr: &mut MemWriter, parms: EncodeParams, crate: &Crate)
             }
         }
 
-        println("metadata stats:");
+        println!("metadata stats:");
         println!("    inline bytes: {}", ecx.stats.inline_bytes.get());
         println!(" attribute bytes: {}", ecx.stats.attr_bytes.get());
         println!("       dep bytes: {}", ecx.stats.dep_bytes.get());
index 5160233ecbf136583bd82cafbf9390575953ee45..a2840e93c2f648e0163d4a2a82f6ed0976781a08 100644 (file)
@@ -93,7 +93,7 @@ pub fn check_crate(tcx: ty::ctxt,
     visit::walk_crate(bccx, crate, ());
 
     if tcx.sess.borrowck_stats() {
-        println("--- borrowck stats ---");
+        println!("--- borrowck stats ---");
         println!("paths requiring guarantees: {}",
                  bccx.stats.guaranteed_paths.get());
         println!("paths requiring loans     : {}",
index aaa8d071aff5de1d05194cd0ca5bd2b64a6f91e9..dbe7a03ad0cd07d45968cf20b6303190ce2fdaa8 100644 (file)
@@ -3367,7 +3367,7 @@ pub fn trans_crate(sess: session::Session,
     // Translate the metadata.
     let metadata = write_metadata(ccx, &crate);
     if ccx.sess.trans_stats() {
-        println("--- trans stats ---");
+        println!("--- trans stats ---");
         println!("n_static_tydescs: {}", ccx.stats.n_static_tydescs.get());
         println!("n_glues_created: {}", ccx.stats.n_glues_created.get());
         println!("n_null_glues: {}", ccx.stats.n_null_glues.get());
@@ -3377,7 +3377,7 @@ pub fn trans_crate(sess: session::Session,
         println!("n_monos: {}", ccx.stats.n_monos.get());
         println!("n_inlines: {}", ccx.stats.n_inlines.get());
         println!("n_closures: {}", ccx.stats.n_closures.get());
-        println("fn stats:");
+        println!("fn stats:");
         {
             let mut fn_stats = ccx.stats.fn_stats.borrow_mut();
             fn_stats.get().sort_by(|&(_, _, insns_a), &(_, _, insns_b)| {
index cfebde6b3111edd4af48b74881b5978512ef664f..69d5f631e360c579b64942e6aea795f8ca248bea 100644 (file)
@@ -105,14 +105,14 @@ pub fn opts() -> ~[groups::OptGroup] {
 }
 
 pub fn usage(argv0: &str) {
-    println(groups::usage(format!("{} [options] <input>", argv0), opts()));
+    println!("{}", groups::usage(format!("{} [options] <input>", argv0), opts()));
 }
 
 pub fn main_args(args: &[~str]) -> int {
     let matches = match groups::getopts(args.tail(), opts()) {
         Ok(m) => m,
         Err(err) => {
-            println(err.to_err_msg());
+            println!("{}", err.to_err_msg());
             return 1;
         }
     };
@@ -122,10 +122,10 @@ pub fn main_args(args: &[~str]) -> int {
     }
 
     if matches.free.len() == 0 {
-        println("expected an input file to act on");
+        println!("expected an input file to act on");
         return 1;
     } if matches.free.len() > 1 {
-        println("only one input file may be specified");
+        println!("only one input file may be specified");
         return 1;
     }
     let input = matches.free[0].as_slice();
@@ -135,11 +135,11 @@ pub fn main_args(args: &[~str]) -> int {
     }
 
     if matches.opt_strs("passes") == ~[~"list"] {
-        println("Available passes for running rustdoc:");
+        println!("Available passes for running rustdoc:");
         for &(name, _, description) in PASSES.iter() {
             println!("{:>20s} - {}", name, description);
         }
-        println("\nDefault passes for rustdoc:");
+        println!("{}", "\nDefault passes for rustdoc:"); // FIXME: #9970
         for &name in DEFAULT_PASSES.iter() {
             println!("{:>20s}", name);
         }
index 681ae1dc8078022e97b8e29c52e1d3667567930d..51b42869c75954104b70fa8ce8b23a52480afbc5 100644 (file)
@@ -269,43 +269,43 @@ pub fn flags_forbidden_for_cmd(flags: &RustcFlags,
     };
 
     if flags.linker.is_some() && cmd != BuildCmd && cmd != InstallCmd {
-        println("The --linker option can only be used with the build or install commands.");
+        println!("The --linker option can only be used with the build or install commands.");
         return true;
     }
     if flags.link_args.is_some() && cmd != BuildCmd && cmd != InstallCmd {
-        println("The --link-args option can only be used with the build or install commands.");
+        println!("The --link-args option can only be used with the build or install commands.");
         return true;
     }
 
     if !cfgs.is_empty() && cmd != BuildCmd && cmd != InstallCmd && cmd != TestCmd {
-        println("The --cfg option can only be used with the build, test, or install commands.");
+        println!("The --cfg option can only be used with the build, test, or install commands.");
         return true;
     }
 
     if user_supplied_opt_level && cmd != BuildCmd && cmd != InstallCmd {
-        println("The -O and --opt-level options can only be used with the build \
+        println!("The -O and --opt-level options can only be used with the build \
                     or install commands.");
         return true;
     }
 
     if flags.save_temps  && cmd != BuildCmd && cmd != InstallCmd {
-        println("The --save-temps option can only be used with the build \
+        println!("The --save-temps option can only be used with the build \
                     or install commands.");
         return true;
     }
 
     if flags.target.is_some()  && cmd != BuildCmd && cmd != InstallCmd {
-        println("The --target option can only be used with the build \
+        println!("The --target option can only be used with the build \
                     or install commands.");
         return true;
     }
     if flags.target_cpu.is_some()  && cmd != BuildCmd && cmd != InstallCmd {
-        println("The --target-cpu option can only be used with the build \
+        println!("The --target-cpu option can only be used with the build \
                     or install commands.");
         return true;
     }
     if flags.experimental_features.is_some() && cmd != BuildCmd && cmd != InstallCmd {
-        println("The -Z option can only be used with the build or install commands.");
+        println!("The -Z option can only be used with the build or install commands.");
         return true;
     }
 
index 135b659871dd74f74fbe26f57d3216f5ca3cce0d..3d2ef2ebabad01a536ae8cba2e2a2588e82bfe11 100644 (file)
@@ -364,9 +364,9 @@ fn run(&self, cmd: Command, args: ~[~str]) {
                 }
             }
             ListCmd => {
-                println("Installed packages:");
+                println!("Installed packages:");
                 installed_packages::list_installed_packages(|pkg_id| {
-                    pkg_id.path.display().with_str(|s| println(s));
+                    pkg_id.path.display().with_str(|s| println!("{}", s));
                     true
                 });
             }
@@ -747,7 +747,7 @@ fn unprefer(&self, _id: &str, _vers: Option<~str>)  {
 }
 
 pub fn main() {
-    println("WARNING: The Rust package manager is experimental and may be unstable");
+    println!("WARNING: The Rust package manager is experimental and may be unstable");
     os::set_exit_status(main_args(os::args()));
 }
 
index cbb550302317526af80aa345a7c16b3987258d3a..7da99c5d5621be2d2b701891a6c706e82031dc13 100644 (file)
@@ -38,8 +38,8 @@ pub fn safe_git_clone(source: &Path, v: &Version, target: &Path) -> CloneResult
                                                        target.as_str().unwrap().to_owned()]);
             let outp = opt_outp.expect("Failed to exec `git`");
             if !outp.status.success() {
-                println(str::from_utf8_owned(outp.output.clone()));
-                println(str::from_utf8_owned(outp.error));
+                println!("{}", str::from_utf8_owned(outp.output.clone()));
+                println!("{}", str::from_utf8_owned(outp.error));
                 return DirToUse(target.clone());
             }
             else {
@@ -54,8 +54,8 @@ pub fn safe_git_clone(source: &Path, v: &Version, target: &Path) -> CloneResult
                              format!("--git-dir={}", git_dir.as_str().unwrap().to_owned()),
                              ~"checkout", format!("{}", *s)]).expect("Failed to exec `git`");
                         if !outp.status.success() {
-                            println(str::from_utf8_owned(outp.output.clone()));
-                            println(str::from_utf8_owned(outp.error));
+                            println!("{}", str::from_utf8_owned(outp.output.clone()));
+                            println!("{}", str::from_utf8_owned(outp.error));
                             return DirToUse(target.clone());
                         }
                     }
index 6c9a63fe7bd8a6c8973df812b190a25a4a0b293e..a4c2c1baabeffe37906b0fa8cc66e230da2a4c2a 100644 (file)
@@ -16,5 +16,5 @@
 */
 
 fn main() {
-    println(~"Hello world!");
+    println!("Hello world!");
 }
index 85ddd3e58d4831dcc6b084b727035e56bd5e8c0e..b6c5e15c09a5f94ac0b81512d7c95b1cff7324dd 100644 (file)
@@ -36,7 +36,7 @@ pub fn main() {
     }
 
     if args[2] != ~"install" {
-        println(format!("Warning: I don't know how to {}", args[2]));
+        println!("Warning: I don't know how to {}", args[2]);
         return;
     }
 
index 1d18a3aaa431597326d4193d23caa8fa77bc742a..54b536664a3453943822f51dfacc2136a36e3227 100644 (file)
@@ -19,5 +19,5 @@
 */
 
 fn main() {
-    println("Hello world!");
+    println!("Hello world!");
 }
index a41e99f6d663d461099883a7202e3ca4ef62fb25..6fcafac4e5bddcf1386eaccb4e7cc039de3acfd8 100644 (file)
@@ -11,7 +11,7 @@
 use context::Command;
 
 pub fn general() {
-    println("Usage: rustpkg [options] <cmd> [args..]
+    println!("Usage: rustpkg [options] <cmd> [args..]
 
 Where <cmd> is one of:
     build, clean, do, info, install, list, prefer, test, uninstall, unprefer
@@ -24,7 +24,7 @@ pub fn general() {
 }
 
 pub fn build() {
-    println("rustpkg build [options..] [package-ID]
+    println!("rustpkg build [options..] [package-ID]
 
 Build the given package ID if specified. With no package ID argument,
 build the package in the current directory. In that case, the current
@@ -50,21 +50,21 @@ pub fn build() {
 }
 
 pub fn clean() {
-    println("rustpkg clean
+    println!("rustpkg clean
 
 Remove all build files in the work cache for the package in the current
 directory.");
 }
 
 pub fn do_cmd() {
-    println("rustpkg do <cmd>
+    println!(r"rustpkg do <cmd>
 
 Runs a command in the package script. You can listen to a command
-by tagging a function with the attribute `#[pkg_do(cmd)]`.");
+by tagging a function with the attribute `\#[pkg_do(cmd)]`.");
 }
 
 pub fn info() {
-    println("rustpkg [options..] info
+    println!("rustpkg [options..] info
 
 Probe the package script in the current directory for information.
 
@@ -73,13 +73,13 @@ pub fn info() {
 }
 
 pub fn list() {
-    println("rustpkg list
+    println!("rustpkg list
 
 List all installed packages.");
 }
 
 pub fn install() {
-    println("rustpkg install [options..] [package-ID]
+    println!(r"rustpkg install [options..] [package-ID]
 
 Install the given package ID if specified. With no package ID
 argument, install the package in the current directory.
@@ -89,7 +89,7 @@ pub fn install() {
 Examples:
     rustpkg install
     rustpkg install github.com/mozilla/servo
-    rustpkg install github.com/mozilla/servo#0.1.2
+    rustpkg install github.com/mozilla/servo\#0.1.2
 
 Options:
     -c, --cfg      Pass a cfg flag to the package script
@@ -105,14 +105,14 @@ pub fn install() {
 }
 
 pub fn uninstall() {
-    println("rustpkg uninstall <id|name>[@version]
+    println!("rustpkg uninstall <id|name>[@version]
 
 Remove a package by id or name and optionally version. If the package(s)
 is/are depended on by another package then they cannot be removed.");
 }
 
 pub fn prefer() {
-    println("rustpkg [options..] prefer <id|name>[@version]
+    println!("rustpkg [options..] prefer <id|name>[@version]
 
 By default all binaries are given a unique name so that multiple versions can
 coexist. The prefer command will symlink the uniquely named binary to
@@ -130,7 +130,7 @@ pub fn prefer() {
 }
 
 pub fn unprefer() {
-    println("rustpkg [options..] unprefer <id|name>[@version]
+    println!("rustpkg [options..] unprefer <id|name>[@version]
 
 Remove all symlinks from the store to the binary directory for a package
 name and optionally version. If version is not supplied, the latest version
@@ -139,7 +139,7 @@ pub fn unprefer() {
 }
 
 pub fn test() {
-    println("rustpkg [options..] test
+    println!("rustpkg [options..] test
 
 Build all test crates in the current directory with the test flag.
 Then, run all the resulting test executables, redirecting the output
@@ -150,7 +150,7 @@ pub fn test() {
 }
 
 pub fn init() {
-    println("rustpkg init
+    println!("rustpkg init
 
 This will turn the current working directory into a workspace. The first
 command you run when starting off a new project.
index a20ddc141479f456294c30d1a961c5d7cc5f9207..d080262ccc77dcd46f4ea55b5ee7b76541b4461d 100644 (file)
@@ -54,7 +54,7 @@
 ///
 /// ```
 /// std::bool::all_values(|x: bool| {
-///     println(x.to_str());
+///     println!("{}", x);
 /// })
 /// ```
 #[inline]
index 2ecae8e85d0a38d24b315e3972e6904ea353709c..e0dc5c8b65d694d9a5d238bd31e27df21b5aa6b0 100644 (file)
@@ -51,8 +51,8 @@
     // condition, then the above handler will be invoked (so long as there's no
     // other nested handler).
 
-    println(my_error::cond.raise(3)); // prints "three"
-    println(my_error::cond.raise(4)); // prints "oh well"
+    println!("{}", my_error::cond.raise(3)); // prints "three"
+    println!("{}", my_error::cond.raise(4)); // prints "oh well"
 
 })
 
index 3ab710e9356e68e7d4f01dd6817549dbb990ea58..2e33bef380cbd200ffdb9bf01793caf1f9c39081 100644 (file)
@@ -32,7 +32,7 @@
     # let _g = ::std::io::ignore_io_error();
     let mut stdin = BufferedReader::new(stdin());
     for line in stdin.lines() {
-        print(line);
+        print!("{}", line);
     }
     ```
 
@@ -67,7 +67,7 @@
     let path = Path::new("message.txt");
     let mut file = BufferedReader::new(File::open(&path));
     for line in file.lines() {
-        print(line);
+        print!("{}", line);
     }
     ```
 
 });
 
 if error.is_some() {
-    println("failed to write my diary");
+    println!("failed to write my diary");
 }
 # ::std::io::fs::unlink(&Path::new("diary.txt"));
 ```
index 4cde35796a642e8abb821718e6a0bff951594d76..34b4ed5e1ef453ecf9887b6ed6b61d92b1d4c337 100644 (file)
@@ -68,7 +68,7 @@ pub enum Signum {
 /// do spawn {
 ///     loop {
 ///         match listener.port.recv() {
-///             Interrupt => println("Got Interrupt'ed"),
+///             Interrupt => println!("Got Interrupt'ed"),
 ///             _ => (),
 ///         }
 ///     }
index 8d2ed62feb849ea4a7e27059001ad90199038028..2056f8b33ec1d5c93c9e4cda44a4ddef6a35c978 100644 (file)
@@ -402,7 +402,7 @@ fn fuse(self) -> Fuse<Self> {
     ///             .filter(|&x| x % 2 == 0)
     ///             .inspect(|&x| debug!("{} made it through", x))
     ///             .sum();
-    /// println(sum.to_str());
+    /// println!("{}", sum);
     /// ```
     #[inline]
     fn inspect<'r>(self, f: 'r |&A|) -> Inspect<'r, A, Self> {
index fbefce71e88a6090cbaf4b3564ecab53a0286fc8..a15ce4f0102b74f4b9dd1f6b7210c5d16d54593f 100644 (file)
@@ -47,8 +47,8 @@
  *     }
  * }
  * fn main() {
- *     println(format!("{:?}", Point {x: 1, y: 0} + Point {x: 2, y: 3}));
- *     println(format!("{:?}", Point {x: 1, y: 0} - Point {x: 2, y: 3}));
+ *     println!("{:?}", Point {x: 1, y: 0} + Point {x: 2, y: 3});
+ *     println!("{:?}", Point {x: 1, y: 0} - Point {x: 2, y: 3});
  * }
  * ```
  *
@@ -72,7 +72,7 @@
  *
  * impl Drop for HasDrop {
  *   fn drop(&mut self) {
- *       println("Dropping!");
+ *       println!("Dropping!");
  *   }
  * }
  *
@@ -100,7 +100,7 @@ pub trait Drop {
  *
  * impl Add<Foo, Foo> for Foo {
  *     fn add(&self, _rhs: &Foo) -> Foo {
- *       println("Adding!");
+ *       println!("Adding!");
  *       *self
  *   }
  * }
@@ -129,7 +129,7 @@ pub trait Add<RHS,Result> {
  *
  * impl Sub<Foo, Foo> for Foo {
  *     fn sub(&self, _rhs: &Foo) -> Foo {
- *         println("Subtracting!");
+ *         println!("Subtracting!");
  *         *self
  *     }
  * }
@@ -158,7 +158,7 @@ pub trait Sub<RHS,Result> {
  *
  * impl Mul<Foo, Foo> for Foo {
  *     fn mul(&self, _rhs: &Foo) -> Foo {
- *         println("Multiplying!");
+ *         println!("Multiplying!");
  *         *self
  *     }
  * }
@@ -187,7 +187,7 @@ pub trait Mul<RHS,Result> {
  *
  * impl Div<Foo, Foo> for Foo {
  *     fn div(&self, _rhs: &Foo) -> Foo {
- *         println("Dividing!");
+ *         println!("Dividing!");
  *         *self
  *     }
  * }
@@ -216,7 +216,7 @@ pub trait Div<RHS,Result> {
  *
  * impl Rem<Foo, Foo> for Foo {
  *     fn rem(&self, _rhs: &Foo) -> Foo {
- *         println("Remainder-ing!");
+ *         println!("Remainder-ing!");
  *         *self
  *     }
  * }
@@ -245,7 +245,7 @@ pub trait Rem<RHS,Result> {
  *
  * impl Neg<Foo> for Foo {
  *     fn neg(&self) -> Foo {
- *         println("Negating!");
+ *         println!("Negating!");
  *         *self
  *     }
  * }
@@ -274,7 +274,7 @@ pub trait Neg<Result> {
  *
  * impl Not<Foo> for Foo {
  *     fn not(&self) -> Foo {
- *         println("Not-ing!");
+ *         println!("Not-ing!");
  *         *self
  *     }
  * }
@@ -303,7 +303,7 @@ pub trait Not<Result> {
  *
  * impl BitAnd<Foo, Foo> for Foo {
  *     fn bitand(&self, _rhs: &Foo) -> Foo {
- *         println("Bitwise And-ing!");
+ *         println!("Bitwise And-ing!");
  *         *self
  *     }
  * }
@@ -332,7 +332,7 @@ pub trait BitAnd<RHS,Result> {
  *
  * impl BitOr<Foo, Foo> for Foo {
  *     fn bitor(&self, _rhs: &Foo) -> Foo {
- *         println("Bitwise Or-ing!");
+ *         println!("Bitwise Or-ing!");
  *         *self
  *     }
  * }
@@ -361,7 +361,7 @@ pub trait BitOr<RHS,Result> {
  *
  * impl BitXor<Foo, Foo> for Foo {
  *     fn bitxor(&self, _rhs: &Foo) -> Foo {
- *         println("Bitwise Xor-ing!");
+ *         println!("Bitwise Xor-ing!");
  *         *self
  *     }
  * }
@@ -390,7 +390,7 @@ pub trait BitXor<RHS,Result> {
  *
  * impl Shl<Foo, Foo> for Foo {
  *     fn shl(&self, _rhs: &Foo) -> Foo {
- *         println("Shifting left!");
+ *         println!("Shifting left!");
  *         *self
  *     }
  * }
@@ -419,7 +419,7 @@ pub trait Shl<RHS,Result> {
  *
  * impl Shr<Foo, Foo> for Foo {
  *     fn shr(&self, _rhs: &Foo) -> Foo {
- *         println("Shifting right!");
+ *         println!("Shifting right!");
  *         *self
  *     }
  * }
@@ -449,7 +449,7 @@ pub trait Shr<RHS,Result> {
  *
  * impl Index<Foo, Foo> for Foo {
  *     fn index(&self, _rhs: &Foo) -> Foo {
- *         println("Indexing!");
+ *         println!("Indexing!");
  *         *self
  *     }
  * }
index 7ce9873c2da418a9c10d1c1e9e2085fcd1b1dc0d..bdec67e5d9f96c6f160d69ed2a5b38a632514580 100644 (file)
@@ -26,7 +26,7 @@
 //!
 //! // Take a reference to the contained string
 //! match msg {
-//!     Some(ref m) => io::println(*m),
+//!     Some(ref m) => println!("{}", *m),
 //!     None => ()
 //! }
 //!
index 36bcc81c06de975d57d6db5e7c8d024ad424cb69..9045bafbe4591bbd0260fbf8d1fd52f6bac0463c 100644 (file)
@@ -40,7 +40,6 @@
 // Reexported functions
 pub use from_str::from_str;
 pub use iter::range;
-pub use io::stdio::{print, println};
 
 // Reexported types and traits
 
index e52a38500112f19faad192ac2b78420a5fc33ca5..f9bd291fbf446f6b6c40d4a6a1580478b86f1e9e 100644 (file)
@@ -244,7 +244,7 @@ fn gen_weighted_bool(&mut self, n: uint) -> bool {
     /// ```rust
     /// use std::rand::{task_rng, Rng};
     ///
-    /// println(task_rng().gen_ascii_str(10));
+    /// println!("{}", task_rng().gen_ascii_str(10));
     /// ```
     fn gen_ascii_str(&mut self, len: uint) -> ~str {
         static GEN_ASCII_STR_CHARSET: &'static [u8] = bytes!("ABCDEFGHIJKLMNOPQRSTUVWXYZ\
index c0a7d14bf70bfa23c07dbdd4174a1306afb57068..758ca22e5c3ec7666332ba637e08d6a400de382a 100644 (file)
@@ -118,7 +118,7 @@ fn from_seed((rsdr, seed): (Rsdr, S)) -> ReseedingRng<R, Rsdr> {
 ///     let mut rng = ReseedingRng::new(rand::StdRng::new(), 10, rsdr);
 ///
 ///     // this will repeat, because it gets reseeded very regularly.
-///     println(rng.gen_ascii_str(100));
+///     println!("{}", rng.gen_ascii_str(100));
 /// }
 ///
 /// ```
index 888eed0e7623cdab689a91895c44ed034ff7747c..e0f96365eddbdfaf2fb3f9cee682b50082675c0b 100644 (file)
@@ -634,6 +634,7 @@ fn test_repr() {
     use prelude::*;
     use str;
     use str::Str;
+    use io::stdio::println;
     use util::swap;
     use char::is_alphabetic;
 
index 35e188964c101c05cb98532dfc109366866e6c2c..8b6e1520dc7141b4ab9dc11a09ffe8e972e7b3bd 100644 (file)
@@ -1591,8 +1591,8 @@ pub trait StrSlice<'a> {
     /// assert_eq!(d.len(), 23);
     ///
     /// // the two strings *look* the same
-    /// println(c);
-    /// println(d);
+    /// println!("{}", c);
+    /// println!("{}", d);
     /// ```
     fn char_len(&self) -> uint;
 
index 9964c6842abb1bb6d5800ddcb846f86697b75e3c..257a1e6340fa64a88b93de36ccfb337d8f210bc4 100644 (file)
@@ -1317,7 +1317,7 @@ pub trait OwnedVector<T> {
     /// let v = ~[~"a", ~"b"];
     /// for s in v.move_iter() {
     ///   // s has type ~str, not &~str
-    ///   println(s);
+    ///   println!("{}", s);
     /// }
     /// ```
     fn move_iter(self) -> MoveIterator<T>;
index bcac69c188a80af822d79586fb81ede30e8306b1..c8c9cb4d24766bfdbe1a27242ae598cb3dae122c 100644 (file)
@@ -1127,7 +1127,7 @@ fn unfold_marks(mrks: ~[Mrk], tail: SyntaxContext, table: &SCTable)
         // - two renames of the same var.. can only happen if you use
         // local-expand to prevent the inner binding from being renamed
         // during the rename-pass caused by the first:
-        println("about to run bad test");
+        println!("about to run bad test");
         { let sc = unfold_test_sc(~[R(id(a,EMPTY_CTXT),50),
                                     R(id(a,EMPTY_CTXT),51)],
                                   EMPTY_CTXT,&mut t);
index 75c0371f62579a040cd2b5c4b124bd94c18e4ff2..a9cf807ff65ec8bf664f9df2d7e6c91c9aa8ca07 100644 (file)
@@ -1283,7 +1283,7 @@ fn expand_crate_str(crate_str: @str) -> ast::Crate {
 
     //fn expand_and_resolve(crate_str: @str) -> ast::crate {
         //let expanded_ast = expand_crate_str(crate_str);
-        // println(format!("expanded: {:?}\n",expanded_ast));
+        // println!("expanded: {:?}\n",expanded_ast);
         //mtwt_resolve_crate(expanded_ast)
     //}
     //fn expand_and_resolve_and_pretty_print (crate_str : @str) -> ~str {
@@ -1396,7 +1396,7 @@ fn run_renaming_test(t: &RenamingTest, test_idx: uint) {
                     let varref_marks = mtwt_marksof(varref.segments[0].identifier.ctxt,
                                                     invalid_name);
                     if (!(varref_name==binding_name)){
-                        println("uh oh, should match but doesn't:");
+                        println!("uh oh, should match but doesn't:");
                         println!("varref: {:?}",varref);
                         println!("binding: {:?}", bindings[binding_idx]);
                         ast_util::display_sctable(get_sctable());
@@ -1458,7 +1458,7 @@ fn run_renaming_test(t: &RenamingTest, test_idx: uint) {
                                           && (@"xx" == (ident_to_str(&p.segments[0].identifier)))
                                      }).enumerate() {
             if (mtwt_resolve(v.segments[0].identifier) != resolved_binding) {
-                println("uh oh, xx binding didn't match xx varref:");
+                println!("uh oh, xx binding didn't match xx varref:");
                 println!("this is xx varref \\# {:?}",idx);
                 println!("binding: {:?}",cxbind);
                 println!("resolves to: {:?}",resolved_binding);
@@ -1466,7 +1466,7 @@ fn run_renaming_test(t: &RenamingTest, test_idx: uint) {
                 println!("resolves to: {:?}",
                          mtwt_resolve(v.segments[0].identifier));
                 let table = get_sctable();
-                println("SC table:");
+                println!("SC table:");
 
                 {
                     let table = table.table.borrow();
index 74032095840a960e3b51d11e42d97a31d87724ef..947e8271f884ed08df243e748b28fd9c5d000a6c 100644 (file)
@@ -21,7 +21,7 @@ pub fn expand_syntax_ext(cx: &mut ExtCtxt,
                       -> base::MacResult {
 
     cx.print_backtrace();
-    println(
+    println!("{}",
         print::pprust::tt_to_str(
             &ast::TTDelim(@tt.to_owned()),
             get_ident_interner()));
index 9304b8422944876eab33c2c8ac2fd38451d32980..4cd64331f9a4d0f267a10fb77bff40950a17680d 100644 (file)
@@ -983,7 +983,7 @@ fn setup(teststr: @str) -> Env {
     #[test] fn t1 () {
         let Env {string_reader} =
             setup(@"/* my source file */ \
-                    fn main() { io::println(~\"zebra\"); }\n");
+                    fn main() { println!(\"zebra\"); }\n");
         let id = str_to_ident("fn");
         let tok1 = string_reader.next_token();
         let tok2 = TokenAndSpan{
index be65cadcc7f803a611a73cf774b23a3637afe873..2f9d77691c56a34039f48095ac1f978e7bc36c08 100644 (file)
@@ -20,6 +20,6 @@ pub struct Bar {
 impl Foo for Bar {
     #[inline(always)]
     fn f(&self) {
-        println((*self).x);
+        println!("{}", (*self).x);
     }
 }
index fe403a56a4be6524f9ad3bce538560f8f19091f7..d2d36f03698c7dedec0d73b87c3a11e79fe37bdd 100644 (file)
@@ -16,7 +16,7 @@ pub struct S {
 
 impl Drop for S {
     fn drop(&mut self) {
-        println("goodbye");
+        println!("goodbye");
     }
 }
 
index ca7dc238e2e819b33998f054a8e41eee533fbef6..0a37e93f6e786bb3aee2d971fbfd3c2cb7ac76a8 100644 (file)
@@ -27,7 +27,7 @@ fn timed(label: &str, f: ||) {
 }
 
 fn ascending<M: MutableMap<uint, uint>>(map: &mut M, n_keys: uint) {
-    println(" Ascending integers:");
+    println!(" Ascending integers:");
 
     timed("insert", || {
         for i in range(0u, n_keys) {
@@ -49,7 +49,7 @@ fn ascending<M: MutableMap<uint, uint>>(map: &mut M, n_keys: uint) {
 }
 
 fn descending<M: MutableMap<uint, uint>>(map: &mut M, n_keys: uint) {
-    println(" Descending integers:");
+    println!(" Descending integers:");
 
     timed("insert", || {
         for i in range(0, n_keys).invert() {
@@ -115,7 +115,8 @@ fn main() {
 
     println!("{} keys", n_keys);
 
-    println("\nTreeMap:");
+    // FIXME: #9970
+    println!("{}", "\nTreeMap:");
 
     {
         let mut map: TreeMap<uint,uint> = TreeMap::new();
@@ -128,12 +129,13 @@ fn main() {
     }
 
     {
-        println(" Random integers:");
+        println!(" Random integers:");
         let mut map: TreeMap<uint,uint> = TreeMap::new();
         vector(&mut map, n_keys, rand);
     }
 
-    println("\nHashMap:");
+    // FIXME: #9970
+    println!("{}", "\nHashMap:");
 
     {
         let mut map: HashMap<uint,uint> = HashMap::new();
@@ -146,12 +148,13 @@ fn main() {
     }
 
     {
-        println(" Random integers:");
+        println!(" Random integers:");
         let mut map: HashMap<uint,uint> = HashMap::new();
         vector(&mut map, n_keys, rand);
     }
 
-    println("\nTrieMap:");
+    // FIXME: #9970
+    println!("{}", "\nTrieMap:");
 
     {
         let mut map: TrieMap<uint> = TrieMap::new();
@@ -164,7 +167,7 @@ fn main() {
     }
 
     {
-        println(" Random integers:");
+        println!(" Random integers:");
         let mut map: TrieMap<uint> = TrieMap::new();
         vector(&mut map, n_keys, rand);
     }
index 57205ca2c583df7324fd77bc11cd7eff169f546c..c8f5dda41d8a7c0ce06507b9ea5817fa1edd1fb4 100644 (file)
@@ -123,7 +123,7 @@ pub fn bench_str<T:MutableSet<~str>,
 }
 
 fn write_header(header: &str) {
-    println(header);
+    println!("{}", header);
 }
 
 fn write_row(label: &str, value: f64) {
index 65f0f7a84aedf52fcbfc78aea2ee967f7768379a..4ffe1aed32fb822681e061a1b2d85c586b84fc03 100644 (file)
@@ -118,8 +118,8 @@ fn main() {
 
     for y in range(0, 256) {
         for x in range(0, 256) {
-            print(symbols[(pixels[y*256+x] / 0.2f32) as int]);
+            print!("{}", symbols[(pixels[y*256+x] / 0.2f32) as int]);
         }
-        println("");
+        println!("");
     }
 }
index 9f4106340f1619d1fd6ada56e07f52d725cd97a4..976cd96ad309b57985f6c0c2ceae42a1d82b46fe 100644 (file)
@@ -78,7 +78,7 @@ fn main() {
         }).to_owned_vec();
 
     for message in messages.mut_iter() {
-        println(*message.get_ref());
+        println!("{}", *message.get_ref());
     }
 
     println!("long lived tree of depth {}\t check: {}",
index 7801a64fcedba40df1948d838eecda2d7e7322ad..8f8485b5801ca0b502b015c9d42fa13e3692039d 100644 (file)
@@ -20,8 +20,8 @@ fn print_complements() {
     let all = [Blue, Red, Yellow];
     for aa in all.iter() {
         for bb in all.iter() {
-            println(show_color(*aa) + " + " + show_color(*bb) +
-                    " -> " + show_color(transform(*aa, *bb)));
+            println!("{} + {} -> {}", show_color(*aa), show_color(*bb),
+                show_color(transform(*aa, *bb)));
         }
     }
 }
@@ -187,15 +187,15 @@ fn rendezvous(nn: uint, set: ~[color]) {
     }
 
     // print each color in the set
-    println(show_color_list(set));
+    println!("{}", show_color_list(set));
 
     // print each creature's stats
     for rep in report.iter() {
-        println(*rep);
+        println!("{}", *rep);
     }
 
     // print the total number of creatures met
-    println(show_number(creatures_met));
+    println!("{}", show_number(creatures_met));
 }
 
 fn main() {
@@ -211,10 +211,10 @@ fn main() {
     let nn = from_str::<uint>(args[1]).unwrap();
 
     print_complements();
-    println("");
+    println!("");
 
     rendezvous(nn, ~[Blue, Red, Yellow]);
-    println("");
+    println!("");
 
     rendezvous(nn,
         ~[Blue, Red, Yellow, Red, Yellow, Blue, Red, Yellow, Red, Blue]);
index ea57eae22b8e3d7dc561afb1cd2f8507d3c91f80..b5697310fce188b951d6835dc85cdc9738d482d1 100644 (file)
@@ -64,7 +64,7 @@ fn fannkuch_redux(n: i32) -> i32 {
             // Use incremental change to generate another permutation.
             loop {
                 if r == n {
-                    println(checksum.to_str());
+                    println!("{}", checksum);
                     return max_flips_count;
                 }
 
index 2f63c6046f80fedec7b9508166cb26921b2845a2..cef59b7c0e66c579e381a552389381306d491899 100644 (file)
@@ -223,6 +223,6 @@ fn main() {
 
    // now fetch and print result messages
    for (ii, _sz) in sizes.iter().enumerate() {
-       println(from_child[ii].recv());
+       println!("{}", from_child[ii].recv());
    }
 }
index fa63d1067ae44ee4c78923581d7cbf213d6b2388..732922cdb0785a38eb283e4f3071226797a54454 100644 (file)
@@ -21,8 +21,8 @@ fn write(&mut self, _: &[u8]) {}
 fn main() {
     let args = std::os::args();
     let (w, mut out) = if args.len() < 2 {
-        println("Test mode: do not dump the image because it's not utf8, \
-                which interferes with the test runner.");
+        println!("Test mode: do not dump the image because it's not utf8, \
+                  which interferes with the test runner.");
         (1000, ~DummyWriter as ~Writer)
     } else {
         (from_str(args[1]).unwrap(),
index b40996b1471e5f330801edcbc4742f3c66eb0266..4b6430cbd27bcb124c23ff16ec23cb4120b07ac9 100644 (file)
@@ -193,11 +193,11 @@ fn to_utf8(raw_sol: &List<u64>) -> ~str {
 // Prints a solution in ~str form.
 fn print_sol(sol: &str) {
     for (i, c) in sol.chars().enumerate() {
-        if (i) % 5 == 0 {println("");}
-        if (i + 5) % 10 == 0 {print(" ");}
+        if (i) % 5 == 0 { println!(""); }
+        if (i + 5) % 10 == 0 { print!(" "); }
         print!("{} ", c);
     }
-    println("");
+    println!("");
 }
 
 // The data managed during the search
@@ -277,5 +277,5 @@ fn main () {
     println!("{} solutions found", data.nb);
     print_sol(data.min);
     print_sol(data.max);
-    println("");
+    println!("");
 }
index 041d86c3d955a9ec1bf653514baf5d67c965d169..ba9bd40e08e61df3949a11ca22cc3151516672ed 100644 (file)
@@ -80,7 +80,7 @@ fn pidigits(n: int) {
 
     let m = n % 10;
     if m != 0 {
-        for _ in range(m, 10) {print(" ");}
+        for _ in range(m, 10) { print!(" "); }
         print!("\t:{}\n", n);
     }
 }
index 300efbbc4fabb85fcb80f2c753cfbe7258c1ca95..30d57d4d755f04ade8515289684b84ab6950fe1a 100644 (file)
@@ -22,7 +22,7 @@ fn f(x: &mut Either<int,f64>, y: &Either<int,f64>) -> int {
 
     fn g() {
         let mut x: Either<int,f64> = Left(3);
-        println(f(&mut x, &x).to_str()); //~ ERROR cannot borrow
+        println!("{}", f(&mut x, &x)); //~ ERROR cannot borrow
     }
 
     fn h() {
index ade9ce9568f958a5b758c6a8abefcd3576cac1c8..06b77686d2e5049025b0d187e2a3288de36034c5 100644 (file)
@@ -1,6 +1,6 @@
 struct S {f:~str}
 impl Drop for S {
-    fn drop(&mut self) { println(self.f); }
+    fn drop(&mut self) { println!("{}", self.f); }
 }
 
 fn move_in_match() {
index cb56e929754da1ccf77669eb819f65065e54372b..058b8a3ce29d263559a53b8559f9c73964f77bfb 100644 (file)
@@ -16,5 +16,5 @@ fn main() {
         },
         None => { fail!() }
     }
-    println(*msg);
+    println!("{}", *msg);
 }
index 460e2ce23fc9f0a65f1a5fe6db055b913a0ca19e..f05931d7fb40885ff793dd0cc9c81b69749a95d1 100644 (file)
@@ -17,6 +17,6 @@ fn main() {
     };
     match &s.x {
         &Foo => {}
-        &Bar(ref identifier) => println(*identifier)
+        &Bar(ref identifier) => println!("{}", *identifier)
     };
 }
index 261fa489f610160ad0fac82864d368bd5ac8628c..2adf44d4b615702875f3473a7c492f8ad5d6a1f0 100644 (file)
@@ -13,5 +13,5 @@
 mod circular_modules_main;
 
 pub fn say_hello() {
-  println(circular_modules_main::hi_str());
+    println!("{}", circular_modules_main::hi_str());
 }
index 3da709942e0e65724cb0f115914dbc999194a9cd..44c62442ff4d104248a473c1da3a9a8dcddeeb89 100644 (file)
@@ -7,7 +7,7 @@ fn call_bare(f: fn(&str)) {
 
 fn main() {
     let string = "world!";
-    let f: |&str| = |s| println(s + string);
+    let f: |&str| = |s| println!("{}", s + string);
     call_bare(f)    //~ ERROR mismatched types
 }
 
index 93aeb48e302cba95d5d59b01151934574fb412a8..ff901f986e68d5891755726ddf5026c31214622d 100644 (file)
@@ -15,7 +15,7 @@
 impl Drop for Foo {   //~ ERROR the Drop trait may only be implemented
 //~^ ERROR cannot provide an extension implementation
     fn drop(&mut self) {
-        println("kaboom");
+        println!("kaboom");
     }
 }
 
index 4a34f9c42be4032f04654e8ce33a3568903fc69a..3f69cb6e51ea296debafb182374444556bb78bbd 100644 (file)
@@ -14,7 +14,7 @@ struct Foo {
 
 impl Drop for Foo {
     fn drop(&mut self) {
-        println("kaboom");
+        println!("kaboom");
     }
 }
 
index 2a5c260910b6f25b9cc32d445584af97a6f1771c..3d987bf4c58a2be9aae93d88116aa706fbb9838d 100644 (file)
@@ -18,7 +18,7 @@ trait Bar : Drop {
 
 impl Drop for Foo {
     fn drop(&mut self) {
-        println("kaboom");
+        println!("kaboom");
     }
 }
 
index cb2fedcf9d6a892d0344b9b4c4d98f3b6e1d6ea2..00945ea84693cca38682064b87e42b53c06fbd8b 100644 (file)
@@ -17,7 +17,7 @@
 struct A { y: Arc<int>, x: Arc<int> }
 
 impl Drop for A {
-    fn drop(&mut self) { println(format!("x={:?}", self.x.get())); }
+    fn drop(&mut self) { println!("x={:?}", self.x.get()); }
 }
 fn main() {
     let a = A { y: Arc::new(1), x: Arc::new(2) };
index 1c816c6260169ec2a3bcd94cebd4e8b44b69011e..79af6617ab341e83e9d570950c591ed1f6fa7a4f 100644 (file)
@@ -24,8 +24,8 @@ fn deserialize(repr: &[u8]) -> &'self str {
 }
 
 fn main() {
-    println("hello");
+    println!("hello");
     let x = ~"foo";
     let y = x;
-    println(y);
+    println!("{}", y);
 }
index def712d9e8de4314cebbbcd500dec0d4debbd202..19bd9b2476b04337563436a9449bda735533376e 100644 (file)
@@ -22,7 +22,7 @@ struct foo {
 impl Drop for foo {
     fn drop(&mut self) {
         unsafe {
-            println("Goodbye, World!");
+            println!("Goodbye, World!");
             self.x.set(self.x.get() + 1);
         }
     }
index e3af6ce78e2c9be2e13f054642702b88a3d3ac9b..308a881935555a2f5b0591c3f5e35cc1676e2c66 100644 (file)
@@ -31,8 +31,8 @@ fn ne(&self, other: &Lol) -> bool { **self == **other }
 
 fn main() {
     if Lol(2) == Lol(4) {
-        println("2 == 4");
+        println!("2 == 4");
     } else {
-        println("2 != 4");
+        println!("2 != 4");
     }
 }
index f8f4b0608a57e461797a33fd344edec9ee050859..6c5fe580e14c74684eaa5367cac2c6dad2894316 100644 (file)
@@ -28,5 +28,5 @@ fn to_str(&self) -> ~str {
 
 fn main() {
     let p = Point::new(0.0f, 0.0f);
-    io::println(p.to_str());
+    println!("{}", p.to_str());
 }
index ef5ad2766ca69b8804bd26a5d74a2d61ec565154..d15fed2d9d261a014a45ef3f555c5144fae1a427 100644 (file)
 
 macro_rules! print_hd_tl (
     ($field_hd:ident, $($field_tl:ident),+) => ({
-        print(stringify!($field)); //~ ERROR unknown macro variable
-        print("::[");
+        print!("{}", stringify!($field)); //~ ERROR unknown macro variable
+        print!("::[");
         $(
-            print(stringify!($field_tl));
-            print(", ");
+            print!("{}", stringify!($field_tl));
+            print!(", ");
         )+
-        print("]\n");
+        // FIXME: #9970
+        print!("{}", "]\n");
     })
 )
 
index 54e25aea09b1bbf5b08fcfb8f33970345226631c..88cf4537f10d4db198935b53baf3556e89134885 100644 (file)
@@ -7,7 +7,7 @@ fn main() {
     }
 
     match ~[~"foo", ~"bar", ~"baz"] {
-        [a, _, _, ..] => { println(a); }
+        [a, _, _, ..] => { println!("{}", a); }
         [~"foo", ~"bar", ~"baz", ~"foo", ~"bar"] => { } //~ ERROR unreachable pattern
         _ => { }
     }
index 690c778183c60b1cc68e6d2f61689a8b1d89c500..3cad214a44a7e21406ae0abbea28e49afe550fed 100644 (file)
@@ -18,7 +18,7 @@ fn main() {
         f(&s, |hellothere| {
             match hellothere.x {
                 ~Foo(_) => {}
-                ~Bar(x) => println(x.to_str()), //~ ERROR cannot move out
+                ~Bar(x) => println!("{}", x.to_str()), //~ ERROR cannot move out
                 ~Baz => {}
             }
         })
index 706ab051ca1a0ca8bf6aa91c0e0fc5cbe8687167..dd68cb8e994e93a1ecf7f0cbb76e6508267bc0df 100644 (file)
@@ -3,7 +3,7 @@
 fn main() {
     let x = ~"Hello world!";
     do task::spawn {
-        println(x);
+        println!("{}", x);
     }
-    println(x); //~ ERROR use of moved value
+    println!("{}", x); //~ ERROR use of moved value
 }
index e215407ec87d1efbcbb4ee452ae5c860e8ee9ebf..779a1ec7a5bf022d5f11d7168f3f9135c8d5242f 100644 (file)
@@ -25,8 +25,7 @@ impl ToStr for Test {} //~ ERROR: attempt to implement a nonexistent trait
         impl Writer for Test {} //~ ERROR: attempt to implement a nonexistent trait
 
         fn foo() {
-            print("foo"); //~ ERROR: unresolved name
-            println("bar"); //~ ERROR: unresolved name
+            drop(2) //~ ERROR: unresolved name
         }
     }
 
@@ -38,8 +37,7 @@ impl ToStr for Test {} //~ ERROR: attempt to implement a nonexistent trait
     impl Writer for Test {} //~ ERROR: attempt to implement a nonexistent trait
 
     fn foo() {
-        print("foo"); //~ ERROR: unresolved name
-        println("bar"); //~ ERROR: unresolved name
+        drop(2) //~ ERROR: unresolved name
     }
 }
 
@@ -54,8 +52,7 @@ impl ToStr for Test {} //~ ERROR: attempt to implement a nonexistent trait
         impl Writer for Test {} //~ ERROR: attempt to implement a nonexistent trait
 
         fn foo() {
-            print("foo"); //~ ERROR: unresolved name
-            println("bar"); //~ ERROR: unresolved name
+            drop(2) //~ ERROR: unresolved name
         }
     }
 }
@@ -63,6 +60,5 @@ fn foo() {
 
 fn main() {
     // these should work fine
-    print("foo");
-    println("bar");
+    drop(2)
 }
index ca4533a03c864acde1137d4246c37f3d7074a13f..7f88af36e8a5c4a6ca279e531532e419c3ffbca1 100644 (file)
@@ -24,6 +24,5 @@ impl ToStr for Test {} //~ ERROR: attempt to implement a nonexistent trait
 impl Writer for Test {} //~ ERROR: attempt to implement a nonexistent trait
 
 fn main() {
-    print("foo"); //~ ERROR: unresolved name
-    println("bar"); //~ ERROR: unresolved name
+    drop(2) //~ ERROR: unresolved name
 }
index 524deed20f243c43764449d45e0744175a968b3e..d5489b6a852e444232206a7bb84b0a4d817e9126 100644 (file)
@@ -9,6 +9,6 @@
 // except according to those terms.
 
 fn main() {
-    let f = |3: int| println("hello");  //~ ERROR refutable pattern
+    let f = |3: int| println!("hello");  //~ ERROR refutable pattern
     f(4);
 }
index ab3f8496eaf26352446158e06ab43a841a571b23..77146b65ae676b4ccc3773088d0d51c0d6593cdf 100644 (file)
@@ -18,7 +18,7 @@ struct Foo {
 
 impl Drop for Foo {
     fn drop(&mut self) {
-        println("Goodbye!");
+        println!("Goodbye!");
     }
 }
 
index c4a5dc4710cba6da5ea53045302eaa057998fa1f..606a86f188f15fb299cd710dc931198ae40ae150 100644 (file)
@@ -1,7 +1,7 @@
 enum E {}
 
 fn f(e: E) {
-    println((e as int).to_str());   //~ ERROR non-scalar cast
+    println!("{}", (e as int).to_str());   //~ ERROR non-scalar cast
 }
 
 fn main() {}
index a9a7966ebeb9858eb5cff2debfaf6b6f75d9e874..843b61c9dbee209e154091d7ea414eeb5dd052f2 100644 (file)
@@ -22,7 +22,7 @@ fn drop(&mut self) {}
 
 impl Foo for Bar {
     fn f(&self) {
-        println("hi");
+        println!("hi");
     }
 }
 
index e8802e6e5cb6857ceaa74f042870f9741a620f82..dc6f5e046b4b7878076c91fc3349b24ea3877b43 100644 (file)
@@ -11,5 +11,5 @@
 fn main() {
     let x = ~"Hello!";
     let _y = x;
-    println(x); //~ ERROR use of moved value
+    println!("{}", x); //~ ERROR use of moved value
 }
index 5440e1e2728c5991857664331afe7b75a003c31f..b98827409a8774c9b6bf67934f7c1095dbc419b8 100644 (file)
@@ -17,5 +17,5 @@ pub fn bar(self) {}
 
 fn main() {
     let x = S { x: 1 };
-    println(x.foo().to_str());
+    println!("{}", x.foo());
 }
index c38f4821b881e4b04c745decee451f2bba38c0f0..69a0b94c348df8a1e041922e283a7f8181dc196f 100644 (file)
@@ -13,5 +13,5 @@ pub fn bar(self) {}
 
 fn main() {
     let x = S { x: ~1 };
-    println(x.foo().to_str());
+    println!("{}", x.foo());
 }
index e0a4afd4bdfddf8e3d825c8119b3734bb2d7a133..f9fcfa22f14f756466b2d13045f1acbf1dd558f9 100644 (file)
@@ -163,7 +163,7 @@ fn assignment(mut a: u64, b: u64, c: f64) {
 }
 
 fn function_call(x: u64, y: u64, z: f64) {
-    print("Hi!")
+    std::io::stdio::print("Hi!")
 }
 
 fn identifier(x: u64, y: u64, z: f64) -> u64 {
index b0528744cff7ca8739b00f9398e22c2200a64769..4d940c91d2a4cb5db8a285e6c9471c124200df20 100644 (file)
@@ -162,7 +162,7 @@ fn assignment(mut a: u64, b: u64, c: f64) {
 
 #[no_split_stack]
 fn function_call(x: u64, y: u64, z: f64) {
-    print("Hi!")
+    std::io::stdio::print("Hi!")
 }
 
 #[no_split_stack]
index 843e9436229ec67473ec8c4ece823c117da41325..98975c7f021c3ffaefdfc31d1b364dd20136090b 100644 (file)
@@ -20,5 +20,5 @@ pub fn new() -> Foo {
 
 pub fn main() {
     let x = Foo::new();
-    println(x.x.to_str());
+    println!("{}", x.x);
 }
index 5780a4e97aed62567b8d7a719e7255f267b5c106..c797aa1fec1496c6d977eb96142e2fa2e8014e4e 100644 (file)
@@ -16,5 +16,5 @@
 
 pub fn main() {
     let x = Foo::new();
-    println(x.x.to_str());
+    println!("{}", x.x);
 }
index 5211e76d3d7d2073565b5e2bb382f9d489524f33..ee3738518cd771f1f261277401b1cfb3659048e5 100644 (file)
@@ -28,7 +28,7 @@ fn f(&self) {
 
 impl Baz for Bar {
     fn g(&self) {
-        println(self.x.to_str());
+        println!("{}", self.x);
     }
 }
 
index 9b2855d269d73f045bfb16187d50b53ef56f49c0..fefb303fc70feb83cf05346a952b1df3598f8f88 100644 (file)
@@ -10,5 +10,5 @@
 
 pub fn main() {
     let x: &'static str = "foo";
-    println(x);
+    println!("{}", x);
 }
index a55f5f97d085b8800f6b088eb3dc578bbe4b7845..aab5053693c96650359bfa9143ae5c428f170187 100644 (file)
@@ -16,7 +16,7 @@ trait Foo {
 
 impl Foo for int {
     fn foo(@self) {
-        println("Hello world!");
+        println!("Hello world!");
     }
 }
 
index 629a807266182f10330717afb453fa082bb013ea..61175a401abe269495918e47eaa5ec5a5d46b044 100644 (file)
@@ -2,9 +2,10 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 use std::cast;
+use std::io::stdio::println;
 
 fn call_it(f: proc(~str) -> ~str) {
-    println(f(~"Fred"))
+    println!("{}", f(~"Fred"))
 }
 
 fn call_a_thunk(f: ||) {
@@ -57,9 +58,9 @@ pub fn main() {
 
     // Closures
 
-    call_a_thunk(|| println("Hello world!"));
+    call_a_thunk(|| println!("Hello world!"));
 
-    call_this(|s| println(s));
+    call_this(|s| println!("{}", s));
 
     call_that(|x, y| *x + *y);
 
index 4072d1d2bb83639ff7e150596809f9237820c07a..547f342243c2bc2de0d6fd0b76010bc4d4af055d 100644 (file)
@@ -11,7 +11,7 @@
 
 trait Foo {
     fn f(&self) {
-        println("Hello!");
+        println!("Hello!");
         self.g();
     }
     fn g(&self);
@@ -23,7 +23,7 @@ struct A {
 
 impl Foo for A {
     fn g(&self) {
-        println("Goodbye!");
+        println!("Goodbye!");
     }
 }
 
index 39453af83c3815013eaeac873eb97759c9481687..977bd474d177d012c39fdaca98f2c9e55f060c08 100644 (file)
@@ -15,7 +15,7 @@ struct S<T> {
 #[unsafe_destructor]
 impl<T> ::std::ops::Drop for S<T> {
     fn drop(&mut self) {
-        println("bye");
+        println!("bye");
     }
 }
 
index e36379295c419e2f4b103596b418fd115884aa91..8cbfee6c78d304eccd65e78a31ebce23928bf805 100644 (file)
@@ -14,7 +14,7 @@ struct Foo {
 
 impl Drop for Foo {
     fn drop(&mut self) {
-        println("bye");
+        println!("bye");
     }
 }
 
index e1be481099c1888422778071f739bc60c827dd8c..28fd5dbfa8dec2561f2366aafc344c7367037d3c 100644 (file)
@@ -2,15 +2,15 @@
 
 pub fn main() {
     let v: ~[int] = ~[ 1, ..5 ];
-    println(v[0].to_str());
-    println(v[1].to_str());
-    println(v[2].to_str());
-    println(v[3].to_str());
-    println(v[4].to_str());
+    println!("{}", v[0]);
+    println!("{}", v[1]);
+    println!("{}", v[2]);
+    println!("{}", v[3]);
+    println!("{}", v[4]);
     let v: @[int] = @[ 2, ..5 ];
-    println(v[0].to_str());
-    println(v[1].to_str());
-    println(v[2].to_str());
-    println(v[3].to_str());
-    println(v[4].to_str());
+    println!("{}", v[0]);
+    println!("{}", v[1]);
+    println!("{}", v[2]);
+    println!("{}", v[3]);
+    println!("{}", v[4]);
 }
index 4643c809961e7b7c10d1c98d70007516e6eb201a..f8a1f2b8488de8b170f1e5eeee693a2e228853d2 100644 (file)
@@ -16,5 +16,5 @@
 use extra::json::Object;
 
 pub fn main() {
-    println("Hello world!");
+    println!("Hello world!");
 }
index b80cdf9fbbd9ccb216a642cd52810f58b175968b..b7c2c8d4953cbfc3138126651d59e8a727badc00 100644 (file)
@@ -14,9 +14,9 @@ struct S {
 
 pub fn main() {
     let x: f32 = 4.0;
-    println(x.to_str());
+    println!("{}", x);
     let y: f64 = 64.0;
-    println(y.to_str());
+    println!("{}", y);
     let z = S { z: 1.0 };
-    println(z.z.to_str());
+    println!("{}", z.z);
 }
index 8102673586b4461b7561c44a43f6ca736a85baf6..8590c8b90b24e61697eb4e440a3cc05202f4e704 100644 (file)
@@ -11,7 +11,7 @@
 pub fn main() {
     let v : &[(int,int)] = &[ (1, 2), (3, 4), (5, 6) ];
     for &(x, y) in v.iter() {
-        println(y.to_str());
-        println(x.to_str());
+        println!("{}", y);
+        println!("{}", x);
     }
 }
index 1322756407a79aa2869e2102dfa06ee3a6065301..61dcbb75b9ef9af4630d64efefee8ceffa3ebf7a 100644 (file)
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 pub fn main() {
-    println("hello, world");
+    println!("hello, world");
 }
index b3e4a4e6711fdb54c99b659e7640cb73c87baede..306294fa76d3bfd900356498708850b09622d657 100644 (file)
@@ -6,5 +6,5 @@
 pub fn main() {
     let fish1 = impl_privacy_xc_2::Fish { x: 1 };
     let fish2 = impl_privacy_xc_2::Fish { x: 2 };
-    println(if fish1.eq(&fish2) { "yes" } else { "no " });
+    if fish1.eq(&fish2) { println!("yes") } else { println!("no") };
 }
index 5bb88df4662ba515c6e1f1ef86f2183b87016121..45c0ea4d543caeb5f160d9954b3529cc07bb3e9a 100644 (file)
@@ -15,7 +15,7 @@ struct trie_node {
 
 fn print_str_vector(vector: ~[~str]) {
     for string in vector.iter() {
-        println(*string);
+        println!("{}", *string);
     }
 }
 
index 3d56abb3de686fbeafc601fce14b49bc33f15f3f..a43445cd3aaa0b6665b87f16a2ec4fb5cc2d199a 100644 (file)
@@ -35,5 +35,5 @@ pub fn main() {
         element: S,
         next: None
     };
-    println(ls.element);
+    println!("{}", ls.element);
 }
index 863414d7da0730deba18342aed8c6baa480a9d9a..6f2d0481aec14462b0ed7754ba9021de34056f69 100644 (file)
@@ -16,7 +16,7 @@ trait Text {
   }
 
   fn to_string(t: @Text) {
-    println(t.to_str());
+    println!("{}", t.to_str());
   }
 
 }
index b5f41dd1630e0cf71b2bcbf0cac2268e6a16014c..de01448f9b85efaa7a8fc7341f779a3ca7bb32d9 100644 (file)
@@ -18,5 +18,5 @@ pub fn main() {
         buildings::Tower { height: h } => { h }
     };
 
-    println(h.to_str());
+    println!("{}", h);
 }
index 4a5cf156ce1006764e8844535f8f4655ec4f5774..dec148ca0f6dc16fbd27806438d67ed6ef6e533d 100644 (file)
 */
 
 fn print1(b: bool, s1: &str, s2: &str) {
-    println(if b { s1 } else { s2 });
+    println!("{}", if b { s1 } else { s2 });
 }
 fn print2<'a, 'b>(b: bool, s1: &'a str, s2: &'b str) {
-    println(if b { s1 } else { s2 });
+    println!("{}", if b { s1 } else { s2 });
 }
 fn print3(b: bool, s1: &str, s2: &str) {
     let mut s: &str;
     if b { s = s1; } else { s = s2; }
-    println(s);
+    println!("{}", s);
 }
 fn print4<'a, 'b>(b: bool, s1: &'a str, s2: &'b str) {
     let mut s: &str;
     if b { s = s1; } else { s = s2; }
-    println(s);
+    println!("{}", s);
 }
 
 pub fn main() {}
index 7a09741acb18059e97863220dc0abe9664de2fb7..4cdf7aa3dd02d385aced665f816116bd06dbe6d9 100644 (file)
@@ -111,7 +111,7 @@ enum Result {
 
 fn query(cmd: ~[~str], sb: TcpSocketBuf) -> Result {
   let cmd = cmd_to_str(cmd);
-  //io::println(cmd);
+  //println!("{}", cmd);
   sb.write_str(cmd);
   let res = parse_response(@sb as @io::Reader);
   res
index 53b45ba99caf01d0da257785c7d3d3f467b469e0..baac8d0dcd14c462fe51f36e6b338d45d863bfd5 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+use std::io::println;
+
 pub fn main() {
     let (port, chan) = Chan::new();
 
index 32e13f5ac7f461051ab276acd0b30d09bfdc3549..c1cab34f41cc72e0b4eb14974401022d83a5b2dd 100644 (file)
@@ -26,5 +26,5 @@ fn parse_args() -> ~str {
 }
 
 pub fn main() {
-    println(parse_args());
+    println!("{}", parse_args());
 }
index 7b96d5a48b9fdcf1a6d4a61522ab309d889b2d6d..f02d2ad49c0532864c0d65bed5603696f23df5d2 100644 (file)
 
 macro_rules! print_hd_tl (
     ($field_hd:ident, $($field_tl:ident),+) => ({
-        print(stringify!($field_hd));
-        print("::[");
+        print!("{}", stringify!($field_hd));
+        print!("::[");
         $(
-            print(stringify!($field_tl));
-            print(", ");
+            print!("{}", stringify!($field_tl));
+            print!(", ");
         )+
-        print("]\n");
+        // FIXME: #9970
+        print!("{}", "]\n");
     })
 )
 
index 4a0236b2da8d0dea252e45f18c63df0f40f3e235..0b2155cc3d03c862f7c0a551ff156f0a01fc24ed 100644 (file)
@@ -14,7 +14,7 @@ trait Fooable {
 
 impl Fooable for uint {
     fn yes(self) {
-        self.times(|| println("yes"));
+        self.times(|| println!("yes"));
     }
 }
 
index 0a2af3e70c512e3c50b4aadc68ccb173a38fdce5..871ff892909607848924c49f7f0b1957b229b5d7 100644 (file)
@@ -24,7 +24,7 @@ trait Inner {
 }
 
 impl Inner for int {
-    fn print(&self) { print(format!("Inner: {}\n", *self)); }
+    fn print(&self) { print!("Inner: {}\n", *self); }
 }
 
 struct Outer<'a> {
index 2bd233c9aedfad0b2f198c34c5ff6787103253c7..4e74a7a1ecfe08eabc878c1638fba3d8a2792b19 100644 (file)
@@ -23,5 +23,5 @@ struct signature<'a> { pattern : &'a [u32] }
 
 pub fn main() {
   let test = &[0x243f6a88u32,0x85a308d3u32,0x13198a2eu32,0x03707344u32,0xa4093822u32,0x299f31d0u32];
-  println(format!("{}",test==test1.pattern));
+  println!("{}",test==test1.pattern);
 }
index 1f172725b5ead2a978cda926047d72cdd2bb5006..f15c6de97783bd79bf2472807e579797b2195ad8 100644 (file)
@@ -7,7 +7,7 @@ struct B<'a> { b: int, pa: &'a A }
 
     impl IDummy for A {
         fn do_nothing(&self) {
-            println("A::do_nothing() is called");
+            println!("A::do_nothing() is called");
         }
     }
 
index fc7e24ccd7afc5e8e523c53e2bcc0bfe32d899f6..27b161e659f618a1bffb4a44c5047ac47b6c3dc4 100644 (file)
@@ -15,7 +15,7 @@ pub fn main() {
     match &[(~5,~7)] {
         ps => {
            let (ref y, _) = ps[0];
-           println(fmt!("1. y = %d", **y));
+           println!("1. y = {}", **y);
            assert!(**y == 5);
         }
     }
@@ -24,8 +24,8 @@ pub fn main() {
     match Some(&[(~5,)]) {
         Some(ps) => {
            let (ref y,) = ps[0];
-           println(fmt!("2. y = %d", **y));
-           if **y != 5 { println("sadness"); }
+           println!("2. y = {}", **y);
+           if **y != 5 { println!("sadness"); }
         }
         None => ()
     }
@@ -34,7 +34,7 @@ pub fn main() {
     match Some(&[(~5,~7)]) {
         Some(ps) => {
            let (ref y, ref z) = ps[0];
-           println(fmt!("3. y = %d z = %d", **y, **z));
+           println!("3. y = {} z = {}", **y, **z);
            assert!(**y == 5);
         }
         None => ()
index 2a341474872c32b12ec90860aa92141b1109d1df..80253d40a43c89f6b6a3e142ab4759782de00873 100644 (file)
@@ -11,7 +11,7 @@
 fn f() {
     let a = ~"hello";
     let b: &str = a;
-    println(b);
+    println!("{}", b);
 }
 
 pub fn main() {
index 0580bc938d7d424be1b3b9b001f8c2d8ea93c764..dbc88f023696b5e218c37836b1c8a25f44550479 100644 (file)
@@ -22,5 +22,5 @@ fn parse_args() -> ~str {
 }
 
 pub fn main() {
-    println(parse_args());
+    println!("{}", parse_args());
 }
index 55a7edbb679c6df17dc0b044e340ad72888747a4..1bb45b867c3341032b3fb967ea8ede1acf7a0460 100644 (file)
@@ -8,7 +8,7 @@ pub fn foo(self) {
     }
 
     pub fn bar(self) {
-        println(self.x);
+        println!("{}", self.x);
     }
 }
 
index 349be13e3232a71787648bca5c41e833593b5569..064fb385dccb3243bbcf4ee16e1e0369887a9ef4 100644 (file)
@@ -3,6 +3,6 @@
 pub fn main() {
     let x = ~"Hello world!";
     do task::spawn {
-        println(x);
+        println!("{}", x);
     }
 }
index a28008f3e0bab628374f08fb198b393f5721f3dd..ba3d89e3c7a647b9b9981dc7cfc9e6c0f8115f1e 100644 (file)
@@ -10,5 +10,5 @@
 
 // Test that multibyte characters don't crash the compiler
 pub fn main() {
-    println("마이너스 사인이 없으면");
+    println!("마이너스 사인이 없으면");
 }
index bc2c147b2429dd74c8ed2fd709425e9970eb6cb1..c1cdb3c1b23ff243cd24a68db4bbc5f54ae13566 100644 (file)
@@ -20,6 +20,6 @@ fn to_str(&self) -> ~str {
 }
 
 pub fn main() {
-    println(Thingy { x: 1, y: 2 }.to_str());
-    println(PolymorphicThingy { x: Thingy { x: 1, y: 2 } }.to_str());
+    println!("{}", Thingy { x: 1, y: 2 }.to_str());
+    println!("{}", PolymorphicThingy { x: Thingy { x: 1, y: 2 } }.to_str());
 }
index ef59606afe347e03d5e6d1b663975d692736926c..36e5b020b55abb33c0dccc0727cb2908f17a9077 100644 (file)
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 pub fn main() {
-    println("Hello world!");
+    println!("Hello world!");
 }
index 343c4d77702fd3cba06c0c84a129d058f05505c6..36a15373703edd10ed50fafdf4fee7210fd277b0 100644 (file)
@@ -13,6 +13,6 @@ pub fn main() {
     let f = thing.find_str("{{");
 
     if f.is_none() {
-        println("None!");
+        println!("None!");
     }
 }
index b6cb7f48c6d9eed5349840417da8f6b536de20f5..e4f1df2d6376df916c553f21a2e8ec7abbaf7d17 100644 (file)
@@ -14,8 +14,8 @@ struct Foo {
 }
 
 pub fn main() {
-    let f = |(x, _): (int, int)| println((x + 1).to_str());
-    let g = |Foo { x: x, y: _y }: Foo| println((x + 1).to_str());
+    let f = |(x, _): (int, int)| println!("{}", x + 1);
+    let g = |Foo { x: x, y: _y }: Foo| println!("{}", x + 1);
     f((2, 3));
     g(Foo { x: 1, y: 2 });
 }
index 94760ce36b57fe44217e8e740298d19f0fc217e6..b6451c57772666d32c979de52a86efc548cf252d 100644 (file)
@@ -11,4 +11,4 @@
 
 // pp-exact
 
-pub fn main() { println("Hello World"); }
+pub fn main() { println!("Hello World"); }
index 3566eedcb55517cfe70d98b9f54a540bf46b48f1..5411a514991ae56684844c2b73303da6452d4636 100644 (file)
@@ -18,7 +18,7 @@ enum color {
 
 pub fn main() {
     let act = format!("{:?}", red);
-    println(act);
+    println!("{}", act);
     assert_eq!(~"red", act);
     assert_eq!(~"green", format!("{:?}", green));
     assert_eq!(~"white", format!("{:?}", white));
index 415f7baf3d9cc2c46af99232e263210b71ab2d32..f6ccf987fcbc1ae8d5b9352c1300a647be255450 100644 (file)
@@ -10,6 +10,8 @@
 
 #[feature(managed_boxes)];
 
+use std::io::println;
+
 trait Trait<T> {
     fn f(&self, x: T);
 }
@@ -21,7 +23,7 @@ struct Struct {
 
 impl Trait<&'static str> for Struct {
     fn f(&self, x: &'static str) {
-        println(~"Hi, " + x + ~"!");
+        println!("Hi, {}!", x);
     }
 }
 
index 1c6968266e18dadbffd676007c00f835d6a8b02e..7ee11b5d6e93f1df504c55144c86c73d31a3d08e 100644 (file)
@@ -21,7 +21,7 @@ struct Struct {
 
 impl Trait for Struct {
     fn f(&self) {
-        println("Hi!");
+        println!("Hi!");
     }
 }
 
index 75b71c673a9cb2d875521dc0bc5886166f0db299..c1683082ae74a1cf1c04a65b0980dc7476d41f6a 100644 (file)
@@ -12,7 +12,7 @@ struct S {
 
 impl Foo<S> for S {
     fn f(&self, x: &S) {
-        println(x.x.to_str());
+        println!("{}", x.x);
     }
 }
 
index 0b54ccbbd47ce7bdac9d99476d649b1f254f65f9..412fb6625e33fa062a720975a05c927c20303cbc 100644 (file)
@@ -18,7 +18,7 @@ struct A {
 
 impl Foo for A {
     fn f(&self) -> int {
-        println(~"Today's number is " + self.x.to_str());
+        println!("Today's number is {}", self.x);
         return self.x;
     }
 }
index c8f2afe8c6171351e223242efcebed36db317c0b..d798d7ef84b7e95a8fc5a063f411854c36563e99 100644 (file)
@@ -21,7 +21,7 @@ pub struct Foo {
 
     impl ::base::HasNew<Foo> for Foo {
         fn new() -> Foo {
-            println("Foo");
+            println!("Foo");
             Foo { dummy: () }
         }
     }
@@ -32,7 +32,7 @@ pub struct Bar {
 
     impl ::base::HasNew<Bar> for Bar {
         fn new() -> Bar {
-            println("Bar");
+            println!("Bar");
             Bar { dummy: () }
         }
     }
index 82aeb08a7035f9e6d62a080c0a1fdcdcd2060980..849b5810c5f14da7fe015c45fc3aa1f1f1ebd1e3 100644 (file)
@@ -13,6 +13,6 @@
 pub fn main() {
     let x: Foo = Foo;
     match x {
-        Foo => { println("hi"); }
+        Foo => { println!("hi"); }
     }
 }