]> git.lizzy.rs Git - rust.git/commitdiff
Change 'print(fmt!(...))' to printf!/printfln! in src/lib*
authorBirunthan Mohanathas <birunthan@mohanathas.com>
Mon, 22 Jul 2013 16:03:39 +0000 (19:03 +0300)
committerDaniel Micay <danielmicay@gmail.com>
Wed, 24 Jul 2013 13:45:20 +0000 (09:45 -0400)
27 files changed:
src/libextra/base64.rs
src/libextra/future.rs
src/libextra/getopts.rs
src/libextra/task_pool.rs
src/libextra/treemap.rs
src/librust/rust.rs
src/librustc/back/passes.rs
src/librustc/metadata/encoder.rs
src/librustc/middle/borrowck/mod.rs
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/callee.rs
src/librustc/middle/trans/glue.rs
src/librustc/middle/ty.rs
src/librustc/rustc.rs
src/librustc/util/common.rs
src/librustdoc/config.rs
src/librustdoc/rustdoc.rs
src/librusti/rusti.rs
src/librustpkg/testsuite/pass/src/fancy-lib/pkg.rs
src/libstd/iterator.rs
src/libstd/num/uint_macros.rs
src/libstd/rand.rs
src/libstd/rand/distributions.rs
src/libstd/str.rs
src/libstd/vec.rs
src/libsyntax/ext/tt/macro_rules.rs
src/libsyntax/parse/token.rs

index 3c549d4291710d48fddf7010261bda886fe9a545..37d95d622c0830094888d0f98be02478e4d648ff 100644 (file)
@@ -75,7 +75,7 @@ impl<'self> ToBase64 for &'self [u8] {
      *
      * fn main () {
      *     let str = [52,32].to_base64(standard);
-     *     println(fmt!("%s", str));
+     *     printfln!("%s", str);
      * }
      * ~~~
      */
@@ -164,7 +164,7 @@ impl<'self> ToBase64 for &'self str {
      *
      * fn main () {
      *     let str = "Hello, World".to_base64(standard);
-     *     println(fmt!("%s",str));
+     *     printfln!("%s", str);
      * }
      * ~~~
      *
@@ -194,9 +194,9 @@ impl<'self> FromBase64 for &'self [u8] {
      *
      * fn main () {
      *     let str = [52,32].to_base64(standard);
-     *     println(fmt!("%s", str));
+     *     printfln!("%s", str);
      *     let bytes = str.from_base64();
-     *     println(fmt!("%?",bytes));
+     *     printfln!("%?", bytes);
      * }
      * ~~~
      */
@@ -271,11 +271,11 @@ impl<'self> FromBase64 for &'self str {
      *
      * fn main () {
      *     let hello_str = "Hello, World".to_base64(standard);
-     *     println(fmt!("%s",hello_str));
+     *     printfln!("%s", hello_str);
      *     let bytes = hello_str.from_base64();
-     *     println(fmt!("%?",bytes));
+     *     printfln!("%?", bytes);
      *     let result_str = str::from_bytes(bytes);
-     *     println(fmt!("%s",result_str));
+     *     printfln!("%s", result_str);
      * }
      * ~~~
      */
index d8f21b460138e941e3ce2863b5a6c9cabcb53347..5e37efa647ad695225c7b8315fdc761879e208e1 100644 (file)
@@ -19,7 +19,7 @@
  * # fn make_a_sandwich() {};
  * let mut delayed_fib = extra::future::spawn (|| fib(5000) );
  * make_a_sandwich();
- * println(fmt!("fib(5000) = %?", delayed_fib.get()))
+ * printfln!("fib(5000) = %?", delayed_fib.get())
  * ~~~
  */
 
index 07a1c6744040e5dc6589d31d99217f5d3ee99f7f..ad452125239de6404b5e2c55a14c3c4f6a4d7d6a 100644 (file)
@@ -44,7 +44,7 @@
  *    }
  *
  *    fn print_usage(program: &str, _opts: &[Opt]) {
- *        println(fmt!("Usage: %s [options]", program));
+ *        printfln!("Usage: %s [options]", program);
  *        println("-o\t\tOutput");
  *        println("-h --help\tUsage");
  *    }
index 49d5dd93869535506e0b24a75343ade58e38a14d..edd16fe88f425196b0ad96201caf98858d90ffc3 100644 (file)
@@ -103,6 +103,6 @@ fn test_task_pool() {
     };
     let mut pool = TaskPool::new(4, Some(SingleThreaded), f);
     for 8.times {
-        pool.execute(|i| println(fmt!("Hello from thread %u!", *i)));
+        pool.execute(|i| printfln!("Hello from thread %u!", *i));
     }
 }
index 4ad1f56a9ae54a77e610dc5df53f7011a9f5c4ec..303ae6a6d1de147552c936844354f3ac8039e4c9 100644 (file)
@@ -1263,7 +1263,7 @@ fn test_iterator() {
 
         let mut n = 0;
         for m.iter().advance |x| {
-            println(fmt!("%?", x));
+            printfln!(x);
             assert_eq!(*x, n);
             n += 1
         }
index bc97ef0e8ca4d9541334773323127dfc25f1f05c..c47c573d16fbe3bbae89eef2f3649f9b1a026554 100644 (file)
@@ -132,13 +132,13 @@ fn print_usage(command_string: ~str) -> ValidUsage {
         match find_cmd(command_string) {
             Some(command) => {
                 match command.action {
-                    CallMain(prog, _) => io::println(fmt!(
+                    CallMain(prog, _) => printfln!(
                         "The %s command is an alias for the %s program.",
-                        command.cmd, prog)),
+                        command.cmd, prog),
                     _       => ()
                 }
                 match command.usage_full {
-                    UsgStr(msg) => io::println(fmt!("%s\n", msg)),
+                    UsgStr(msg) => printfln!("%s\n", msg),
                     UsgCall(f)  => f(),
                 }
                 Valid(0)
@@ -211,8 +211,7 @@ fn usage() {
 
     for COMMANDS.iter().advance |command| {
         let padding = " ".repeat(INDENT - command.cmd.len());
-        io::println(fmt!("    %s%s%s",
-                         command.cmd, padding, command.usage_line));
+        printfln!("    %s%s%s", command.cmd, padding, command.usage_line);
     }
 
     io::print(
index f9dc88074d3b15044ec670bd2a9c32c82faa592f..48a685058bbd5ce96e2cce4fbffa725ad87a2770 100644 (file)
@@ -191,15 +191,15 @@ pub fn list_passes() {
 
     io::println("\nAnalysis Passes:");
     for analysis_passes.iter().advance |&(name, desc)| {
-        io::println(fmt!("    %-30s -- %s", name, desc));
+        printfln!("    %-30s -- %s", name, desc);
     }
     io::println("\nTransformation Passes:");
     for transform_passes.iter().advance |&(name, desc)| {
-        io::println(fmt!("    %-30s -- %s", name, desc));
+        printfln!("    %-30s -- %s", name, desc);
     }
     io::println("\nUtility Passes:");
     for utility_passes.iter().advance |&(name, desc)| {
-        io::println(fmt!("    %-30s -- %s", name, desc));
+        printfln!("    %-30s -- %s", name, desc);
     }
 }
 
@@ -344,7 +344,7 @@ fn passes_exist() {
     if failed.len() > 0 {
         io::println("Some passes don't exist:");
         for failed.iter().advance |&n| {
-            io::println(fmt!("    %s", n));
+            printfln!("    %s", n);
         }
         fail!();
     }
index 3c02609def11e9e930305e2f1286d714bf9026df..78e1a579d741b1cf28f2cbb0edbb6b763acc9e7e 100644 (file)
@@ -1624,16 +1624,16 @@ pub fn encode_metadata(parms: EncodeParams, crate: &Crate) -> ~[u8] {
         }
 
         io::println("metadata stats:");
-        io::println(fmt!("    inline bytes: %u", ecx.stats.inline_bytes));
-        io::println(fmt!(" attribute bytes: %u", ecx.stats.attr_bytes));
-        io::println(fmt!("       dep bytes: %u", ecx.stats.dep_bytes));
-        io::println(fmt!(" lang item bytes: %u", ecx.stats.lang_item_bytes));
-        io::println(fmt!(" link args bytes: %u", ecx.stats.link_args_bytes));
-        io::println(fmt!("      misc bytes: %u", ecx.stats.misc_bytes));
-        io::println(fmt!("      item bytes: %u", ecx.stats.item_bytes));
-        io::println(fmt!("     index bytes: %u", ecx.stats.index_bytes));
-        io::println(fmt!("      zero bytes: %u", ecx.stats.zero_bytes));
-        io::println(fmt!("     total bytes: %u", ecx.stats.total_bytes));
+        printfln!("    inline bytes: %u", ecx.stats.inline_bytes);
+        printfln!(" attribute bytes: %u", ecx.stats.attr_bytes);
+        printfln!("       dep bytes: %u", ecx.stats.dep_bytes);
+        printfln!(" lang item bytes: %u", ecx.stats.lang_item_bytes);
+        printfln!(" link args bytes: %u", ecx.stats.link_args_bytes);
+        printfln!("      misc bytes: %u", ecx.stats.misc_bytes);
+        printfln!("      item bytes: %u", ecx.stats.item_bytes);
+        printfln!("     index bytes: %u", ecx.stats.index_bytes);
+        printfln!("      zero bytes: %u", ecx.stats.zero_bytes);
+        printfln!("     total bytes: %u", ecx.stats.total_bytes);
     }
 
     // Pad this, since something (LLVM, presumably) is cutting off the
index b307280729ed47f4789866bad76faa81e3274368..bf9b4fcaedfa6665a5da2d94456a5b8438385578 100644 (file)
@@ -93,16 +93,16 @@ pub fn check_crate(
 
     if tcx.sess.borrowck_stats() {
         io::println("--- borrowck stats ---");
-        io::println(fmt!("paths requiring guarantees: %u",
-                        bccx.stats.guaranteed_paths));
-        io::println(fmt!("paths requiring loans     : %s",
-                         make_stat(bccx, bccx.stats.loaned_paths_same)));
-        io::println(fmt!("paths requiring imm loans : %s",
-                         make_stat(bccx, bccx.stats.loaned_paths_imm)));
-        io::println(fmt!("stable paths              : %s",
-                         make_stat(bccx, bccx.stats.stable_paths)));
-        io::println(fmt!("paths requiring purity    : %s",
-                         make_stat(bccx, bccx.stats.req_pure_paths)));
+        printfln!("paths requiring guarantees: %u",
+                  bccx.stats.guaranteed_paths);
+        printfln!("paths requiring loans     : %s",
+                  make_stat(bccx, bccx.stats.loaned_paths_same));
+        printfln!("paths requiring imm loans : %s",
+                  make_stat(bccx, bccx.stats.loaned_paths_imm));
+        printfln!("stable paths              : %s",
+                  make_stat(bccx, bccx.stats.stable_paths));
+        printfln!("paths requiring purity    : %s",
+                  make_stat(bccx, bccx.stats.req_pure_paths));
     }
 
     return (bccx.root_map, bccx.write_guard_map);
index bf5c5ac334de99a09c8c8732098ad5c5f488d721..fba67d57994e4d1b5fae91976dbc3008ce428021 100644 (file)
@@ -3011,17 +3011,15 @@ pub fn trans_crate(sess: session::Session,
     write_metadata(ccx, crate);
     if ccx.sess.trans_stats() {
         io::println("--- trans stats ---");
-        io::println(fmt!("n_static_tydescs: %u",
-                         ccx.stats.n_static_tydescs));
-        io::println(fmt!("n_glues_created: %u",
-                         ccx.stats.n_glues_created));
-        io::println(fmt!("n_null_glues: %u", ccx.stats.n_null_glues));
-        io::println(fmt!("n_real_glues: %u", ccx.stats.n_real_glues));
-
-        io::println(fmt!("n_fns: %u", ccx.stats.n_fns));
-        io::println(fmt!("n_monos: %u", ccx.stats.n_monos));
-        io::println(fmt!("n_inlines: %u", ccx.stats.n_inlines));
-        io::println(fmt!("n_closures: %u", ccx.stats.n_closures));
+        printfln!("n_static_tydescs: %u", ccx.stats.n_static_tydescs);
+        printfln!("n_glues_created: %u", ccx.stats.n_glues_created);
+        printfln!("n_null_glues: %u", ccx.stats.n_null_glues);
+        printfln!("n_real_glues: %u", ccx.stats.n_real_glues);
+
+        printfln!("n_fns: %u", ccx.stats.n_fns);
+        printfln!("n_monos: %u", ccx.stats.n_monos);
+        printfln!("n_inlines: %u", ccx.stats.n_inlines);
+        printfln!("n_closures: %u", ccx.stats.n_closures);
         io::println("fn stats:");
         do sort::quick_sort(ccx.stats.fn_stats) |&(_, _, insns_a), &(_, _, insns_b)| {
             insns_a > insns_b
@@ -3029,14 +3027,14 @@ pub fn trans_crate(sess: session::Session,
         for ccx.stats.fn_stats.iter().advance |tuple| {
             match *tuple {
                 (ref name, ms, insns) => {
-                    io::println(fmt!("%u insns, %u ms, %s", insns, ms, *name));
+                    printfln!("%u insns, %u ms, %s", insns, ms, *name);
                 }
             }
         }
     }
     if ccx.sess.count_llvm_insns() {
         for ccx.stats.llvm_insns.iter().advance |(k, v)| {
-            io::println(fmt!("%-7u %s", *v, *k));
+            printfln!("%-7u %s", *v, *k);
         }
     }
 
index 5f76981c794674530587fb5da3b8d4b75f8d02dd..d64615e5dc7b3507909544804eb363dbc0abaa35 100644 (file)
@@ -654,9 +654,9 @@ pub fn trans_call_inner(in_cx: @mut Block,
 
         // Uncomment this to debug calls.
         /*
-        io::println(fmt!("calling: %s", bcx.val_to_str(llfn)));
+        printfln!("calling: %s", bcx.val_to_str(llfn));
         for llargs.iter().advance |llarg| {
-            io::println(fmt!("arg: %s", bcx.val_to_str(*llarg)));
+            printfln!("arg: %s", bcx.val_to_str(*llarg));
         }
         io::println("---");
         */
index d554526a6d2370146c720c860be82f0316fca86f..024ab7af0814def9ef0f708d7960026c88a904e8 100644 (file)
@@ -37,7 +37,6 @@
 
 use middle::trans::type_::Type;
 
-use std::io;
 use std::libc::c_uint;
 use std::str;
 use syntax::ast;
@@ -649,8 +648,8 @@ pub fn declare_tydesc(ccx: &mut CrateContext, t: ty::t) -> @mut tydesc_info {
     let llty = type_of(ccx, t);
 
     if ccx.sess.count_type_sizes() {
-        io::println(fmt!("%u\t%s", llsize_of_real(ccx, llty),
-                         ppaux::ty_to_str(ccx.tcx, t)));
+        printfln!("%u\t%s", llsize_of_real(ccx, llty),
+                  ppaux::ty_to_str(ccx.tcx, t));
     }
 
     let llsize = llsize_of(ccx, llty);
index cd9d744c24034f5ceb7f99357a34d3d2a50175fc..7eea20175f9fc7e77e666849e76da5deb7cbcf6c 100644 (file)
@@ -2712,7 +2712,7 @@ pub fn node_id_to_trait_ref(cx: ctxt, id: ast::node_id) -> @ty::TraitRef {
 }
 
 pub fn node_id_to_type(cx: ctxt, id: ast::node_id) -> t {
-    //io::println(fmt!("%?/%?", id, cx.node_types.len()));
+    //printfln!("%?/%?", id, cx.node_types.len());
     match cx.node_types.find(&(id as uint)) {
        Some(&t) => t,
        None => cx.sess.bug(
index e97f67ceb9cc4e33cb5dbe479e8af896b9b7c39d..39fbdb92a2feef7fef10a6a9eb87ffdffe2b2f78 100644 (file)
@@ -128,28 +128,28 @@ pub fn version(argv0: &str) {
     let mut vers = ~"unknown version";
     let env_vers = env!("CFG_VERSION");
     if env_vers.len() != 0 { vers = env_vers.to_owned(); }
-    io::println(fmt!("%s %s", argv0, vers));
-    io::println(fmt!("host: %s", host_triple()));
+    printfln!("%s %s", argv0, vers);
+    printfln!("host: %s", host_triple());
 }
 
 pub fn usage(argv0: &str) {
     let message = fmt!("Usage: %s [OPTIONS] INPUT", argv0);
-    io::println(fmt!("%s\
+    printfln!("%s\
 Additional help:
     -W help             Print 'lint' options and default settings
     -Z help             Print internal options for debugging rustc\n",
-                     groups::usage(message, optgroups())));
+              groups::usage(message, optgroups()));
 }
 
 pub fn describe_warnings() {
     use extra::sort::Sort;
-    io::println(fmt!("
+    printfln!("
 Available lint options:
     -W <foo>           Warn about <foo>
     -A <foo>           Allow <foo>
     -D <foo>           Deny <foo>
     -F <foo>           Forbid <foo> (deny, and deny all overrides)
-"));
+");
 
     let lint_dict = lint::get_lint_dict();
     let mut lint_dict = lint_dict.consume()
@@ -164,28 +164,28 @@ pub fn describe_warnings() {
     fn padded(max: uint, s: &str) -> ~str {
         str::from_bytes(vec::from_elem(max - s.len(), ' ' as u8)) + s
     }
-    io::println(fmt!("\nAvailable lint checks:\n"));
-    io::println(fmt!("    %s  %7.7s  %s",
-                     padded(max_key, "name"), "default", "meaning"));
-    io::println(fmt!("    %s  %7.7s  %s\n",
-                     padded(max_key, "----"), "-------", "-------"));
+    printfln!("\nAvailable lint checks:\n");
+    printfln!("    %s  %7.7s  %s",
+              padded(max_key, "name"), "default", "meaning");
+    printfln!("    %s  %7.7s  %s\n",
+              padded(max_key, "----"), "-------", "-------");
     for lint_dict.consume_iter().advance |(spec, name)| {
         let name = name.replace("_", "-");
-        io::println(fmt!("    %s  %7.7s  %s",
-                         padded(max_key, name),
-                         lint::level_to_str(spec.default),
-                         spec.desc));
+        printfln!("    %s  %7.7s  %s",
+                  padded(max_key, name),
+                  lint::level_to_str(spec.default),
+                  spec.desc);
     }
     io::println("");
 }
 
 pub fn describe_debug_flags() {
-    io::println(fmt!("\nAvailable debug options:\n"));
+    printfln!("\nAvailable debug options:\n");
     let r = session::debugging_opts_map();
     for r.iter().advance |tuple| {
         match *tuple {
             (ref name, ref desc, _) => {
-                io::println(fmt!("    -Z %-20s -- %s", *name, *desc));
+                printfln!("    -Z %-20s -- %s", *name, *desc);
             }
         }
     }
index 733e8093a9d706788e76c7b34b0019c674ddf00c..6d5498898555d0bc96f465ded8522c89bac72373 100644 (file)
@@ -14,7 +14,6 @@
 use syntax::visit;
 
 use std::hashmap::HashSet;
-use std::io;
 use extra;
 
 pub fn time<T>(do_it: bool, what: ~str, thunk: &fn() -> T) -> T {
@@ -22,7 +21,7 @@ pub fn time<T>(do_it: bool, what: ~str, thunk: &fn() -> T) -> T {
     let start = extra::time::precise_time_s();
     let rv = thunk();
     let end = extra::time::precise_time_s();
-    io::println(fmt!("time: %3.3f s\t%s", end - start, what));
+    printfln!("time: %3.3f s\t%s", end - start, what);
     rv
 }
 
index 675ff7a8b951284759e03757d9961e5c8f374502..de4815ab7a6ede4863e259bd3365c547366baf76 100644 (file)
@@ -74,7 +74,7 @@ pub fn usage() {
     println("Options:\n");
     let r = opts();
     for r.iter().advance |opt| {
-        println(fmt!("    %s", opt.second()));
+        printfln!("    %s", opt.second());
     }
     println("");
 }
index cd2ffd7d602196ebfe683a73850f0a6e587b775c..b738f4a958681c4c04140fd90df5e91029b95f87 100644 (file)
@@ -23,7 +23,6 @@
 extern mod rustc;
 extern mod syntax;
 
-use std::io;
 use std::os;
 
 use config::Config;
@@ -69,7 +68,7 @@ pub fn main() {
     let config = match config::parse_config(args) {
       Ok(config) => config,
       Err(err) => {
-        io::println(fmt!("error: %s", err));
+        printfln!("error: %s", err);
         return;
       }
     };
index 63cf4001594f973835963de654a589ae754b98d0..38c70f8be0595b44ef67757328a2ac9d450e14dc 100644 (file)
@@ -334,7 +334,7 @@ fn compile_crate(src_filename: ~str, binary: ~str) -> Option<bool> {
             None => { },
         }
         if (should_compile) {
-            println(fmt!("compiling %s...", src_filename));
+            printfln!("compiling %s...", src_filename);
             driver::compile_upto(sess, cfg, &input, driver::cu_everything,
                                  Some(outputs));
             true
@@ -413,8 +413,7 @@ fn run_cmd(repl: &mut Repl, _in: @io::Reader, _out: @io::Writer,
             if loaded_crates.is_empty() {
                 println("no crates loaded");
             } else {
-                println(fmt!("crates loaded: %s",
-                                 loaded_crates.connect(", ")));
+                printfln!("crates loaded: %s", loaded_crates.connect(", "));
             }
         }
         ~"{" => {
index ebd6f9bf9d8cd920b5a37b1ad60de527b7966bb4..37eb3aa5911ed3a96f27f86f119db6dfd03db7b8 100644 (file)
@@ -34,7 +34,7 @@ pub fn main() {
     }
 
     if args[2] != ~"install" {
-        io::println(fmt!("Warning: I don't know how to %s", args[2]));
+        printfln!("Warning: I don't know how to %s", args[2]);
         return;
     }
 
index 2c971f0c9ce47c781b9e55c24ffc8d508c89d9ca..0c2a7bb7b400ca0a79f517a9c20ba0295f4f553a 100644 (file)
@@ -326,7 +326,7 @@ fn flat_map_<'r, B, U: Iterator<B>>(self, f: &'r fn(A) -> U)
     /// use std::iterator::Counter;
     ///
     /// for Counter::new(0, 10).advance |i| {
-    ///     io::println(fmt!("%d", i));
+    ///     printfln!("%d", i);
     /// }
     /// ~~~
     fn advance(&mut self, f: &fn(A) -> bool) -> bool;
index 54c1327fa9303798921d15ce735df9c64f59936f..acf7ea683fb544fd1f98506bffa70a3ad6e5e0e5 100644 (file)
@@ -103,7 +103,7 @@ fn range_step_core(start: $T, stop: $T, step: $T_SIGNED, r: Range, it: &fn($T) -
 /// let nums = [1,2,3,4,5,6,7];
 ///
 /// for uint::range_step(0, nums.len() - 1, 2) |i| {
-///     println(fmt!("%d & %d", nums[i], nums[i+1]));
+///     printfln!("%d & %d", nums[i], nums[i+1]);
 /// }
 /// ~~~
 ///
index 06c743edd2bed2244ad563a5e9de78a1881f6aae..6d0613b2e674fe40591080cfcb790b3f6aff792a 100644 (file)
@@ -28,7 +28,7 @@
 fn main() {
     let mut rng = rand::rng();
     if rng.gen() { // bool
-        println(fmt!("int: %d, uint: %u", rng.gen(), rng.gen()))
+        printfln!("int: %d, uint: %u", rng.gen(), rng.gen())
     }
 }
 ~~~
@@ -38,7 +38,7 @@ fn main() {
 
 fn main () {
     let tuple_ptr = rand::random::<~(f64, char)>();
-    println(fmt!("%?", tuple_ptr))
+    printfln!(tuple_ptr)
 }
 ~~~
 */
@@ -301,7 +301,7 @@ pub trait RngUtil {
      *
      * fn main() {
      *     let mut rng = rand::rng();
-     *     println(fmt!("%b",rng.gen_weighted_bool(3)));
+     *     printfln!("%b", rng.gen_weighted_bool(3));
      * }
      * ~~~
      */
@@ -335,7 +335,7 @@ pub trait RngUtil {
      *
      * fn main() {
      *     let mut rng = rand::rng();
-     *     println(fmt!("%?",rng.gen_bytes(8)));
+     *     printfln!(rng.gen_bytes(8));
      * }
      * ~~~
      */
@@ -352,7 +352,7 @@ pub trait RngUtil {
      *
      * fn main() {
      *     let mut rng = rand::rng();
-     *     println(fmt!("%d",rng.choose([1,2,4,8,16,32])));
+     *     printfln!("%d", rng.choose([1,2,4,8,16,32]));
      * }
      * ~~~
      */
@@ -375,7 +375,7 @@ pub trait RngUtil {
      *     let x = [rand::Weighted {weight: 4, item: 'a'},
      *              rand::Weighted {weight: 2, item: 'b'},
      *              rand::Weighted {weight: 2, item: 'c'}];
-     *     println(fmt!("%c",rng.choose_weighted(x)));
+     *     printfln!("%c", rng.choose_weighted(x));
      * }
      * ~~~
      */
@@ -396,7 +396,7 @@ pub trait RngUtil {
      *     let x = [rand::Weighted {weight: 4, item: 'a'},
      *              rand::Weighted {weight: 2, item: 'b'},
      *              rand::Weighted {weight: 2, item: 'c'}];
-     *     println(fmt!("%?",rng.choose_weighted_option(x)));
+     *     printfln!(rng.choose_weighted_option(x));
      * }
      * ~~~
      */
@@ -418,7 +418,7 @@ fn choose_weighted_option<T:Clone>(&mut self, v: &[Weighted<T>])
      *     let x = [rand::Weighted {weight: 4, item: 'a'},
      *              rand::Weighted {weight: 2, item: 'b'},
      *              rand::Weighted {weight: 2, item: 'c'}];
-     *     println(fmt!("%?",rng.weighted_vec(x)));
+     *     printfln!(rng.weighted_vec(x));
      * }
      * ~~~
      */
@@ -435,7 +435,7 @@ fn choose_weighted_option<T:Clone>(&mut self, v: &[Weighted<T>])
      *
      * fn main() {
      *     let mut rng = rand::rng();
-     *     println(fmt!("%?",rng.shuffle([1,2,3])));
+     *     printfln!(rng.shuffle([1,2,3]));
      * }
      * ~~~
      */
@@ -454,9 +454,9 @@ fn choose_weighted_option<T:Clone>(&mut self, v: &[Weighted<T>])
      *     let mut rng = rand::rng();
      *     let mut y = [1,2,3];
      *     rng.shuffle_mut(y);
-     *     println(fmt!("%?",y));
+     *     printfln!(y);
      *     rng.shuffle_mut(y);
-     *     println(fmt!("%?",y));
+     *     printfln!(y);
      * }
      * ~~~
      */
index 4d983b9495446209e0ab401260628866b16e15fb..56eae0428751eef99697c32e05b9d168dcd22ae4 100644 (file)
@@ -70,7 +70,7 @@ fn ziggurat<R:Rng>(rng: &mut R,
 ///
 /// fn main() {
 ///     let normal = 2.0 + (*rand::random::<StandardNormal>()) * 3.0;
-///     println(fmt!("%f is from a N(2, 9) distribution", normal))
+///     printfln!("%f is from a N(2, 9) distribution", normal)
 /// }
 /// ~~~
 pub struct StandardNormal(f64);
@@ -124,7 +124,7 @@ fn zero_case<R:Rng>(rng: &mut R, u: f64) -> f64 {
 ///
 /// fn main() {
 ///     let exp2 = (*rand::random::<Exp1>()) * 0.5;
-///     println(fmt!("%f is from a Exp(2) distribution", exp2));
+///     printfln!("%f is from a Exp(2) distribution", exp2);
 /// }
 /// ~~~
 pub struct Exp1(f64);
index c49a00502665b21416050fa7ad1a7096992e3a16..5b83112fe6bc048e72a58c6b801569e24f39146e 100644 (file)
@@ -1727,7 +1727,7 @@ fn is_char_boundary(&self, index: uint) -> bool {
      * let i = 0u;
      * while i < s.len() {
      *     let CharRange {ch, next} = s.char_range_at(i);
-     *     std::io::println(fmt!("%u: %c",i,ch));
+     *     printfln!("%u: %c", i, ch);
      *     i = next;
      * }
      * ~~~
index 9c66ee5eae45aa371c1e39ec5d79d1c0adf73be8..8432f28a969863b624a9abb1e73dc95a38bd0149 100644 (file)
@@ -833,7 +833,7 @@ fn rsplitn_iter(self, n: uint, pred: &'self fn(&T) -> bool) -> VecRSplitIterator
      * ~~~ {.rust}
      * let v = &[1,2,3,4];
      * for v.window_iter().advance |win| {
-     *     io::println(fmt!("%?", win));
+     *     printfln!(win);
      * }
      * ~~~
      *
@@ -862,7 +862,7 @@ fn window_iter(self, size: uint) -> VecWindowIter<'self, T> {
      * ~~~ {.rust}
      * let v = &[1,2,3,4,5];
      * for v.chunk_iter().advance |win| {
-     *     io::println(fmt!("%?", win));
+     *     printfln!(win);
      * }
      * ~~~
      *
index c20e35c299afd59cffdc947e33f30d80bdc02d41..4b3c8498380cc10f9412e37d697e5c4bffff05cd 100644 (file)
@@ -23,8 +23,6 @@
 use parse::token::{FAT_ARROW, SEMI, nt_matchers, nt_tt};
 use print;
 
-use std::io;
-
 pub fn add_new_extension(cx: @ExtCtxt,
                          sp: span,
                          name: ident,
@@ -82,11 +80,11 @@ fn generic_extension(cx: @ExtCtxt, sp: span, name: ident,
     -> MacResult {
 
         if cx.trace_macros() {
-            io::println(fmt!("%s! { %s }",
-                             cx.str_of(name),
-                             print::pprust::tt_to_str(
-                                 &ast::tt_delim(@mut arg.to_owned()),
-                                 get_ident_interner())));
+            printfln!("%s! { %s }",
+                      cx.str_of(name),
+                      print::pprust::tt_to_str(
+                          &ast::tt_delim(@mut arg.to_owned()),
+                          get_ident_interner()));
         }
 
         // Which arm's failure should we report? (the one furthest along)
index 2d15d0ab7e82b189840ad23c3cc0565ffeee7c97..52b6d4459bf4854199964137b418e2f1162aac10 100644 (file)
@@ -686,7 +686,7 @@ mod test {
     use std::io;
     #[test] fn t1() {
         let a = fresh_name("ghi");
-        io::println(fmt!("interned name: %u,\ntextual name: %s\n",
-                         a,interner_get(a)));
+        printfln!("interned name: %u,\ntextual name: %s\n",
+                  a, interner_get(a));
     }
 }