]> git.lizzy.rs Git - rust.git/commitdiff
`m1!{...}` -> `m1!(...)`
authorPaul Stansifer <paul.stansifer@gmail.com>
Thu, 23 Aug 2012 00:24:52 +0000 (17:24 -0700)
committerPaul Stansifer <paul.stansifer@gmail.com>
Thu, 23 Aug 2012 18:14:14 +0000 (11:14 -0700)
380 files changed:
src/cargo/cargo.rs
src/compiletest/compiletest.rs
src/compiletest/errors.rs
src/compiletest/header.rs
src/compiletest/runtest.rs
src/compiletest/util.rs
src/fuzzer/ast_match.rs
src/fuzzer/fuzzer.rs
src/libcore/extfmt.rs
src/libcore/future.rs
src/libcore/hash.rs
src/libcore/int-template.rs
src/libcore/io.rs
src/libcore/iter.rs
src/libcore/os.rs
src/libcore/pipes.rs
src/libcore/priv.rs
src/libcore/rand.rs
src/libcore/result.rs
src/libcore/run.rs
src/libcore/send_map.rs
src/libcore/stackwalk.rs
src/libcore/str.rs
src/libcore/task.rs
src/libstd/deque.rs
src/libstd/ebml.rs
src/libstd/getopts.rs
src/libstd/json.rs
src/libstd/map.rs
src/libstd/net_ip.rs
src/libstd/net_tcp.rs
src/libstd/par.rs
src/libstd/prettyprint.rs
src/libstd/smallintmap.rs
src/libstd/sort.rs
src/libstd/test.rs
src/libstd/time.rs
src/libstd/timer.rs
src/libstd/uv_global_loop.rs
src/libstd/uv_iotask.rs
src/libstd/uv_ll.rs
src/libsyntax/ast_map.rs
src/libsyntax/attr.rs
src/libsyntax/codemap.rs
src/libsyntax/diagnostic.rs
src/libsyntax/ext/auto_serialize.rs
src/libsyntax/ext/base.rs
src/libsyntax/ext/expand.rs
src/libsyntax/ext/fmt.rs
src/libsyntax/ext/pipes/check.rs
src/libsyntax/ext/pipes/liveness.rs
src/libsyntax/ext/pipes/pipec.rs
src/libsyntax/ext/pipes/proto.rs
src/libsyntax/ext/qquote.rs
src/libsyntax/ext/simplext.rs
src/libsyntax/ext/source_util.rs
src/libsyntax/ext/tt/earley_parser.rs
src/libsyntax/ext/tt/transcribe.rs
src/libsyntax/parse/comments.rs
src/libsyntax/parse/common.rs
src/libsyntax/parse/eval.rs
src/libsyntax/parse/lexer.rs
src/libsyntax/parse/parser.rs
src/libsyntax/print/pp.rs
src/libsyntax/print/pprust.rs
src/rustc/back/link.rs
src/rustc/back/rpath.rs
src/rustc/driver/driver.rs
src/rustc/driver/rustc.rs
src/rustc/front/intrinsic_inject.rs
src/rustc/front/test.rs
src/rustc/lib/llvm.rs
src/rustc/metadata/creader.rs
src/rustc/metadata/csearch.rs
src/rustc/metadata/cstore.rs
src/rustc/metadata/decoder.rs
src/rustc/metadata/encoder.rs
src/rustc/metadata/filesearch.rs
src/rustc/metadata/loader.rs
src/rustc/metadata/tydecode.rs
src/rustc/metadata/tyencode.rs
src/rustc/middle/astencode.rs
src/rustc/middle/borrowck.rs
src/rustc/middle/borrowck/check_loans.rs
src/rustc/middle/borrowck/gather_loans.rs
src/rustc/middle/borrowck/loan.rs
src/rustc/middle/borrowck/preserve.rs
src/rustc/middle/capture.rs
src/rustc/middle/kind.rs
src/rustc/middle/lang_items.rs
src/rustc/middle/lint.rs
src/rustc/middle/liveness.rs
src/rustc/middle/mem_categorization.rs
src/rustc/middle/region.rs
src/rustc/middle/resolve3.rs
src/rustc/middle/trans/base.rs
src/rustc/middle/trans/build.rs
src/rustc/middle/trans/closure.rs
src/rustc/middle/trans/common.rs
src/rustc/middle/trans/debuginfo.rs
src/rustc/middle/trans/foreign.rs
src/rustc/middle/trans/reachable.rs
src/rustc/middle/trans/reflect.rs
src/rustc/middle/trans/tvec.rs
src/rustc/middle/trans/type_of.rs
src/rustc/middle/trans/type_use.rs
src/rustc/middle/trans/uniq.rs
src/rustc/middle/tstate/annotate.rs [new file with mode: 0644]
src/rustc/middle/tstate/auxiliary.rs [new file with mode: 0644]
src/rustc/middle/tstate/ck.rs [new file with mode: 0644]
src/rustc/middle/tstate/collect_locals.rs [new file with mode: 0644]
src/rustc/middle/tstate/pre_post_conditions.rs [new file with mode: 0644]
src/rustc/middle/tstate/states.rs [new file with mode: 0644]
src/rustc/middle/ty.rs
src/rustc/middle/typeck.rs
src/rustc/middle/typeck/astconv.rs
src/rustc/middle/typeck/check.rs
src/rustc/middle/typeck/check/alt.rs
src/rustc/middle/typeck/check/method.rs
src/rustc/middle/typeck/check/regionck.rs
src/rustc/middle/typeck/check/regionmanip.rs
src/rustc/middle/typeck/check/vtable.rs
src/rustc/middle/typeck/check/writeback.rs
src/rustc/middle/typeck/coherence.rs
src/rustc/middle/typeck/collect.rs
src/rustc/middle/typeck/infer.rs
src/rustc/middle/typeck/infer/assignment.rs
src/rustc/middle/typeck/infer/combine.rs
src/rustc/middle/typeck/infer/glb.rs
src/rustc/middle/typeck/infer/integral.rs
src/rustc/middle/typeck/infer/lattice.rs
src/rustc/middle/typeck/infer/lub.rs
src/rustc/middle/typeck/infer/resolve.rs
src/rustc/middle/typeck/infer/sub.rs
src/rustc/middle/typeck/infer/to_str.rs
src/rustc/middle/typeck/infer/unify.rs
src/rustc/util/common.rs
src/rustc/util/ppaux.rs
src/rustdoc/attr_parser.rs
src/rustdoc/config.rs
src/rustdoc/markdown_pass.rs
src/rustdoc/markdown_writer.rs
src/rustdoc/rustdoc.rs
src/rustdoc/tystr_pass.rs
src/test/auxiliary/cci_class_4.rs
src/test/auxiliary/cci_class_cast.rs
src/test/auxiliary/extern-crosscrate-source.rs
src/test/auxiliary/issue_2242_b.rs
src/test/auxiliary/issue_2242_c.rs
src/test/auxiliary/test_comm.rs
src/test/bench/core-std.rs
src/test/bench/core-vec-append.rs
src/test/bench/graph500-bfs.rs
src/test/bench/msgsend-pipes-shared.rs
src/test/bench/msgsend-pipes.rs
src/test/bench/msgsend-ring-mutex-arcs.rs
src/test/bench/msgsend-ring-pipes.rs
src/test/bench/msgsend-ring-rw-arcs.rs
src/test/bench/msgsend-ring.rs
src/test/bench/msgsend.rs
src/test/bench/pingpong.rs
src/test/bench/shootout-ackermann.rs
src/test/bench/shootout-binarytrees.rs
src/test/bench/shootout-chameneos-redux.rs
src/test/bench/shootout-fannkuchredux.rs
src/test/bench/shootout-fibo.rs
src/test/bench/shootout-k-nucleotide-pipes.rs
src/test/bench/shootout-k-nucleotide.rs
src/test/bench/shootout-mandelbrot.rs
src/test/bench/shootout-nbody.rs
src/test/bench/shootout-pfib.rs
src/test/bench/shootout-spectralnorm.rs
src/test/bench/shootout-threadring.rs
src/test/bench/std-smallintmap.rs
src/test/bench/sudoku.rs
src/test/bench/task-perf-alloc-unwind.rs
src/test/bench/task-perf-one-million.rs
src/test/bench/task-perf-word-count-generic.rs
src/test/compile-fail/assign-imm-local-twice.rs
src/test/compile-fail/assign-to-method.rs
src/test/compile-fail/attr-before-ext.rs
src/test/compile-fail/bogus-tag.rs
src/test/compile-fail/borrowck-loan-blocks-move-cc.rs
src/test/compile-fail/class-cast-to-trait.rs
src/test/compile-fail/class-missing-self.rs
src/test/compile-fail/dead-code-ret.rs
src/test/compile-fail/does-nothing.rs
src/test/compile-fail/export2.rs
src/test/compile-fail/ext-after-attrib.rs
src/test/compile-fail/ext-nonexistent.rs
src/test/compile-fail/extenv-no-args.rs
src/test/compile-fail/extenv-not-string-literal.rs
src/test/compile-fail/extenv-too-many-args.rs
src/test/compile-fail/extfmt-missing-type.rs
src/test/compile-fail/extfmt-no-args.rs
src/test/compile-fail/extfmt-non-literal.rs
src/test/compile-fail/extfmt-non-literal2.rs
src/test/compile-fail/extfmt-not-enough-args.rs
src/test/compile-fail/extfmt-too-many-args.rs
src/test/compile-fail/extfmt-unknown-type.rs
src/test/compile-fail/extfmt-unsigned-plus.rs
src/test/compile-fail/extfmt-unsigned-space.rs
src/test/compile-fail/extfmt-unterminated-conv.rs
src/test/compile-fail/for-loop-decl.rs
src/test/compile-fail/import-glob-0.rs
src/test/compile-fail/import-glob-circular.rs
src/test/compile-fail/import.rs
src/test/compile-fail/import2.rs
src/test/compile-fail/import3.rs
src/test/compile-fail/import4.rs
src/test/compile-fail/issue-1448-1.rs
src/test/compile-fail/issue-1448-2.rs
src/test/compile-fail/liveness-if-with-else.rs
src/test/compile-fail/liveness-while-break.rs
src/test/compile-fail/macro-2.rs
src/test/compile-fail/macro.rs
src/test/compile-fail/not-utf8.rs
src/test/compile-fail/pure-higher-order.rs
src/test/compile-fail/regions-addr-of-self.rs
src/test/compile-fail/regions-escape-via-trait-or-not.rs
src/test/compile-fail/regions-ret-borrowed-1.rs
src/test/compile-fail/regions-ret-borrowed.rs
src/test/compile-fail/unbalanced-comment.rs
src/test/pretty/block-arg-disambig.rs
src/test/run-fail/bug-2470-bounds-check-overflow-2.rs
src/test/run-fail/bug-2470-bounds-check-overflow-3.rs
src/test/run-fail/bug-2470-bounds-check-overflow.rs
src/test/run-fail/extern-fail.rs
src/test/run-fail/fmt-fail.rs
src/test/run-pass-fulldeps/qquote.rs
src/test/run-pass/acyclic-unwind.rs
src/test/run-pass/alignment-gep-tup-like-1.rs
src/test/run-pass/alignment-gep-tup-like-2.rs
src/test/run-pass/alt-join.rs
src/test/run-pass/alt-pattern-drop.rs
src/test/run-pass/alt-pattern-lit.rs
src/test/run-pass/alt-pattern-no-type-params.rs
src/test/run-pass/alt-tag.rs
src/test/run-pass/alt-unique-bind.rs
src/test/run-pass/auto_serialize.rs
src/test/run-pass/basic-1.rs
src/test/run-pass/basic-2.rs
src/test/run-pass/basic.rs
src/test/run-pass/binops.rs
src/test/run-pass/borrowck-mut-uniq.rs
src/test/run-pass/borrowck-preserve-box-in-discr.rs
src/test/run-pass/borrowck-preserve-box-in-field.rs
src/test/run-pass/borrowck-preserve-box-in-pat.rs
src/test/run-pass/borrowck-preserve-box-in-uniq.rs
src/test/run-pass/borrowck-preserve-box.rs
src/test/run-pass/borrowck-preserve-cond-box.rs
src/test/run-pass/borrowck-preserve-expl-deref.rs
src/test/run-pass/box-inside-if.rs
src/test/run-pass/box-inside-if2.rs
src/test/run-pass/box-unbox.rs
src/test/run-pass/by-val-and-by-move.rs
src/test/run-pass/cast-region-to-uint.rs
src/test/run-pass/cci_borrow.rs
src/test/run-pass/cci_impl_exe.rs
src/test/run-pass/cci_iter_exe.rs
src/test/run-pass/cci_no_inline_exe.rs
src/test/run-pass/class-attributes-1.rs
src/test/run-pass/class-attributes-2.rs
src/test/run-pass/class-cast-to-trait-cross-crate-2.rs
src/test/run-pass/class-cast-to-trait-cross-crate.rs
src/test/run-pass/class-cast-to-trait-multiple-types.rs
src/test/run-pass/class-cast-to-trait.rs
src/test/run-pass/class-impl-parameterized-trait.rs
src/test/run-pass/class-impl-very-parameterized-trait.rs
src/test/run-pass/class-implement-trait-cross-crate.rs
src/test/run-pass/class-implement-traits.rs
src/test/run-pass/class-implements-multiple-traits.rs
src/test/run-pass/class-separate-impl.rs
src/test/run-pass/classes.rs
src/test/run-pass/close-over-big-then-small-data.rs
src/test/run-pass/comm.rs
src/test/run-pass/complex.rs
src/test/run-pass/const-rec-and-tup.rs
src/test/run-pass/const-struct.rs
src/test/run-pass/dead-code-one-arm-if.rs
src/test/run-pass/export-non-interference2.rs
src/test/run-pass/export-non-interference3.rs
src/test/run-pass/extern-call-deep.rs
src/test/run-pass/extern-call-deep2.rs
src/test/run-pass/extern-call-scrub.rs
src/test/run-pass/extern-call.rs
src/test/run-pass/extern-crosscrate.rs
src/test/run-pass/extern-yield.rs
src/test/run-pass/fact.rs
src/test/run-pass/float.rs
src/test/run-pass/fn-bare-item.rs
src/test/run-pass/foreach-simple-outer-slot.rs
src/test/run-pass/generic-tag-alt.rs
src/test/run-pass/hashmap-memory.rs
src/test/run-pass/hello.rs
src/test/run-pass/html-literals.rs
src/test/run-pass/import-glob-0.rs
src/test/run-pass/import-glob-1.rs
src/test/run-pass/import2.rs
src/test/run-pass/import3.rs
src/test/run-pass/import4.rs
src/test/run-pass/import5.rs
src/test/run-pass/import6.rs
src/test/run-pass/import7.rs
src/test/run-pass/inner-module.rs
src/test/run-pass/issue-1466.rs
src/test/run-pass/issue-2101.rs
src/test/run-pass/issue-2185.rs
src/test/run-pass/issue-2633.rs
src/test/run-pass/issue-2804-2.rs
src/test/run-pass/issue-2804.rs
src/test/run-pass/issue-2834.rs
src/test/run-pass/issue-687.rs
src/test/run-pass/item-attributes.rs
src/test/run-pass/lazychan.rs
src/test/run-pass/leaky_comm.rs
src/test/run-pass/liveness-loop-break.rs
src/test/run-pass/log-knows-the-names-of-variants-in-std.rs
src/test/run-pass/log-knows-the-names-of-variants.rs
src/test/run-pass/log-str.rs
src/test/run-pass/macro-2.rs
src/test/run-pass/macro-3.rs
src/test/run-pass/macro-by-example-1.rs
src/test/run-pass/macro-by-example-2.rs
src/test/run-pass/macro.rs
src/test/run-pass/many.rs
src/test/run-pass/max-min-classes.rs
src/test/run-pass/multi-src/bar.rs
src/test/run-pass/multi-src/foo.rs
src/test/run-pass/nested-alts.rs
src/test/run-pass/nested-pattern.rs
src/test/run-pass/paren-free.rs
src/test/run-pass/pipe-bank-proto.rs
src/test/run-pass/pipe-detect-term.rs
src/test/run-pass/pipe-presentation-examples.rs
src/test/run-pass/pipe-select-macro.rs
src/test/run-pass/pipe-select.rs
src/test/run-pass/placement-new-arena.rs
src/test/run-pass/preempt.rs
src/test/run-pass/pure-fmt.rs
src/test/run-pass/rcvr-borrowed-to-region.rs
src/test/run-pass/rcvr-borrowed-to-slice.rs
src/test/run-pass/rec-align-u32.rs
src/test/run-pass/rec-align-u64.rs
src/test/run-pass/reflect-visit-data.rs
src/test/run-pass/reflect-visit-type.rs
src/test/run-pass/regions-addr-of-ret.rs
src/test/run-pass/regions-borrow-at.rs
src/test/run-pass/resource-cycle.rs
src/test/run-pass/resource-destruct.rs
src/test/run-pass/rt-sched-1.rs
src/test/run-pass/select-macro.rs
src/test/run-pass/simple-alt-generic-tag.rs
src/test/run-pass/size-and-align.rs
src/test/run-pass/spawn-fn.rs
src/test/run-pass/struct-return.rs
src/test/run-pass/syntax-extension-fmt.rs
src/test/run-pass/syntax-extension-minor.rs
src/test/run-pass/syntax-extension-source-utils.rs
src/test/run-pass/tag-align-shape.rs
src/test/run-pass/tag-auto-disr-val-shape.rs
src/test/run-pass/tag-disr-val-shape.rs
src/test/run-pass/tail-cps.rs
src/test/run-pass/task-comm-0.rs
src/test/run-pass/task-comm-1.rs
src/test/run-pass/task-comm-12.rs
src/test/run-pass/task-comm-13.rs
src/test/run-pass/task-comm-14.rs
src/test/run-pass/task-comm-3.rs
src/test/run-pass/task-comm.rs
src/test/run-pass/task-killjoin-rsrc.rs
src/test/run-pass/threads.rs
src/test/run-pass/trait-cast.rs
src/test/run-pass/unique-copy-box.rs
src/test/run-pass/unwind-resource.rs
src/test/run-pass/weird-exprs.rs
src/test/run-pass/while-with-break.rs
src/test/run-pass/while.rs
src/test/run-pass/yield.rs
src/test/run-pass/yield1.rs

index 30d5fef72ed7e33413d8347f20b7b00c04d395ec..2330078a7bbb12b0b77c81bccb10da7fe22cb9f6 100644 (file)
@@ -371,7 +371,7 @@ fn rest(s: ~str, start: uint) -> ~str {
 fn need_dir(s: ~str) {
     if os::path_is_dir(s) { return; }
     if !os::make_dir(s, 493_i32 /* oct: 755 */) {
-        fail fmt!{"can't make_dir %s", s};
+        fail fmt!("can't make_dir %s", s);
     }
 }
 
@@ -389,7 +389,7 @@ fn is_valid_digit(c: char) -> bool {
 
 fn parse_source(name: ~str, j: json::json) -> source {
     if !valid_pkg_name(name) {
-        fail fmt!{"'%s' is an invalid source name", name};
+        fail fmt!("'%s' is an invalid source name", name);
     }
 
     match j {
@@ -432,11 +432,11 @@ fn try_parse_sources(filename: ~str, sources: map::hashmap<~str, source>) {
         ok(json::dict(j)) => {
           for j.each |k, v| {
                 sources.insert(k, parse_source(k, v));
-                debug!{"source: %s", k};
+                debug!("source: %s", k);
             }
         }
         ok(_) => fail ~"malformed sources.json",
-        err(e) => fail fmt!{"%s:%s", filename, e.to_str()}
+        err(e) => fail fmt!("%s:%s", filename, e.to_str())
     }
 }
 
@@ -559,7 +559,7 @@ fn load_source_info(c: cargo, src: source) {
                  ~"(source info is not a dict)");
         }
         err(e) => {
-            warn(fmt!{"%s:%s", src.name, e.to_str()});
+            warn(fmt!("%s:%s", src.name, e.to_str()));
         }
     };
 }
@@ -588,7 +588,7 @@ fn load_source_packages(c: cargo, src: source) {
                  ~"(packages is not a list)");
         }
         err(e) => {
-            warn(fmt!{"%s:%s", src.name, e.to_str()});
+            warn(fmt!("%s:%s", src.name, e.to_str()));
         }
     };
 }
@@ -597,7 +597,7 @@ fn build_cargo_options(argv: ~[~str]) -> options {
     let matches = match getopts::getopts(argv, opts()) {
         result::ok(m) => m,
         result::err(f) => {
-            fail fmt!{"%s", getopts::fail_str(f)};
+            fail fmt!("%s", getopts::fail_str(f));
         }
     };
 
@@ -707,11 +707,11 @@ fn run_in_buildpath(what: ~str, path: ~str, subdir: ~str, cf: ~str,
                     extra_flags: ~[~str]) -> option<~str> {
     let buildpath = path::connect(path, subdir);
     need_dir(buildpath);
-    debug!{"%s: %s -> %s", what, cf, buildpath};
+    debug!("%s: %s -> %s", what, cf, buildpath);
     let p = run::program_output(rustc_sysroot(),
                                 ~[~"--out-dir", buildpath, cf] + extra_flags);
     if p.status != 0 {
-        error(fmt!{"rustc failed: %d\n%s\n%s", p.status, p.err, p.out});
+        error(fmt!("rustc failed: %d\n%s\n%s", p.status, p.err, p.out));
         return none;
     }
     some(buildpath)
@@ -738,7 +738,7 @@ fn install_one_crate(c: cargo, path: ~str, cf: ~str) {
         if (exec_suffix != ~"" && str::ends_with(ct, exec_suffix)) ||
             (exec_suffix == ~"" && !str::starts_with(path::basename(ct),
                                                     ~"lib")) {
-            debug!{"  bin: %s", ct};
+            debug!("  bin: %s", ct);
             install_to_dir(ct, c.bindir);
             if c.opts.mode == system_mode {
                 // FIXME (#2662): Put this file in PATH / symlink it so it can
@@ -746,7 +746,7 @@ fn install_one_crate(c: cargo, path: ~str, cf: ~str) {
                 // `cargo install -G rustray` and `rustray file.obj`
             }
         } else {
-            debug!{"  lib: %s", ct};
+            debug!("  lib: %s", ct);
             install_to_dir(ct, c.libdir);
         }
     }
@@ -758,7 +758,7 @@ fn rustc_sysroot() -> ~str {
         some(path) => {
             let path = ~[path, ~"..", ~"bin", ~"rustc"];
             let rustc = path::normalize(path::connect_many(path));
-            debug!{"  rustc: %s", rustc};
+            debug!("  rustc: %s", rustc);
             rustc
         }
         none => ~"rustc"
@@ -766,7 +766,7 @@ fn rustc_sysroot() -> ~str {
 }
 
 fn install_source(c: cargo, path: ~str) {
-    debug!{"source: %s", path};
+    debug!("source: %s", path);
     os::change_dir(path);
 
     let mut cratefiles = ~[];
@@ -792,7 +792,7 @@ fn install_source(c: cargo, path: ~str) {
                     let wd_base = c.workdir + path::path_sep();
                     let wd = match tempfile::mkdtemp(wd_base, ~"") {
                         some(wd) => wd,
-                        none => fail fmt!{"needed temp dir: %s", wd_base}
+                        none => fail fmt!("needed temp dir: %s", wd_base)
                     };
 
                     install_query(c, wd, query);
@@ -825,7 +825,7 @@ fn install_curl(c: cargo, wd: ~str, url: ~str) {
     let p = run::program_output(~"curl", ~[~"-f", ~"-s", ~"-o",
                                          tarpath, url]);
     if p.status != 0 {
-        fail fmt!{"fetch of %s failed: %s", url, p.err};
+        fail fmt!("fetch of %s failed: %s", url, p.err);
     }
     run::run_program(~"tar", ~[~"-x", ~"--strip-components=1",
                              ~"-C", wd, ~"-f", tarpath]);
@@ -846,7 +846,7 @@ fn install_package(c: cargo, src: ~str, wd: ~str, pkg: package) {
         _ => ~"curl"
     };
 
-    info(fmt!{"installing %s/%s via %s...", src, pkg.name, method});
+    info(fmt!("installing %s/%s via %s...", src, pkg.name, method));
 
     match method {
         ~"git" => install_git(c, wd, url, copy pkg.reference),
@@ -1076,7 +1076,7 @@ fn cmd_install(c: cargo) unsafe {
     let wd_base = c.workdir + path::path_sep();
     let wd = match tempfile::mkdtemp(wd_base, ~"") {
         some(wd) => wd,
-        none => fail fmt!{"needed temp dir: %s", wd_base}
+        none => fail fmt!("needed temp dir: %s", wd_base)
     };
 
     if vec::len(c.opts.free) == 2u {
@@ -1084,7 +1084,7 @@ fn cmd_install(c: cargo) unsafe {
         let status = run::run_program(~"cp", ~[~"-R", cwd, wd]);
 
         if status != 0 {
-            fail fmt!{"could not copy directory: %s", cwd};
+            fail fmt!("could not copy directory: %s", cwd);
         }
 
         install_source(c, wd);
@@ -1120,7 +1120,7 @@ fn sync_one_file(c: cargo, dir: ~str, src: source) -> bool {
     let mut has_src_file = false;
 
     if !os::copy_file(path::connect(url, ~"packages.json"), pkgfile) {
-        error(fmt!{"fetch for source %s (url %s) failed", name, url});
+        error(fmt!("fetch for source %s (url %s) failed", name, url));
         return false;
     }
 
@@ -1136,7 +1136,7 @@ fn sync_one_file(c: cargo, dir: ~str, src: source) -> bool {
             let p = run::program_output(~"curl",
                                         ~[~"-f", ~"-s", ~"-o", keyfile, u]);
             if p.status != 0 {
-                error(fmt!{"fetch for source %s (key %s) failed", name, u});
+                error(fmt!("fetch for source %s (key %s) failed", name, u));
                 return false;
             }
             pgp::add(c.root, keyfile);
@@ -1148,8 +1148,8 @@ fn sync_one_file(c: cargo, dir: ~str, src: source) -> bool {
             let r = pgp::verify(c.root, pkgfile, sigfile, f);
 
             if !r {
-                error(fmt!{"signature verification failed for source %s",
-                          name});
+                error(fmt!("signature verification failed for source %s",
+                          name));
                 return false;
             }
 
@@ -1157,8 +1157,8 @@ fn sync_one_file(c: cargo, dir: ~str, src: source) -> bool {
                 let e = pgp::verify(c.root, srcfile, srcsigfile, f);
 
                 if !e {
-                    error(fmt!{"signature verification failed for source %s",
-                              name});
+                    error(fmt!("signature verification failed for source %s",
+                              name));
                     return false;
                 }
             }
@@ -1178,7 +1178,7 @@ fn sync_one_file(c: cargo, dir: ~str, src: source) -> bool {
     os::remove_file(pkgfile);
     os::remove_file(sigfile);
 
-    info(fmt!{"synced source: %s", name});
+    info(fmt!("synced source: %s", name));
 
     return true;
 }
@@ -1194,7 +1194,7 @@ fn sync_one_git(c: cargo, dir: ~str, src: source) -> bool {
 
     fn rollback(name: ~str, dir: ~str, insecure: bool) {
         fn msg(name: ~str, insecure: bool) {
-            error(fmt!{"could not rollback source: %s", name});
+            error(fmt!("could not rollback source: %s", name));
 
             if insecure {
                 warn(~"a past security check failed on source " +
@@ -1220,20 +1220,20 @@ fn msg(name: ~str, insecure: bool) {
         let p = run::program_output(~"git", ~[~"clone", url, dir]);
 
         if p.status != 0 {
-            error(fmt!{"fetch for source %s (url %s) failed", name, url});
+            error(fmt!("fetch for source %s (url %s) failed", name, url));
             return false;
         }
     }
     else {
         if !os::change_dir(dir) {
-            error(fmt!{"fetch for source %s (url %s) failed", name, url});
+            error(fmt!("fetch for source %s (url %s) failed", name, url));
             return false;
         }
 
         let p = run::program_output(~"git", ~[~"pull"]);
 
         if p.status != 0 {
-            error(fmt!{"fetch for source %s (url %s) failed", name, url});
+            error(fmt!("fetch for source %s (url %s) failed", name, url));
             return false;
         }
     }
@@ -1245,7 +1245,7 @@ fn msg(name: ~str, insecure: bool) {
             let p = run::program_output(~"curl",
                                         ~[~"-f", ~"-s", ~"-o", keyfile, u]);
             if p.status != 0 {
-                error(fmt!{"fetch for source %s (key %s) failed", name, u});
+                error(fmt!("fetch for source %s (key %s) failed", name, u));
                 rollback(name, dir, false);
                 return false;
             }
@@ -1258,8 +1258,8 @@ fn msg(name: ~str, insecure: bool) {
             let r = pgp::verify(c.root, pkgfile, sigfile, f);
 
             if !r {
-                error(fmt!{"signature verification failed for source %s",
-                          name});
+                error(fmt!("signature verification failed for source %s",
+                          name));
                 rollback(name, dir, false);
                 return false;
             }
@@ -1268,8 +1268,8 @@ fn msg(name: ~str, insecure: bool) {
                 let e = pgp::verify(c.root, srcfile, srcsigfile, f);
 
                 if !e {
-                    error(fmt!{"signature verification failed for source %s",
-                              name});
+                    error(fmt!("signature verification failed for source %s",
+                              name));
                     rollback(name, dir, false);
                     return false;
                 }
@@ -1280,7 +1280,7 @@ fn msg(name: ~str, insecure: bool) {
 
     os::remove_file(keyfile);
 
-    info(fmt!{"synced source: %s", name});
+    info(fmt!("synced source: %s", name));
 
     return true;
 }
@@ -1306,7 +1306,7 @@ fn sync_one_curl(c: cargo, dir: ~str, src: source) -> bool {
                                 ~[~"-f", ~"-s", ~"-o", pkgfile, url]);
 
     if p.status != 0 {
-        error(fmt!{"fetch for source %s (url %s) failed", name, url});
+        error(fmt!("fetch for source %s (url %s) failed", name, url));
         return false;
     }
     if smart {
@@ -1325,7 +1325,7 @@ fn sync_one_curl(c: cargo, dir: ~str, src: source) -> bool {
             let p = run::program_output(~"curl",
                                         ~[~"-f", ~"-s", ~"-o", keyfile, u]);
             if p.status != 0 {
-                error(fmt!{"fetch for source %s (key %s) failed", name, u});
+                error(fmt!("fetch for source %s (key %s) failed", name, u));
                 return false;
             }
             pgp::add(c.root, keyfile);
@@ -1344,15 +1344,15 @@ fn sync_one_curl(c: cargo, dir: ~str, src: source) -> bool {
             let mut p = run::program_output(~"curl", ~[~"-f", ~"-s", ~"-o",
                         sigfile, url]);
             if p.status != 0 {
-                error(fmt!{"fetch for source %s (sig %s) failed", name, url});
+                error(fmt!("fetch for source %s (sig %s) failed", name, url));
                 return false;
             }
 
             let r = pgp::verify(c.root, pkgfile, sigfile, f);
 
             if !r {
-                error(fmt!{"signature verification failed for source %s",
-                          name});
+                error(fmt!("signature verification failed for source %s",
+                          name));
                 return false;
             }
 
@@ -1363,8 +1363,8 @@ fn sync_one_curl(c: cargo, dir: ~str, src: source) -> bool {
                                         ~[~"-f", ~"-s", ~"-o",
                                           srcsigfile, url]);
                 if p.status != 0 {
-                    error(fmt!{"fetch for source %s (sig %s) failed",
-                          name, url});
+                    error(fmt!("fetch for source %s (sig %s) failed",
+                          name, url));
                     return false;
                 }
 
@@ -1392,7 +1392,7 @@ fn sync_one_curl(c: cargo, dir: ~str, src: source) -> bool {
     os::remove_file(pkgfile);
     os::remove_file(sigfile);
 
-    info(fmt!{"synced source: %s", name});
+    info(fmt!("synced source: %s", name));
 
     return true;
 }
@@ -1401,7 +1401,7 @@ fn sync_one(c: cargo, src: source) {
     let name = src.name;
     let dir = path::connect(c.sourcedir, name);
 
-    info(fmt!{"syncing source: %s...", name});
+    info(fmt!("syncing source: %s...", name));
 
     need_dir(dir);
 
@@ -1428,20 +1428,20 @@ fn cmd_init(c: cargo) {
     let p =
         run::program_output(~"curl", ~[~"-f", ~"-s", ~"-o", srcfile, srcurl]);
     if p.status != 0 {
-        error(fmt!{"fetch of sources.json failed: %s", p.out});
+        error(fmt!("fetch of sources.json failed: %s", p.out));
         return;
     }
 
     let p =
         run::program_output(~"curl", ~[~"-f", ~"-s", ~"-o", sigfile, sigurl]);
     if p.status != 0 {
-        error(fmt!{"fetch of sources.json.sig failed: %s", p.out});
+        error(fmt!("fetch of sources.json.sig failed: %s", p.out));
         return;
     }
 
     let r = pgp::verify(c.root, srcfile, sigfile, pgp::signing_key_fp());
     if !r {
-        error(fmt!{"signature verification failed for '%s'", srcfile});
+        error(fmt!("signature verification failed for '%s'", srcfile));
         return;
     }
 
@@ -1449,7 +1449,7 @@ fn cmd_init(c: cargo) {
     os::remove_file(srcfile);
     os::remove_file(sigfile);
 
-    info(fmt!{"initialized .cargo in %s", c.root});
+    info(fmt!("initialized .cargo in %s", c.root));
 }
 
 fn print_pkg(s: source, p: package) {
@@ -1490,14 +1490,14 @@ fn cmd_list(c: cargo) {
     if vec::len(c.opts.free) >= 3u {
         do vec::iter_between(c.opts.free, 2u, vec::len(c.opts.free)) |name| {
             if !valid_pkg_name(name) {
-                error(fmt!{"'%s' is an invalid source name", name});
+                error(fmt!("'%s' is an invalid source name", name));
             } else {
                 match c.sources.find(name) {
                     some(source) => {
                         print_source(source);
                     }
                     none => {
-                        error(fmt!{"no such source: %s", name});
+                        error(fmt!("no such source: %s", name));
                     }
                 }
             }
@@ -1527,7 +1527,7 @@ fn cmd_search(c: cargo) {
             n += 1;
         }
     });
-    info(fmt!{"found %d packages", n});
+    info(fmt!("found %d packages", n));
 }
 
 fn install_to_dir(srcfile: ~str, destdir: ~str) {
@@ -1535,9 +1535,9 @@ fn install_to_dir(srcfile: ~str, destdir: ~str) {
 
     let status = run::run_program(~"cp", ~[~"-r", srcfile, newfile]);
     if status == 0 {
-        info(fmt!{"installed: '%s'", newfile});
+        info(fmt!("installed: '%s'", newfile));
     } else {
-        error(fmt!{"could not install: '%s'", newfile});
+        error(fmt!("could not install: '%s'", newfile));
     }
 }
 
@@ -1595,22 +1595,22 @@ fn dump_sources(c: cargo) {
             writer.write_str(json::to_str(root));
         }
         result::err(e) => {
-            error(fmt!{"could not dump sources: %s", e});
+            error(fmt!("could not dump sources: %s", e));
         }
     }
 }
 
 fn copy_warn(srcfile: ~str, destfile: ~str) {
     if !os::copy_file(srcfile, destfile) {
-        warn(fmt!{"copying %s to %s failed", srcfile, destfile});
+        warn(fmt!("copying %s to %s failed", srcfile, destfile));
     }
 }
 
 fn cmd_sources(c: cargo) {
     if vec::len(c.opts.free) < 3u {
         for c.sources.each_value |v| {
-            info(fmt!{"%s (%s) via %s",
-                      v.name, v.url, v.method});
+            info(fmt!("%s (%s) via %s",
+                      v.name, v.url, v.method));
         }
         return;
     }
@@ -1635,13 +1635,13 @@ fn cmd_sources(c: cargo) {
             let url = c.opts.free[4u];
 
             if !valid_pkg_name(name) {
-                error(fmt!{"'%s' is an invalid source name", name});
+                error(fmt!("'%s' is an invalid source name", name));
                 return;
             }
 
             match c.sources.find(name) {
                 some(source) => {
-                    error(fmt!{"source already exists: %s", name});
+                    error(fmt!("source already exists: %s", name));
                 }
                 none => {
                     c.sources.insert(name, @{
@@ -1652,7 +1652,7 @@ fn cmd_sources(c: cargo) {
                         mut keyfp: none,
                         mut packages: ~[mut]
                     });
-                    info(fmt!{"added source: %s", name});
+                    info(fmt!("added source: %s", name));
                 }
             }
         }
@@ -1665,17 +1665,17 @@ fn cmd_sources(c: cargo) {
             let name = c.opts.free[3u];
 
             if !valid_pkg_name(name) {
-                error(fmt!{"'%s' is an invalid source name", name});
+                error(fmt!("'%s' is an invalid source name", name));
                 return;
             }
 
             match c.sources.find(name) {
                 some(source) => {
                     c.sources.remove(name);
-                    info(fmt!{"removed source: %s", name});
+                    info(fmt!("removed source: %s", name));
                 }
                 none => {
-                    error(fmt!{"no such source: %s", name});
+                    error(fmt!("no such source: %s", name));
                 }
             }
         }
@@ -1689,7 +1689,7 @@ fn cmd_sources(c: cargo) {
             let url = c.opts.free[4u];
 
             if !valid_pkg_name(name) {
-                error(fmt!{"'%s' is an invalid source name", name});
+                error(fmt!("'%s' is an invalid source name", name));
                 return;
             }
 
@@ -1703,10 +1703,10 @@ fn cmd_sources(c: cargo) {
 
                     c.sources.insert(name, source);
 
-                    info(fmt!{"changed source url: '%s' to '%s'", old, url});
+                    info(fmt!("changed source url: '%s' to '%s'", old, url));
                 }
                 none => {
-                    error(fmt!{"no such source: %s", name});
+                    error(fmt!("no such source: %s", name));
                 }
             }
         }
@@ -1720,7 +1720,7 @@ fn cmd_sources(c: cargo) {
             let method = c.opts.free[4u];
 
             if !valid_pkg_name(name) {
-                error(fmt!{"'%s' is an invalid source name", name});
+                error(fmt!("'%s' is an invalid source name", name));
                 return;
             }
 
@@ -1736,11 +1736,11 @@ fn cmd_sources(c: cargo) {
 
                     c.sources.insert(name, source);
 
-                    info(fmt!{"changed source method: '%s' to '%s'", old,
-                         method});
+                    info(fmt!("changed source method: '%s' to '%s'", old,
+                         method));
                 }
                 none => {
-                    error(fmt!{"no such source: %s", name});
+                    error(fmt!("no such source: %s", name));
                 }
             }
         }
@@ -1754,11 +1754,11 @@ fn cmd_sources(c: cargo) {
             let newn = c.opts.free[4u];
 
             if !valid_pkg_name(name) {
-                error(fmt!{"'%s' is an invalid source name", name});
+                error(fmt!("'%s' is an invalid source name", name));
                 return;
             }
             if !valid_pkg_name(newn) {
-                error(fmt!{"'%s' is an invalid source name", newn});
+                error(fmt!("'%s' is an invalid source name", newn));
                 return;
             }
 
@@ -1766,10 +1766,10 @@ fn cmd_sources(c: cargo) {
                 some(source) => {
                     c.sources.remove(name);
                     c.sources.insert(newn, source);
-                    info(fmt!{"renamed source: %s to %s", name, newn});
+                    info(fmt!("renamed source: %s to %s", name, newn));
                 }
                 none => {
-                    error(fmt!{"no such source: %s", name});
+                    error(fmt!("no such source: %s", name));
                 }
             }
         }
index fd9a12aa1f7b66d2ed5c41106cbaeaa644a7093b..73c824285abb395a522b435c3221fabf19f09d72 100644 (file)
@@ -63,20 +63,20 @@ fn parse_config(args: ~[~str]) -> config {
 
 fn log_config(config: config) {
     let c = config;
-    logv(c, fmt!{"configuration:"});
-    logv(c, fmt!{"compile_lib_path: %s", config.compile_lib_path});
-    logv(c, fmt!{"run_lib_path: %s", config.run_lib_path});
-    logv(c, fmt!{"rustc_path: %s", config.rustc_path});
-    logv(c, fmt!{"src_base: %s", config.src_base});
-    logv(c, fmt!{"build_base: %s", config.build_base});
-    logv(c, fmt!{"stage_id: %s", config.stage_id});
-    logv(c, fmt!{"mode: %s", mode_str(config.mode)});
-    logv(c, fmt!{"run_ignored: %b", config.run_ignored});
-    logv(c, fmt!{"filter: %s", opt_str(config.filter)});
-    logv(c, fmt!{"runtool: %s", opt_str(config.runtool)});
-    logv(c, fmt!{"rustcflags: %s", opt_str(config.rustcflags)});
-    logv(c, fmt!{"verbose: %b", config.verbose});
-    logv(c, fmt!{"\n"});
+    logv(c, fmt!("configuration:"));
+    logv(c, fmt!("compile_lib_path: %s", config.compile_lib_path));
+    logv(c, fmt!("run_lib_path: %s", config.run_lib_path));
+    logv(c, fmt!("rustc_path: %s", config.rustc_path));
+    logv(c, fmt!("src_base: %s", config.src_base));
+    logv(c, fmt!("build_base: %s", config.build_base));
+    logv(c, fmt!("stage_id: %s", config.stage_id));
+    logv(c, fmt!("mode: %s", mode_str(config.mode)));
+    logv(c, fmt!("run_ignored: %b", config.run_ignored));
+    logv(c, fmt!("filter: %s", opt_str(config.filter)));
+    logv(c, fmt!("runtool: %s", opt_str(config.runtool)));
+    logv(c, fmt!("rustcflags: %s", opt_str(config.rustcflags)));
+    logv(c, fmt!("verbose: %b", config.verbose));
+    logv(c, fmt!("\n"));
 }
 
 fn opt_str(maybestr: option<~str>) -> ~str {
@@ -129,11 +129,11 @@ fn test_opts(config: config) -> test::test_opts {
 }
 
 fn make_tests(config: config) -> ~[test::test_desc] {
-    debug!{"making tests from %s", config.src_base};
+    debug!("making tests from %s", config.src_base);
     let mut tests = ~[];
     for os::list_dir_path(config.src_base).each |file| {
         let file = file;
-        debug!{"inspecting file %s", file};
+        debug!("inspecting file %s", file);
         if is_test(config, file) {
             vec::push(tests, make_test(config, file))
         }
@@ -175,7 +175,7 @@ fn make_test(config: config, testfile: ~str) ->
 }
 
 fn make_test_name(config: config, testfile: ~str) -> ~str {
-    fmt!{"[%s] %s", mode_str(config.mode), testfile}
+    fmt!("[%s] %s", mode_str(config.mode), testfile)
 }
 
 fn make_test_closure(config: config, testfile: ~str) -> test::test_fn {
index 931a678d529fb47ebd7163ed5f8fc1c33cd4d376..030e1d01ab00dcdfeef3cea06a391b8157c084f6 100644 (file)
@@ -45,7 +45,7 @@ fn parse_expected(line_num: uint, line: ~str) -> ~[expected_error] unsafe {
     while idx < len && line[idx] == (' ' as u8) { idx += 1u; }
     let msg = str::slice(line, idx, len);
 
-    debug!{"line=%u kind=%s msg=%s", line_num - adjust_line, kind, msg};
+    debug!("line=%u kind=%s msg=%s", line_num - adjust_line, kind, msg);
 
     return ~[{line: line_num - adjust_line, kind: kind, msg: msg}];
 }
index 180dd75ed6ac039756248160c08a69d357e08fd3..efaa822d0159f05dde434eb54653abba59499832 100644 (file)
@@ -109,7 +109,7 @@ fn parse_exec_env(line: ~str) -> option<(~str, ~str)> {
         match strs.len() {
           1u => (strs[0], ~""),
           2u => (strs[0], strs[1]),
-          n => fail fmt!{"Expected 1 or 2 strings, not %u", n}
+          n => fail fmt!("Expected 1 or 2 strings, not %u", n)
         }
     }
 }
@@ -138,7 +138,7 @@ fn parse_name_value_directive(line: ~str,
         option::some(colon) => {
             let value = str::slice(line, colon + str::len(keycolon),
                                    str::len(line));
-            debug!{"%s: %s", directive,  value};
+            debug!("%s: %s", directive,  value);
             option::some(value)
         }
         option::none => option::none
index a6800053966c73443d61125bac12cf54d53bc1f8..6498a7d8952950a6124cd5f2822f3c8fa9480587 100644 (file)
@@ -16,7 +16,7 @@ fn run(config: config, testfile: ~str) {
         // We're going to be dumping a lot of info. Start on a new line.
         io::stdout().write_str(~"\n\n");
     }
-    debug!{"running %s", testfile};
+    debug!("running %s", testfile);
     let props = load_props(testfile);
     match config.mode {
       mode_compile_fail => run_cfail_test(config, props, testfile),
@@ -68,8 +68,8 @@ fn check_correct_failure_status(procres: procres) {
     const rust_err: int = 101;
     if procres.status != rust_err {
         fatal_procres(
-            fmt!{"failure produced the wrong error code: %d",
-                 procres.status},
+            fmt!("failure produced the wrong error code: %d",
+                 procres.status),
             procres);
     }
 }
@@ -96,11 +96,11 @@ fn run_pretty_test(config: config, props: test_props, testfile: ~str) {
 
     let mut round = 0;
     while round < rounds {
-        logv(config, fmt!{"pretty-printing round %d", round});
+        logv(config, fmt!("pretty-printing round %d", round));
         let procres = print_source(config, testfile, srcs[round]);
 
         if procres.status != 0 {
-            fatal_procres(fmt!{"pretty-printing failed in round %d", round},
+            fatal_procres(fmt!("pretty-printing failed in round %d", round),
                           procres);
         }
 
@@ -151,7 +151,7 @@ fn compare_source(expected: ~str, actual: ~str) {
         if expected != actual {
             error(~"pretty-printed source does not match expected source");
             let msg =
-                fmt!{"\n\
+                fmt!("\n\
 expected:\n\
 ------------------------------------------\n\
 %s\n\
@@ -161,7 +161,7 @@ fn compare_source(expected: ~str, actual: ~str) {
 %s\n\
 ------------------------------------------\n\
 \n",
-                     expected, actual};
+                     expected, actual);
             io::stdout().write_str(msg);
             fail;
         }
@@ -201,10 +201,10 @@ fn check_error_patterns(props: test_props,
     let mut done = false;
     for str::split_char(procres.stderr, '\n').each |line| {
         if str::contains(line, next_err_pat) {
-            debug!{"found error pattern %s", next_err_pat};
+            debug!("found error pattern %s", next_err_pat);
             next_err_idx += 1u;
             if next_err_idx == vec::len(props.error_patterns) {
-                debug!{"found all error patterns"};
+                debug!("found all error patterns");
                 done = true;
                 break;
             }
@@ -217,11 +217,11 @@ fn check_error_patterns(props: test_props,
         vec::slice(props.error_patterns, next_err_idx,
                    vec::len(props.error_patterns));
     if vec::len(missing_patterns) == 1u {
-        fatal_procres(fmt!{"error pattern '%s' not found!",
-                           missing_patterns[0]}, procres);
+        fatal_procres(fmt!("error pattern '%s' not found!",
+                           missing_patterns[0]), procres);
     } else {
         for missing_patterns.each |pattern| {
-            error(fmt!{"error pattern '%s' not found!", pattern});
+            error(fmt!("error pattern '%s' not found!", pattern));
         }
         fatal_procres(~"multiple error patterns not found", procres);
     }
@@ -240,7 +240,7 @@ fn check_expected_errors(expected_errors: ~[errors::expected_error],
     }
 
     let prefixes = vec::map(expected_errors, |ee| {
-        fmt!{"%s:%u:", testfile, ee.line}
+        fmt!("%s:%u:", testfile, ee.line)
     });
 
     // Scan and extract our error/warning messages,
@@ -253,8 +253,8 @@ fn check_expected_errors(expected_errors: ~[errors::expected_error],
         let mut was_expected = false;
         for vec::eachi(expected_errors) |i, ee| {
             if !found_flags[i] {
-                debug!{"prefix=%s ee.kind=%s ee.msg=%s line=%s",
-                       prefixes[i], ee.kind, ee.msg, line};
+                debug!("prefix=%s ee.kind=%s ee.msg=%s line=%s",
+                       prefixes[i], ee.kind, ee.msg, line);
                 if (str::starts_with(line, prefixes[i]) &&
                     str::contains(line, ee.kind) &&
                     str::contains(line, ee.msg)) {
@@ -272,7 +272,7 @@ fn check_expected_errors(expected_errors: ~[errors::expected_error],
 
         if !was_expected && (str::contains(line, ~"error") ||
                              str::contains(line, ~"warning")) {
-            fatal_procres(fmt!{"unexpected error pattern '%s'!", line},
+            fatal_procres(fmt!("unexpected error pattern '%s'!", line),
                           procres);
         }
     }
@@ -280,8 +280,8 @@ fn check_expected_errors(expected_errors: ~[errors::expected_error],
     for uint::range(0u, vec::len(found_flags)) |i| {
         if !found_flags[i] {
             let ee = expected_errors[i];
-            fatal_procres(fmt!{"expected %s on line %u not found: %s",
-                               ee.kind, ee.line, ee.msg}, procres);
+            fatal_procres(fmt!("expected %s on line %u not found: %s",
+                               ee.kind, ee.line, ee.msg), procres);
         }
     }
 }
@@ -330,7 +330,7 @@ fn compose_and_run_compiler(
                                      config.compile_lib_path, option::none);
         if auxres.status != 0 {
             fatal_procres(
-                fmt!{"auxiliary build of %s failed to compile: ", abs_ab},
+                fmt!("auxiliary build of %s failed to compile: ", abs_ab),
                 auxres);
         }
     }
@@ -342,7 +342,7 @@ fn compose_and_run_compiler(
 fn ensure_dir(path: Path) {
     if os::path_is_dir(path) { return; }
     if !os::make_dir(path, 0x1c0i32) {
-        fail fmt!{"can't make dir %s", path};
+        fail fmt!("can't make dir %s", path);
     }
 }
 
@@ -414,7 +414,7 @@ fn program_output(config: config, testfile: ~str, lib_path: ~str, prog: ~str,
     let cmdline =
         {
             let cmdline = make_cmdline(lib_path, prog, args);
-            logv(config, fmt!{"executing %s", cmdline});
+            logv(config, fmt!("executing %s", cmdline));
             cmdline
         };
     let res = procsrv::run(lib_path, prog, args, env, input);
@@ -430,19 +430,19 @@ fn program_output(config: config, testfile: ~str, lib_path: ~str, prog: ~str,
 #[cfg(target_os = "macos")]
 #[cfg(target_os = "freebsd")]
 fn make_cmdline(_libpath: ~str, prog: ~str, args: ~[~str]) -> ~str {
-    fmt!{"%s %s", prog, str::connect(args, ~" ")}
+    fmt!("%s %s", prog, str::connect(args, ~" "))
 }
 
 #[cfg(target_os = "win32")]
 fn make_cmdline(libpath: ~str, prog: ~str, args: ~[~str]) -> ~str {
-    fmt!{"%s %s %s", lib_path_cmd_prefix(libpath), prog,
-         str::connect(args, ~" ")}
+    fmt!("%s %s %s", lib_path_cmd_prefix(libpath), prog,
+         str::connect(args, ~" "))
 }
 
 // Build the LD_LIBRARY_PATH variable as it would be seen on the command line
 // for diagnostic purposes
 fn lib_path_cmd_prefix(path: ~str) -> ~str {
-    fmt!{"%s=\"%s\"", util::lib_path_env_var(), util::make_new_path(path)}
+    fmt!("%s=\"%s\"", util::lib_path_env_var(), util::make_new_path(path))
 }
 
 fn dump_output(config: config, testfile: ~str, out: ~str, err: ~str) {
@@ -475,13 +475,13 @@ fn output_testname(testfile: ~str) -> ~str {
 fn output_base_name(config: config, testfile: ~str) -> ~str {
     let base = config.build_base;
     let filename = output_testname(testfile);
-    fmt!{"%s%s.%s", base, filename, config.stage_id}
+    fmt!("%s%s.%s", base, filename, config.stage_id)
 }
 
 fn maybe_dump_to_stdout(config: config, out: ~str, err: ~str) {
     if config.verbose {
-        let sep1 = fmt!{"------%s------------------------------", ~"stdout"};
-        let sep2 = fmt!{"------%s------------------------------", ~"stderr"};
+        let sep1 = fmt!("------%s------------------------------", ~"stdout");
+        let sep2 = fmt!("------%s------------------------------", ~"stderr");
         let sep3 = ~"------------------------------------------";
         io::stdout().write_line(sep1);
         io::stdout().write_line(out);
@@ -491,13 +491,13 @@ fn maybe_dump_to_stdout(config: config, out: ~str, err: ~str) {
     }
 }
 
-fn error(err: ~str) { io::stdout().write_line(fmt!{"\nerror: %s", err}); }
+fn error(err: ~str) { io::stdout().write_line(fmt!("\nerror: %s", err)); }
 
 fn fatal(err: ~str) -> ! { error(err); fail; }
 
 fn fatal_procres(err: ~str, procres: procres) -> ! {
     let msg =
-        fmt!{"\n\
+        fmt!("\n\
 error: %s\n\
 command: %s\n\
 stdout:\n\
@@ -509,7 +509,7 @@ fn fatal_procres(err: ~str, procres: procres) -> ! {
 %s\n\
 ------------------------------------------\n\
 \n",
-             err, procres.cmdline, procres.stdout, procres.stderr};
+             err, procres.cmdline, procres.stdout, procres.stderr);
     io::stdout().write_str(msg);
     fail;
 }
index 0c7a0235bee92c22127387d548d1abf59b74214a..7a1f30a33efc544d90717efa84b4631c1035b6a6 100644 (file)
@@ -9,7 +9,7 @@ fn make_new_path(path: ~str) -> ~str {
     // maintain the current value while adding our own
     match getenv(lib_path_env_var()) {
       option::some(curr) => {
-        fmt!{"%s%s%s", path, path_div(), curr}
+        fmt!("%s%s%s", path, path_div(), curr)
       }
       option::none => path
     }
index dc063438e04881570a99cd77d8dc1e149de156a0..b1879ad75efce4e47abcf4af94f1edb5f5d5da38 100644 (file)
@@ -26,5 +26,5 @@ fn main() {
     assert (!vec_equal(~[5, 5], ~[4, 5], builtin_equal_int));
     assert (vec_equal(~[5, 5], ~[5, 5], builtin_equal_int));
 
-    error!{"Pass"};
+    error!("Pass");
 }
index 9c42b29304d312da3e9af1367957e19e8601dec9..d9e6c0042d4088458befd23bfb31688cff65c354 100644 (file)
@@ -242,8 +242,8 @@ fn check_variants_T<T: copy>(
   replacer: fn@(ast::crate, uint, T, test_mode) -> ast::crate,
   cx: context
   ) {
-    error!{"%s contains %u %s objects", filename,
-           vec::len(things), thing_label};
+    error!("%s contains %u %s objects", filename,
+           vec::len(things), thing_label);
 
     // Assuming we're not generating any token_trees
     let intr = syntax::parse::token::mk_fake_ident_interner();
@@ -274,9 +274,9 @@ fn check_variants_T<T: copy>(
                     check_roundtrip_convergence(str3, 1u);
                   }
                   tm_run => {
-                    let file_label = fmt!{"rusttmp/%s_%s_%u_%u",
+                    let file_label = fmt!("rusttmp/%s_%s_%u_%u",
                                           last_part(filename),
-                                          thing_label, i, j};
+                                          thing_label, i, j);
                     let safe_to_run = !(content_is_dangerous_to_run(*str3)
                                         || has_raw_pointers(*crate2));
                     check_whole_compiler(*str3, file_label, safe_to_run);
@@ -386,7 +386,7 @@ fn check_compiling(filename: ~str) -> happiness {
          stage1/bin/rustc",
         ~[filename]);
 
-    //error!{"Status: %d", p.status};
+    //error!("Status: %d", p.status);
     if p.status == 0 {
         passed
     } else if p.err != ~"" {
@@ -515,9 +515,9 @@ fn check_roundtrip_convergence(code: @~str, maxIters: uint) {
     }
 
     if oldv == newv {
-        error!{"Converged after %u iterations", i};
+        error!("Converged after %u iterations", i);
     } else {
-        error!{"Did not converge after %u iterations!", i};
+        error!("Did not converge after %u iterations!", i);
         write_file(~"round-trip-a.rs", *oldv);
         write_file(~"round-trip-b.rs", *newv);
         run::run_program(~"diff",
@@ -528,12 +528,12 @@ fn check_roundtrip_convergence(code: @~str, maxIters: uint) {
 }
 
 fn check_convergence(files: ~[~str]) {
-    error!{"pp convergence tests: %u files", vec::len(files)};
+    error!("pp convergence tests: %u files", vec::len(files));
     for files.each |file| {
         if !file_might_not_converge(file) {
             let s = @result::get(io::read_whole_file_str(file));
             if !content_might_not_converge(*s) {
-                error!{"pp converge: %s", file};
+                error!("pp converge: %s", file);
                 // Change from 7u to 2u once
                 // https://github.com/mozilla/rust/issues/850 is fixed
                 check_roundtrip_convergence(s, 7u);
@@ -545,8 +545,8 @@ fn check_convergence(files: ~[~str]) {
 fn check_variants(files: ~[~str], cx: context) {
     for files.each |file| {
         if cx.mode == tm_converge && file_might_not_converge(file) {
-            error!{"Skipping convergence test based on\
-                    file_might_not_converge"};
+            error!("Skipping convergence test based on\
+                    file_might_not_converge");
             again;
         }
 
@@ -568,7 +568,7 @@ fn check_variants(files: ~[~str], cx: context) {
                 file,
                 s, ~[], sess);
         io::with_str_reader(*s, |rdr| {
-            error!{"%s",
+            error!("%s",
                    as_str(|a| pprust::print_crate(
                        sess.cm,
                        // Assuming no token_trees
@@ -578,7 +578,7 @@ fn check_variants(files: ~[~str], cx: context) {
                        file,
                        rdr, a,
                        pprust::no_ann(),
-                       false) )}
+                       false) ))
         });
         check_variants_of_ast(*crate, sess.cm, file, cx);
     }
@@ -586,21 +586,21 @@ fn check_variants(files: ~[~str], cx: context) {
 
 fn main(args: ~[~str]) {
     if vec::len(args) != 2u {
-        error!{"usage: %s <testdir>", args[0]};
+        error!("usage: %s <testdir>", args[0]);
         return;
     }
     let mut files = ~[];
     let root = args[1];
 
     find_rust_files(files, root);
-    error!{"== check_convergence =="};
+    error!("== check_convergence ==");
     check_convergence(files);
-    error!{"== check_variants: converge =="};
+    error!("== check_variants: converge ==");
     check_variants(files, { mode: tm_converge });
-    error!{"== check_variants: run =="};
+    error!("== check_variants: run ==");
     check_variants(files, { mode: tm_run });
 
-    error!{"Fuzzer done"};
+    error!("Fuzzer done");
 }
 
 // Local Variables:
index 0475ff420ce0536a23e6a3eb8b0aefd6d4eeeaf1..a381a64a63a342d995ea15c300657774795d3f17 100644 (file)
@@ -21,7 +21,7 @@
 
 Example:
 
-debug!{"hello, %s!", "world"};
+debug!("hello, %s!", "world");
 
 */
 
@@ -446,7 +446,7 @@ mod test {
     #[test]
     fn fmt_slice() {
         let s = "abc";
-        let _s = fmt!{"%s", s};
+        let _s = fmt!("%s", s);
     }
 }
 
index fb3d832aef53ce43cf0eaa52ecf6bdbee00773ca..d7773d9349700c2896cb248c3ee8002c98df96ef 100644 (file)
@@ -11,7 +11,7 @@
  * ~~~
  * let delayed_fib = future::spawn {|| fib(5000) };
  * make_a_sandwich();
- * io::println(fmt!{"fib(5000) = %?", delayed_fib.get()})
+ * io::println(fmt!("fib(5000) = %?", delayed_fib.get()))
  * ~~~
  */
 
@@ -64,9 +64,9 @@ fn from_value<A>(+val: A) -> Future<A> {
     })
 }
 
-macro_rules! move_it {
+macro_rules! move_it (
     {$x:expr} => { unsafe { let y <- *ptr::addr_of($x); y } }
-}
+)
 
 fn from_port<A:send>(+port: future_pipe::client::waiting<A>) -> Future<A> {
     #[doc = "
@@ -82,7 +82,7 @@ fn from_port<A:send>(+port: future_pipe::client::waiting<A>) -> Future<A> {
         port_ <-> *port;
         let port = option::unwrap(port_);
         match recv(port) {
-          future_pipe::completed(data) => move_it!{data}
+          future_pipe::completed(data) => move_it!(data)
         }
     }
 }
index 2237dad299fedef8d3d429ec80b91a20a6e03529..7130de88c12b0b5025b30dbe95a61d4e2be672ec 100644 (file)
@@ -174,11 +174,11 @@ fn write(msg: &[const u8]) {
                 t += 1;
             }
 
-            let m = u8to64_le!{self.tail, 0};
+            let m = u8to64_le!(self.tail, 0);
 
             self.v3 ^= m;
-            compress!{self.v0, self.v1, self.v2, self.v3};
-            compress!{self.v0, self.v1, self.v2, self.v3};
+            compress!(self.v0, self.v1, self.v2, self.v3);
+            compress!(self.v0, self.v1, self.v2, self.v3);
             self.v0 ^= m;
 
             self.ntail = 0;
@@ -191,11 +191,11 @@ fn write(msg: &[const u8]) {
 
         let mut i = needed;
         while i < end {
-            let mi = u8to64_le!{msg, i};
+            let mi = u8to64_le!(msg, i);
 
             self.v3 ^= mi;
-            compress!{self.v0, self.v1, self.v2, self.v3};
-            compress!{self.v0, self.v1, self.v2, self.v3};
+            compress!(self.v0, self.v1, self.v2, self.v3);
+            compress!(self.v0, self.v1, self.v2, self.v3);
             self.v0 ^= mi;
 
             i += 8;
@@ -246,15 +246,15 @@ fn result_u64() -> u64 {
         if self.ntail > 6 { b |= self.tail[6] as u64 << 48; }
 
         v3 ^= b;
-        compress!{v0, v1, v2, v3};
-        compress!{v0, v1, v2, v3};
+        compress!(v0, v1, v2, v3);
+        compress!(v0, v1, v2, v3);
         v0 ^= b;
 
         v2 ^= 0xff;
-        compress!{v0, v1, v2, v3};
-        compress!{v0, v1, v2, v3};
-        compress!{v0, v1, v2, v3};
-        compress!{v0, v1, v2, v3};
+        compress!(v0, v1, v2, v3);
+        compress!(v0, v1, v2, v3);
+        compress!(v0, v1, v2, v3);
+        compress!(v0, v1, v2, v3);
 
         return (v0 ^ v1 ^ v2 ^ v3);
     }
@@ -373,10 +373,10 @@ fn to_hex_str(r:  &[u8]/8) -> ~str {
     }
 
     while t < 64 {
-        debug!{"siphash test %?", t};
-        let vec = u8to64_le!{vecs[t], 0};
+        debug!("siphash test %?", t);
+        let vec = u8to64_le!(vecs[t], 0);
         let out = hash_bytes_keyed(buf, k0, k1);
-        debug!{"got %?, expected %?", out, vec};
+        debug!("got %?, expected %?", out, vec);
         assert vec == out;
 
         stream_full.reset();
@@ -384,7 +384,7 @@ fn to_hex_str(r:  &[u8]/8) -> ~str {
         let f = stream_full.result_str();
         let i = stream_inc.result_str();
         let v = to_hex_str(&vecs[t]);
-        debug!{"%d: (%s) => inc=%s full=%s", t, v, i, f};
+        debug!("%d: (%s) => inc=%s full=%s", t, v, i, f);
 
         assert f == i && f == v;
 
index cce13589bd5a7ac4c6f409177b1fe41912ad3960..5634d5cfac5bb822968060bd0187103cc5f89641 100644 (file)
@@ -97,8 +97,8 @@ impl T: iter::Times {
         `for int::range(0, x) |_i| { /* anything */ }`."]
     pure fn times(it: fn() -> bool) {
         if self < 0 {
-            fail fmt!{"The .times method expects a nonnegative number, \
-                       but found %?", self};
+            fail fmt!("The .times method expects a nonnegative number, \
+                       but found %?", self);
         }
         let mut i = self;
         while i > 0 {
@@ -114,8 +114,8 @@ impl T: iter::TimesIx {
     pure fn timesi(it: fn(uint) -> bool) {
         let slf = self as uint;
         if slf < 0u {
-            fail fmt!{"The .timesi method expects a nonnegative number, \
-                       but found %?", self};
+            fail fmt!("The .timesi method expects a nonnegative number, \
+                       but found %?", self);
         }
         let mut i = 0u;
         while i < slf {
index 1c7bb5620308190ecda72bf46c07314b6fd70ac9..046d155a27a5d22e0f8757e25f35bc9ee694b67a 100644 (file)
@@ -292,7 +292,7 @@ fn read_byte() -> int {
         return b as int;
     }
     // FIXME (#2738): implement this
-    fn unread_byte(_byte: int) { error!{"Unimplemented: unread_byte"}; fail; }
+    fn unread_byte(_byte: int) { error!("Unimplemented: unread_byte"); fail; }
     fn eof() -> bool { self.pos == self.len }
     fn seek(offset: int, whence: SeekStyle) {
         let pos = self.pos;
@@ -358,7 +358,7 @@ fn write(v: &[const u8]) {
             let nout = libc::fwrite(vbuf as *c_void, len as size_t,
                                     1u as size_t, self);
             if nout < 1 as size_t {
-                error!{"error writing buffer"};
+                error!("error writing buffer");
                 log(error, os::last_os_error());
                 fail;
             }
@@ -393,7 +393,7 @@ fn write(v: &[const u8]) {
                 let vb = ptr::const_offset(vbuf, count) as *c_void;
                 let nout = libc::write(self, vb, len as size_t);
                 if nout < 0 as ssize_t {
-                    error!{"error writing buffer"};
+                    error!("error writing buffer");
                     log(error, os::last_os_error());
                     fail;
                 }
@@ -402,11 +402,11 @@ fn write(v: &[const u8]) {
         }
     }
     fn seek(_offset: int, _whence: SeekStyle) {
-        error!{"need 64-bit foreign calls for seek, sorry"};
+        error!("need 64-bit foreign calls for seek, sorry");
         fail;
     }
     fn tell() -> uint {
-        error!{"need 64-bit foreign calls for tell, sorry"};
+        error!("need 64-bit foreign calls for tell, sorry");
         fail;
     }
     fn flush() -> int { 0 }
@@ -453,7 +453,7 @@ fn wb() -> c_int { O_WRONLY as c_int }
                    (S_IRUSR | S_IWUSR) as c_int)
     };
     if fd < (0 as c_int) {
-        result::err(fmt!{"error opening %s: %s", path, os::last_os_error()})
+        result::err(fmt!("error opening %s: %s", path, os::last_os_error()))
     } else {
         result::ok(fd_writer(fd, true))
     }
index b5b56756e11e9be683453c94016787c96718c918..39adaa313edf2e076054a7786ca2f27f996d62c2 100644 (file)
@@ -176,7 +176,7 @@ trait CopyableIter<A:copy> {
 #[test]
 fn test_enumerate() {
     enumerate(["0", "1", "2"]) {|i,j|
-        assert fmt!{"%u",i} == j;
+        assert fmt!("%u",i) == j;
     }
 }
 
@@ -254,7 +254,7 @@ fn repeat(&&i: int) -> ~[int] {
     let a = bind vec::iter(~[0, 1, 2, 3], _);
     let b = bind flat_map(a, repeat, _);
     let c = to_vec(b);
-    debug!{"c = %?", c};
+    debug!("c = %?", c);
     assert c == ~[1, 2, 2, 3, 3, 3];
 }
 
@@ -265,7 +265,7 @@ fn test_repeat() {
         c += ~[(i * i)];
         i += 1u;
     };
-    debug!{"c = %?", c};
+    debug!("c = %?", c);
     assert c == ~[0u, 1u, 4u, 9u, 16u];
 }
 
index f828da8409000e14586a86a9bc32dd270d80ca6d..30bcd8043308af93ed0955e8e380a9f2f96382e6 100644 (file)
@@ -1036,7 +1036,7 @@ fn copy_file_ok() {
       assert (libc::fclose(ostream) == (0u as c_int));
       let rs = os::copy_file(in, out);
       if (!os::path_exists(in)) {
-        fail (fmt!{"%s doesn't exist", in});
+        fail (fmt!("%s doesn't exist", in));
       }
       assert(rs);
       let rslt = run::run_program(~"diff", ~[in, out]);
index 2a7dbd61f9c1d48a624ee1c1adc70084fc871485..048bd64f8f620a0e8a565771c7c03f06525de901 100644 (file)
 #[doc(hidden)]
 const SPIN_COUNT: uint = 0;
 
-macro_rules! move_it {
+macro_rules! move_it (
     { $x:expr } => { unsafe { let y <- *ptr::addr_of($x); y } }
-}
+)
 
 #[doc(hidden)]
 enum state {
@@ -335,15 +335,15 @@ struct buffer_resource<T: send> {
     let buffer: ~buffer<T>;
     new(+b: ~buffer<T>) {
         //let p = ptr::addr_of(*b);
-        //error!{"take %?", p};
+        //error!("take %?", p);
         atomic_add_acq(&mut b.header.ref_count, 1);
         self.buffer = b;
     }
 
     drop unsafe {
-        let b = move_it!{self.buffer};
+        let b = move_it!(self.buffer);
         //let p = ptr::addr_of(*b);
-        //error!{"drop %?", p};
+        //error!("drop %?", p);
         let old_count = atomic_sub_rel(&mut b.header.ref_count, 1);
         //let old_count = atomic_xchng_rel(b.header.ref_count, 0);
         if old_count == 1 {
@@ -377,7 +377,7 @@ fn send<T: send, Tbuffer: send>(+p: send_packet_buffered<T, Tbuffer>,
         }
         full => fail ~"duplicate send",
         blocked => {
-            debug!{"waking up task for %?", p_};
+            debug!("waking up task for %?", p_);
             let old_task = swap_task(&mut p.header.blocked_task, ptr::null());
             if !old_task.is_null() {
                 rustrt::task_signal_event(
@@ -461,7 +461,7 @@ struct drop_state {
                                        blocked);
         match old_state {
           empty => {
-            debug!{"no data available on %?, going to sleep.", p_};
+            debug!("no data available on %?, going to sleep.", p_);
             if count == 0 {
                 wait_event(this);
             }
@@ -474,7 +474,7 @@ struct drop_state {
                 // sometimes blocking the thing we are waiting on.
                 task::yield();
             }
-            debug!{"woke up, p.state = %?", copy p.header.state};
+            debug!("woke up, p.state = %?", copy p.header.state);
           }
           blocked => if first {
             fail ~"blocking on already blocked packet"
@@ -603,7 +603,7 @@ fn wait_many<T: selectable>(pkts: &[T]) -> uint {
     }
 
     while !data_avail {
-        debug!{"sleeping on %? packets", pkts.len()};
+        debug!("sleeping on %? packets", pkts.len());
         let event = wait_event(this) as *packet_header;
         let pos = vec::position(pkts, |p| p.header() == event);
 
@@ -612,11 +612,11 @@ fn wait_many<T: selectable>(pkts: &[T]) -> uint {
             ready_packet = i;
             data_avail = true;
           }
-          none => debug!{"ignoring spurious event, %?", event}
+          none => debug!("ignoring spurious event, %?", event)
         }
     }
 
-    debug!{"%?", pkts[ready_packet]};
+    debug!("%?", pkts[ready_packet]);
 
     for pkts.each |p| { unsafe{ (*p.header()).unblock()} }
 
@@ -725,7 +725,7 @@ struct send_packet_buffered<T: send, Tbuffer: send> {
     let mut p: option<*packet<T>>;
     let mut buffer: option<buffer_resource<Tbuffer>>;
     new(p: *packet<T>) {
-        //debug!{"take send %?", p};
+        //debug!("take send %?", p);
         self.p = some(p);
         unsafe {
             self.buffer = some(
@@ -735,17 +735,17 @@ struct send_packet_buffered<T: send, Tbuffer: send> {
     }
     drop {
         //if self.p != none {
-        //    debug!{"drop send %?", option::get(self.p)};
+        //    debug!("drop send %?", option::get(self.p));
         //}
         if self.p != none {
             let mut p = none;
             p <-> self.p;
             sender_terminate(option::unwrap(p))
         }
-        //unsafe { error!{"send_drop: %?",
+        //unsafe { error!("send_drop: %?",
         //                if self.buffer == none {
         //                    "none"
-        //                } else { "some" }}; }
+        //                } else { "some" }); }
     }
     fn unwrap() -> *packet<T> {
         let mut p = none;
@@ -766,7 +766,7 @@ fn unwrap() -> *packet<T> {
     }
 
     fn reuse_buffer() -> buffer_resource<Tbuffer> {
-        //error!{"send reuse_buffer"};
+        //error!("send reuse_buffer");
         let mut tmp = none;
         tmp <-> self.buffer;
         option::unwrap(tmp)
@@ -786,7 +786,7 @@ struct recv_packet_buffered<T: send, Tbuffer: send> : selectable {
     let mut p: option<*packet<T>>;
     let mut buffer: option<buffer_resource<Tbuffer>>;
     new(p: *packet<T>) {
-        //debug!{"take recv %?", p};
+        //debug!("take recv %?", p);
         self.p = some(p);
         unsafe {
             self.buffer = some(
@@ -796,17 +796,17 @@ struct recv_packet_buffered<T: send, Tbuffer: send> : selectable {
     }
     drop {
         //if self.p != none {
-        //    debug!{"drop recv %?", option::get(self.p)};
+        //    debug!("drop recv %?", option::get(self.p));
         //}
         if self.p != none {
             let mut p = none;
             p <-> self.p;
             receiver_terminate(option::unwrap(p))
         }
-        //unsafe { error!{"recv_drop: %?",
+        //unsafe { error!("recv_drop: %?",
         //                if self.buffer == none {
         //                    "none"
-        //                } else { "some" }}; }
+        //                } else { "some" }); }
     }
     fn unwrap() -> *packet<T> {
         let mut p = none;
@@ -827,7 +827,7 @@ fn unwrap() -> *packet<T> {
     }
 
     fn reuse_buffer() -> buffer_resource<Tbuffer> {
-        //error!{"recv reuse_buffer"};
+        //error!("recv reuse_buffer");
         let mut tmp = none;
         tmp <-> self.buffer;
         option::unwrap(tmp)
@@ -991,8 +991,8 @@ fn try_recv() -> option<T> {
         endp <-> self.endp;
         match move pipes::try_recv(unwrap(endp)) {
           some(streamp::data(x, endp)) => {
-            self.endp = some(move_it!{endp});
-            some(move_it!{x})
+            self.endp = some(move_it!(endp));
+            some(move_it!(x))
           }
           none => none
         }
index c02b094ad36a112ebc8e33424855311709078ca9..c341d01fba89ae0a79547920eae6a4ce2d48e1f3 100644 (file)
@@ -69,7 +69,7 @@ enum Msg {
         log(debug,~"BEFORE COMPARE AND SWAP");
         let swapped = compare_and_swap(
             global, 0u, unsafe::reinterpret_cast(ch));
-        log(debug,fmt!{"AFTER .. swapped? %?", swapped});
+        log(debug,fmt!("AFTER .. swapped? %?", swapped));
 
         if swapped {
             // Success!
index cf2a3712b069c1ab5180ad76c85cf140011c972c..41e2cfd99dde676632d2181c8938bd0854426e59 100644 (file)
@@ -328,7 +328,7 @@ fn rng_seeded_custom_seed2() {
         let ra = rand::seeded_rng(seed);
         // Regression test that isaac is actually using the above vector
         let r = ra.next();
-        error!{"%?", r};
+        error!("%?", r);
         assert r == 890007737u32 // on x86_64
             || r == 2935188040u32; // on x86
     }
index 341d28e67e81ac90d2aea44f6bc29503d1bf79ab..9b8482c5b5c234510b3dcc1e1bed3c728202c73a 100644 (file)
@@ -21,7 +21,7 @@ enum result<T, U> {
     match res {
       ok(t) => t,
       err(the_err) => unchecked {
-        fail fmt!{"get called on error result: %?", the_err}
+        fail fmt!("get called on error result: %?", the_err)
       }
     }
 }
index 3ccdc87997d267da49b24723b4f02836d7bff689..977119c0a56207051677acc4acc61bf82c761fa0 100644 (file)
@@ -106,7 +106,7 @@ fn with_envp<T>(env: &option<~[(~str,~str)]>,
 
         for vec::each(es) |e| {
             let (k,v) = e;
-            let t = @(fmt!{"%s=%s", k, v});
+            let t = @(fmt!("%s=%s", k, v));
             vec::push(tmps, t);
             vec::push_all(ptrs, str::as_c_str(*t, |b| ~[b]));
         }
@@ -131,7 +131,7 @@ fn with_envp<T>(env: &option<~[(~str,~str)]>,
             let mut blk : ~[u8] = ~[];
             for vec::each(es) |e| {
                 let (k,v) = e;
-                let t = fmt!{"%s=%s", k, v};
+                let t = fmt!("%s=%s", k, v);
                 let mut v : ~[u8] = ::unsafe::reinterpret_cast(t);
                 blk += v;
                 ::unsafe::forget(v);
@@ -332,7 +332,7 @@ fn program_output(prog: &str, args: &[~str]) ->
 fn writeclose(fd: c_int, s: &str) {
     import io::WriterUtil;
 
-    error!{"writeclose %d, %s", fd as int, s};
+    error!("writeclose %d, %s", fd as int, s);
     let writer = io::fd_writer(fd, false);
     writer.write_str(s);
 
index 05cd9f3f8220277f150de1eee15f83fed7aa1a77..9792b7c805bd48c012c050cf82c9d697dd7aaf46 100644 (file)
@@ -76,7 +76,7 @@ fn linear_map_with_capacity<K,V>(
                             len_buckets: uint) -> uint {
             let n = (idx + 1) % len_buckets;
             unsafe{ // argh. log not considered pure.
-                debug!{"next_bucket(%?, %?) = %?", idx, len_buckets, n};
+                debug!("next_bucket(%?, %?) = %?", idx, len_buckets, n);
             }
             return n;
         }
@@ -154,15 +154,15 @@ fn insert_internal(&mut self, hash: uint, +k: K, +v: V) -> bool {
             match self.bucket_for_key_with_hash(self.buckets, hash, &k) {
               TableFull => {fail ~"Internal logic error";}
               FoundHole(idx) => {
-                debug!{"insert fresh (%?->%?) at idx %?, hash %?",
-                       k, v, idx, hash};
+                debug!("insert fresh (%?->%?) at idx %?, hash %?",
+                       k, v, idx, hash);
                 self.buckets[idx] = some({hash: hash, key: k, value: v});
                 self.size += 1;
                 return true;
               }
               FoundEntry(idx) => {
-                debug!{"insert overwrite (%?->%?) at idx %?, hash %?",
-                       k, v, idx, hash};
+                debug!("insert overwrite (%?->%?) at idx %?, hash %?",
+                       k, v, idx, hash);
                 self.buckets[idx] = some({hash: hash, key: k, value: v});
                 return false;
               }
@@ -308,7 +308,7 @@ fn find(&const self, k: &K) -> option<V> {
         fn get(&const self, k: &K) -> V {
             let value = self.find(k);
             if value.is_none() {
-                fail fmt!{"No entry found for key: %?", k};
+                fail fmt!("No entry found for key: %?", k);
             }
             option::unwrap(value)
         }
index 959ee4cf5a8a436888402e2f151533966d1bc662..3dad707a92bf43d7604735ccc5747ece3a0b05ef 100644 (file)
@@ -16,7 +16,7 @@ struct Frame {
 
 fn walk_stack(visit: fn(Frame) -> bool) {
 
-    debug!{"beginning stack walk"};
+    debug!("beginning stack walk");
 
     do frame_address |frame_pointer| {
         let mut frame_address: *Word = unsafe {
@@ -25,14 +25,14 @@ fn walk_stack(visit: fn(Frame) -> bool) {
         loop {
             let fr = Frame(frame_address);
 
-            debug!{"frame: %x", unsafe { reinterpret_cast(fr.fp) }};
+            debug!("frame: %x", unsafe { reinterpret_cast(fr.fp) });
             visit(fr);
 
             unsafe {
                 let next_fp: **Word = reinterpret_cast(frame_address);
                 frame_address = *next_fp;
                 if *frame_address == 0u {
-                    debug!{"encountered task_start_wrapper. ending walk"};
+                    debug!("encountered task_start_wrapper. ending walk");
                     // This is the task_start_wrapper_frame. There is
                     // no stack beneath it and it is a foreign frame.
                     break;
index 4d2c98077dd18507391685d32581f71874fd7060..e3d976cb0a2d011e315282b901fdcc1c713f9a06 100644 (file)
@@ -1464,7 +1464,7 @@ fn is_alphanumeric(s: &str) -> bool {
  * let i = 0u;
  * while i < str::len(s) {
  *     let {ch, next} = str::char_range_at(s, i);
- *     std::io::println(fmt!{"%u: %c",i,ch});
+ *     std::io::println(fmt!("%u: %c",i,ch));
  *     i = next;
  * }
  * ~~~
@@ -2138,7 +2138,7 @@ fn test_split_char() {
         fn t(s: ~str, c: char, u: ~[~str]) {
             log(debug, ~"split_byte: " + s);
             let v = split_char(s, c);
-            debug!{"split_byte to: %?", v};
+            debug!("split_byte to: %?", v);
             assert vec::all2(v, u, |a,b| a == b);
         }
         t(~"abc.hello.there", '.', ~[~"abc", ~"hello", ~"there"]);
@@ -2167,8 +2167,8 @@ fn test_splitn_char() {
         fn t(s: ~str, c: char, n: uint, u: ~[~str]) {
             log(debug, ~"splitn_byte: " + s);
             let v = splitn_char(s, c, n);
-            debug!{"split_byte to: %?", v};
-            debug!{"comparing vs. %?", u};
+            debug!("split_byte to: %?", v);
+            debug!("comparing vs. %?", u);
             assert vec::all2(v, u, |a,b| a == b);
         }
         t(~"abc.hello.there", '.', 0u, ~[~"abc.hello.there"]);
index 8d6453f0059701804af93764edefd780d94ae56f..4752b2d3a565de5387d1aa1953c2d05d1dd94051 100644 (file)
@@ -1031,10 +1031,10 @@ fn kill_taskgroup(state: TaskGroupInner, me: *rust_task, is_main: bool) {
 
 // FIXME (#2912): Work around core-vs-coretest function duplication. Can't use
 // a proper closure because the #[test]s won't understand. Have to fake it.
-macro_rules! taskgroup_key {
+macro_rules! taskgroup_key (
     // Use a "code pointer" value that will never be a real code pointer.
     {} => (unsafe::transmute((-2 as uint, 0u)))
-}
+)
 
 fn gen_child_taskgroup(linked: bool, supervised: bool)
         -> (TaskGroupArc, AncestorList, bool) {
index 7b8c0e9fcad43d2aa25fb91fb4816d203e77ea9e..2e280747d20dc25935cc1314d1cebd4ca91152a3 100644 (file)
@@ -274,37 +274,37 @@ fn taggypareq<T>(a: taggypar<T>, b: taggypar<T>) -> bool {
         fn reccyeq(a: reccy, b: reccy) -> bool {
             return a.x == b.x && a.y == b.y && taggyeq(a.t, b.t);
         }
-        debug!{"*** test boxes"};
+        debug!("*** test boxes");
         test_boxes(@5, @72, @64, @175);
-        debug!{"*** end test boxes"};
-        debug!{"test parameterized: int"};
+        debug!("*** end test boxes");
+        debug!("test parameterized: int");
         let eq1: eqfn<int> = inteq;
         test_parameterized::<int>(eq1, 5, 72, 64, 175);
-        debug!{"*** test parameterized: @int"};
+        debug!("*** test parameterized: @int");
         let eq2: eqfn<@int> = intboxeq;
         test_parameterized::<@int>(eq2, @5, @72, @64, @175);
-        debug!{"*** end test parameterized @int"};
-        debug!{"test parameterized: taggy"};
+        debug!("*** end test parameterized @int");
+        debug!("test parameterized: taggy");
         let eq3: eqfn<taggy> = taggyeq;
         test_parameterized::<taggy>(eq3, one(1), two(1, 2), three(1, 2, 3),
                                     two(17, 42));
 
-        debug!{"*** test parameterized: taggypar<int>"};
+        debug!("*** test parameterized: taggypar<int>");
         let eq4: eqfn<taggypar<int>> = |x,y| taggypareq::<int>(x, y);
         test_parameterized::<taggypar<int>>(eq4, onepar::<int>(1),
                                             twopar::<int>(1, 2),
                                             threepar::<int>(1, 2, 3),
                                             twopar::<int>(17, 42));
-        debug!{"*** end test parameterized: taggypar::<int>"};
+        debug!("*** end test parameterized: taggypar::<int>");
 
-        debug!{"*** test parameterized: reccy"};
+        debug!("*** test parameterized: reccy");
         let reccy1: reccy = {x: 1, y: 2, t: one(1)};
         let reccy2: reccy = {x: 345, y: 2, t: two(1, 2)};
         let reccy3: reccy = {x: 1, y: 777, t: three(1, 2, 3)};
         let reccy4: reccy = {x: 19, y: 252, t: two(17, 42)};
         let eq5: eqfn<reccy> = reccyeq;
         test_parameterized::<reccy>(eq5, reccy1, reccy2, reccy3, reccy4);
-        debug!{"*** end test parameterized: reccy"};
-        debug!{"*** done"};
+        debug!("*** end test parameterized: reccy");
+        debug!("*** done");
     }
 }
index 260a746bf8538699080fb1663ea030cfd28d741d..758dcf4eebf810a6cc0035e95ed28c474ba7ab44 100644 (file)
@@ -70,7 +70,7 @@ fn vuint_at(data: &[u8], start: uint) -> {val: uint, next: uint} {
                  (data[start + 2u] as uint) << 8u |
                  (data[start + 3u] as uint),
              next: start + 4u};
-    } else { error!{"vint too big"}; fail; }
+    } else { error!("vint too big"); fail; }
 }
 
 fn doc(data: @~[u8]) -> doc {
@@ -106,7 +106,7 @@ fn get_doc(d: doc, tg: uint) -> doc {
     match maybe_get_doc(d, tg) {
       some(d) => return d,
       none => {
-        error!{"failed to find block with tag %u", tg};
+        error!("failed to find block with tag %u", tg);
         fail;
       }
     }
@@ -186,7 +186,7 @@ fn write_sized_vuint(w: io::Writer, n: uint, size: uint) {
                       n as u8]),
       4u => w.write(&[0x10u8 | ((n >> 24_u) as u8), (n >> 16_u) as u8,
                       (n >> 8_u) as u8, n as u8]),
-      _ => fail fmt!{"vint to write too big: %?", n}
+      _ => fail fmt!("vint to write too big: %?", n)
     };
 }
 
@@ -195,7 +195,7 @@ fn write_vuint(w: io::Writer, n: uint) {
     if n < 0x4000_u { write_sized_vuint(w, n, 2u); return; }
     if n < 0x200000_u { write_sized_vuint(w, n, 3u); return; }
     if n < 0x10000000_u { write_sized_vuint(w, n, 4u); return; }
-    fail fmt!{"vint to write too big: %?", n};
+    fail fmt!("vint to write too big: %?", n);
 }
 
 fn writer(w: io::Writer) -> writer {
@@ -206,7 +206,7 @@ fn writer(w: io::Writer) -> writer {
 // FIXME (#2741): Provide a function to write the standard ebml header.
 impl writer {
     fn start_tag(tag_id: uint) {
-        debug!{"Start tag %u", tag_id};
+        debug!("Start tag %u", tag_id);
 
         // Write the enum ID:
         write_vuint(self.writer, tag_id);
@@ -225,7 +225,7 @@ fn end_tag() {
         write_sized_vuint(self.writer, size, 4u);
         self.writer.seek(cur_pos as int, io::SeekSet);
 
-        debug!{"End tag (size = %u)", size};
+        debug!("End tag (size = %u)", size);
     }
 
     fn wr_tag(tag_id: uint, blk: fn()) {
@@ -289,12 +289,12 @@ fn wr_tagged_str(tag_id: uint, v: &str) {
     }
 
     fn wr_bytes(b: &[u8]) {
-        debug!{"Write %u bytes", vec::len(b)};
+        debug!("Write %u bytes", vec::len(b));
         self.writer.write(b);
     }
 
     fn wr_str(s: ~str) {
-        debug!{"Write str: %?", s};
+        debug!("Write str: %?", s);
         self.writer.write(str::bytes(s));
     }
 }
@@ -417,29 +417,29 @@ fn _check_label(lbl: ~str) {
                 self.pos = r_doc.end;
                 let str = ebml::doc_as_str(r_doc);
                 if lbl != str {
-                    fail fmt!{"Expected label %s but found %s", lbl, str};
+                    fail fmt!("Expected label %s but found %s", lbl, str);
                 }
             }
         }
     }
 
     fn next_doc(exp_tag: ebml_serializer_tag) -> ebml::doc {
-        debug!{". next_doc(exp_tag=%?)", exp_tag};
+        debug!(". next_doc(exp_tag=%?)", exp_tag);
         if self.pos >= self.parent.end {
             fail ~"no more documents in current node!";
         }
         let {tag: r_tag, doc: r_doc} =
             ebml::doc_at(self.parent.data, self.pos);
-        debug!{"self.parent=%?-%? self.pos=%? r_tag=%? r_doc=%?-%?",
+        debug!("self.parent=%?-%? self.pos=%? r_tag=%? r_doc=%?-%?",
                copy self.parent.start, copy self.parent.end,
-               copy self.pos, r_tag, r_doc.start, r_doc.end};
+               copy self.pos, r_tag, r_doc.start, r_doc.end);
         if r_tag != (exp_tag as uint) {
-            fail fmt!{"expected EMBL doc with tag %? but found tag %?",
-                      exp_tag, r_tag};
+            fail fmt!("expected EMBL doc with tag %? but found tag %?",
+                      exp_tag, r_tag);
         }
         if r_doc.end > self.parent.end {
-            fail fmt!{"invalid EBML, child extends to 0x%x, parent to 0x%x",
-                      r_doc.end, self.parent.end};
+            fail fmt!("invalid EBML, child extends to 0x%x, parent to 0x%x",
+                      r_doc.end, self.parent.end);
         }
         self.pos = r_doc.end;
         return r_doc;
@@ -458,7 +458,7 @@ fn push_doc<T>(d: ebml::doc, f: fn() -> T) -> T{
 
     fn _next_uint(exp_tag: ebml_serializer_tag) -> uint {
         let r = ebml::doc_as_u32(self.next_doc(exp_tag));
-        debug!{"_next_uint exp_tag=%? result=%?", exp_tag, r};
+        debug!("_next_uint exp_tag=%? result=%?", exp_tag, r);
         return r as uint;
     }
 }
@@ -473,7 +473,7 @@ fn read_u8 () -> u8  { ebml::doc_as_u8 (self.next_doc(es_u8 )) }
     fn read_uint() -> uint {
         let v = ebml::doc_as_u64(self.next_doc(es_uint));
         if v > (core::uint::max_value as u64) {
-            fail fmt!{"uint %? too large for this architecture", v};
+            fail fmt!("uint %? too large for this architecture", v);
         }
         return v as uint;
     }
@@ -485,7 +485,7 @@ fn read_i8 () -> i8  { ebml::doc_as_u8 (self.next_doc(es_i8 )) as i8  }
     fn read_int() -> int {
         let v = ebml::doc_as_u64(self.next_doc(es_int)) as i64;
         if v > (int::max_value as i64) || v < (int::min_value as i64) {
-            fail fmt!{"int %? out of range for this architecture", v};
+            fail fmt!("int %? out of range for this architecture", v);
         }
         return v as int;
     }
@@ -500,67 +500,67 @@ fn read_str() -> ~str { ebml::doc_as_str(self.next_doc(es_str)) }
 
     // Compound types:
     fn read_enum<T>(name: ~str, f: fn() -> T) -> T {
-        debug!{"read_enum(%s)", name};
+        debug!("read_enum(%s)", name);
         self._check_label(name);
         self.push_doc(self.next_doc(es_enum), f)
     }
 
     fn read_enum_variant<T>(f: fn(uint) -> T) -> T {
-        debug!{"read_enum_variant()"};
+        debug!("read_enum_variant()");
         let idx = self._next_uint(es_enum_vid);
-        debug!{"  idx=%u", idx};
+        debug!("  idx=%u", idx);
         do self.push_doc(self.next_doc(es_enum_body)) {
             f(idx)
         }
     }
 
     fn read_enum_variant_arg<T>(idx: uint, f: fn() -> T) -> T {
-        debug!{"read_enum_variant_arg(idx=%u)", idx};
+        debug!("read_enum_variant_arg(idx=%u)", idx);
         f()
     }
 
     fn read_vec<T>(f: fn(uint) -> T) -> T {
-        debug!{"read_vec()"};
+        debug!("read_vec()");
         do self.push_doc(self.next_doc(es_vec)) {
             let len = self._next_uint(es_vec_len);
-            debug!{"  len=%u", len};
+            debug!("  len=%u", len);
             f(len)
         }
     }
 
     fn read_vec_elt<T>(idx: uint, f: fn() -> T) -> T {
-        debug!{"read_vec_elt(idx=%u)", idx};
+        debug!("read_vec_elt(idx=%u)", idx);
         self.push_doc(self.next_doc(es_vec_elt), f)
     }
 
     fn read_box<T>(f: fn() -> T) -> T {
-        debug!{"read_box()"};
+        debug!("read_box()");
         f()
     }
 
     fn read_uniq<T>(f: fn() -> T) -> T {
-        debug!{"read_uniq()"};
+        debug!("read_uniq()");
         f()
     }
 
     fn read_rec<T>(f: fn() -> T) -> T {
-        debug!{"read_rec()"};
+        debug!("read_rec()");
         f()
     }
 
     fn read_rec_field<T>(f_name: ~str, f_idx: uint, f: fn() -> T) -> T {
-        debug!{"read_rec_field(%s, idx=%u)", f_name, f_idx};
+        debug!("read_rec_field(%s, idx=%u)", f_name, f_idx);
         self._check_label(f_name);
         f()
     }
 
     fn read_tup<T>(sz: uint, f: fn() -> T) -> T {
-        debug!{"read_tup(sz=%u)", sz};
+        debug!("read_tup(sz=%u)", sz);
         f()
     }
 
     fn read_tup_elt<T>(idx: uint, f: fn() -> T) -> T {
-        debug!{"read_tup_elt(idx=%u)", idx};
+        debug!("read_tup_elt(idx=%u)", idx);
         f()
     }
 }
@@ -613,14 +613,14 @@ fn deserialize_0<S: serialization::deserializer>(s: S) -> option<int> {
     }
 
     fn test_v(v: option<int>) {
-        debug!{"v == %?", v};
+        debug!("v == %?", v);
         let mbuf = io::mem_buffer();
         let ebml_w = ebml::writer(io::mem_buffer_writer(mbuf));
         serialize_0(ebml_w, v);
         let ebml_doc = ebml::doc(@io::mem_buffer_buf(mbuf));
         let deser = ebml_deserializer(ebml_doc);
         let v1 = deserialize_0(deser);
-        debug!{"v1 == %?", v1};
+        debug!("v1 == %?", v1);
         assert v == v1;
     }
 
index 1c92fd4ce0d68c25ccc9a1a8e4b57b86ff68dc49..f14d2e32263d838cb4f950878e7a9cba09561608 100644 (file)
@@ -314,7 +314,7 @@ fn opt_vals(m: matches, nm: ~str) -> ~[optval] {
     return match find_opt(m.opts, mkname(nm)) {
       some(id) => m.vals[id],
       none => {
-        error!{"No option '%s' defined", nm};
+        error!("No option '%s' defined", nm);
         fail
       }
     };
index 715062a06c9eb15f393c85e865d34569e168371f..5523de29aebce761bcc083edaf7cbf57ec23876b 100644 (file)
@@ -628,7 +628,7 @@ fn to_str() -> ~str { to_str(self) }
 
 impl error: to_str::ToStr {
     fn to_str() -> ~str {
-        fmt!{"%u:%u: %s", self.line, self.col, *self.msg}
+        fmt!("%u:%u: %s", self.line, self.col, *self.msg)
     }
 }
 
index 3056b6b938a59ab48addb21ae07f5ae28e1f61d3..7ed64c947a2ae4b3d05e4101dfbd6cdad52a9fc4 100644 (file)
@@ -137,16 +137,16 @@ fn search_rem(k: &K, h: uint, idx: uint,
             loop {
                 match copy e0.next {
                   none => {
-                    debug!{"search_tbl: absent, comp %u, hash %u, idx %u",
-                           comp, h, idx};
+                    debug!("search_tbl: absent, comp %u, hash %u, idx %u",
+                           comp, h, idx);
                     return not_found;
                   }
                   some(e1) => {
                     comp += 1u;
                     if e1.hash == h && self.eqer(&e1.key, k) {
-                        debug!{"search_tbl: present, comp %u, \
+                        debug!("search_tbl: present, comp %u, \
                                 hash %u, idx %u",
-                               comp, h, idx};
+                               comp, h, idx);
                         return found_after(e0, e1);
                     } else {
                         e0 = e1;
@@ -160,14 +160,14 @@ fn search_tbl(k: &K, h: uint) -> search_result<K,V> {
             let idx = h % vec::len(self.chains);
             match copy self.chains[idx] {
               none => {
-                debug!{"search_tbl: none, comp %u, hash %u, idx %u",
-                       0u, h, idx};
+                debug!("search_tbl: none, comp %u, hash %u, idx %u",
+                       0u, h, idx);
                 return not_found;
               }
               some(e) => {
                 if e.hash == h && self.eqer(&e.key, k) {
-                    debug!{"search_tbl: present, comp %u, hash %u, idx %u",
-                           1u, h, idx};
+                    debug!("search_tbl: present, comp %u, hash %u, idx %u",
+                           1u, h, idx);
                     return found_first(idx, e);
                 } else {
                     return self.search_rem(k, h, idx, e);
@@ -277,7 +277,7 @@ fn find(+k: K) -> option<V> {
         fn get(+k: K) -> V {
             let opt_v = self.find(k);
             if opt_v.is_none() {
-                fail fmt!{"Key not found in table: %?", k};
+                fail fmt!("Key not found in table: %?", k);
             }
             option::unwrap(opt_v)
         }
@@ -563,14 +563,14 @@ mod tests {
 
     #[test]
     fn test_simple() {
-        debug!{"*** starting test_simple"};
+        debug!("*** starting test_simple");
         pure fn eq_uint(x: &uint, y: &uint) -> bool { *x == *y }
         pure fn uint_id(x: &uint) -> uint { *x }
         let hasher_uint: map::hashfn<uint> = uint_id;
         let eqer_uint: map::eqfn<uint> = eq_uint;
         let hasher_str: map::hashfn<~str> = str::hash;
         let eqer_str: map::eqfn<~str> = str::eq;
-        debug!{"uint -> uint"};
+        debug!("uint -> uint");
         let hm_uu: map::hashmap<uint, uint> =
             map::hashmap::<uint, uint>(copy hasher_uint, copy eqer_uint);
         assert (hm_uu.insert(10u, 12u));
@@ -586,7 +586,7 @@ fn test_simple() {
         let ten: ~str = ~"ten";
         let eleven: ~str = ~"eleven";
         let twelve: ~str = ~"twelve";
-        debug!{"str -> uint"};
+        debug!("str -> uint");
         let hm_su: map::hashmap<~str, uint> =
             map::hashmap::<~str, uint>(copy hasher_str, copy eqer_str);
         assert (hm_su.insert(~"ten", 12u));
@@ -600,7 +600,7 @@ fn test_simple() {
         assert (hm_su.get(~"twelve") == 14u);
         assert (!hm_su.insert(~"twelve", 12u));
         assert (hm_su.get(~"twelve") == 12u);
-        debug!{"uint -> str"};
+        debug!("uint -> str");
         let hm_us: map::hashmap<uint, ~str> =
             map::hashmap::<uint, ~str>(copy hasher_uint, copy eqer_uint);
         assert (hm_us.insert(10u, ~"twelve"));
@@ -613,7 +613,7 @@ fn test_simple() {
         assert hm_us.get(12u) == ~"fourteen";
         assert (!hm_us.insert(12u, ~"twelve"));
         assert hm_us.get(12u) == ~"twelve";
-        debug!{"str -> str"};
+        debug!("str -> str");
         let hm_ss: map::hashmap<~str, ~str> =
             map::hashmap::<~str, ~str>(copy hasher_str, copy eqer_str);
         assert (hm_ss.insert(ten, ~"twelve"));
@@ -626,7 +626,7 @@ fn test_simple() {
         assert hm_ss.get(~"twelve") == ~"fourteen";
         assert (!hm_ss.insert(~"twelve", ~"twelve"));
         assert hm_ss.get(~"twelve") == ~"twelve";
-        debug!{"*** finished test_simple"};
+        debug!("*** finished test_simple");
     }
 
 
@@ -635,11 +635,11 @@ fn test_simple() {
     */
     #[test]
     fn test_growth() {
-        debug!{"*** starting test_growth"};
+        debug!("*** starting test_growth");
         let num_to_insert: uint = 64u;
         pure fn eq_uint(x: &uint, y: &uint) -> bool { *x == *y }
         pure fn uint_id(x: &uint) -> uint { *x }
-        debug!{"uint -> uint"};
+        debug!("uint -> uint");
         let hasher_uint: map::hashfn<uint> = uint_id;
         let eqer_uint: map::eqfn<uint> = eq_uint;
         let hm_uu: map::hashmap<uint, uint> =
@@ -647,26 +647,26 @@ fn test_growth() {
         let mut i: uint = 0u;
         while i < num_to_insert {
             assert (hm_uu.insert(i, i * i));
-            debug!{"inserting %u -> %u", i, i*i};
+            debug!("inserting %u -> %u", i, i*i);
             i += 1u;
         }
-        debug!{"-----"};
+        debug!("-----");
         i = 0u;
         while i < num_to_insert {
-            debug!{"get(%u) = %u", i, hm_uu.get(i)};
+            debug!("get(%u) = %u", i, hm_uu.get(i));
             assert (hm_uu.get(i) == i * i);
             i += 1u;
         }
         assert (hm_uu.insert(num_to_insert, 17u));
         assert (hm_uu.get(num_to_insert) == 17u);
-        debug!{"-----"};
+        debug!("-----");
         i = 0u;
         while i < num_to_insert {
-            debug!{"get(%u) = %u", i, hm_uu.get(i)};
+            debug!("get(%u) = %u", i, hm_uu.get(i));
             assert (hm_uu.get(i) == i * i);
             i += 1u;
         }
-        debug!{"str -> str"};
+        debug!("str -> str");
         let hasher_str: map::hashfn<~str> = str::hash;
         let eqer_str: map::eqfn<~str> = str::eq;
         let hm_ss: map::hashmap<~str, ~str> =
@@ -674,17 +674,17 @@ fn test_growth() {
         i = 0u;
         while i < num_to_insert {
             assert hm_ss.insert(uint::to_str(i, 2u), uint::to_str(i * i, 2u));
-            debug!{"inserting \"%s\" -> \"%s\"",
+            debug!("inserting \"%s\" -> \"%s\"",
                    uint::to_str(i, 2u),
-                   uint::to_str(i*i, 2u)};
+                   uint::to_str(i*i, 2u));
             i += 1u;
         }
-        debug!{"-----"};
+        debug!("-----");
         i = 0u;
         while i < num_to_insert {
-            debug!{"get(\"%s\") = \"%s\"",
+            debug!("get(\"%s\") = \"%s\"",
                    uint::to_str(i, 2u),
-                   hm_ss.get(uint::to_str(i, 2u))};
+                   hm_ss.get(uint::to_str(i, 2u)));
             assert hm_ss.get(uint::to_str(i, 2u)) == uint::to_str(i * i, 2u);
             i += 1u;
         }
@@ -692,21 +692,21 @@ fn test_growth() {
                              uint::to_str(17u, 2u)));
         assert hm_ss.get(uint::to_str(num_to_insert, 2u)) ==
             uint::to_str(17u, 2u);
-        debug!{"-----"};
+        debug!("-----");
         i = 0u;
         while i < num_to_insert {
-            debug!{"get(\"%s\") = \"%s\"",
+            debug!("get(\"%s\") = \"%s\"",
                    uint::to_str(i, 2u),
-                   hm_ss.get(uint::to_str(i, 2u))};
+                   hm_ss.get(uint::to_str(i, 2u)));
             assert hm_ss.get(uint::to_str(i, 2u)) == uint::to_str(i * i, 2u);
             i += 1u;
         }
-        debug!{"*** finished test_growth"};
+        debug!("*** finished test_growth");
     }
 
     #[test]
     fn test_removal() {
-        debug!{"*** starting test_removal"};
+        debug!("*** starting test_removal");
         let num_to_insert: uint = 64u;
         fn eq(x: &uint, y: &uint) -> bool { *x == *y }
         fn hash(u: &uint) -> uint {
@@ -724,12 +724,12 @@ fn hash(u: &uint) -> uint {
         let mut i: uint = 0u;
         while i < num_to_insert {
             assert (hm.insert(i, i * i));
-            debug!{"inserting %u -> %u", i, i*i};
+            debug!("inserting %u -> %u", i, i*i);
             i += 1u;
         }
         assert (hm.size() == num_to_insert);
-        debug!{"-----"};
-        debug!{"removing evens"};
+        debug!("-----");
+        debug!("removing evens");
         i = 0u;
         while i < num_to_insert {
             let v = hm.remove(i);
@@ -737,44 +737,44 @@ fn hash(u: &uint) -> uint {
             i += 2u;
         }
         assert (hm.size() == num_to_insert / 2u);
-        debug!{"-----"};
+        debug!("-----");
         i = 1u;
         while i < num_to_insert {
-            debug!{"get(%u) = %u", i, hm.get(i)};
+            debug!("get(%u) = %u", i, hm.get(i));
             assert (hm.get(i) == i * i);
             i += 2u;
         }
-        debug!{"-----"};
+        debug!("-----");
         i = 1u;
         while i < num_to_insert {
-            debug!{"get(%u) = %u", i, hm.get(i)};
+            debug!("get(%u) = %u", i, hm.get(i));
             assert (hm.get(i) == i * i);
             i += 2u;
         }
-        debug!{"-----"};
+        debug!("-----");
         i = 0u;
         while i < num_to_insert {
             assert (hm.insert(i, i * i));
-            debug!{"inserting %u -> %u", i, i*i};
+            debug!("inserting %u -> %u", i, i*i);
             i += 2u;
         }
         assert (hm.size() == num_to_insert);
-        debug!{"-----"};
+        debug!("-----");
         i = 0u;
         while i < num_to_insert {
-            debug!{"get(%u) = %u", i, hm.get(i)};
+            debug!("get(%u) = %u", i, hm.get(i));
             assert (hm.get(i) == i * i);
             i += 1u;
         }
-        debug!{"-----"};
+        debug!("-----");
         assert (hm.size() == num_to_insert);
         i = 0u;
         while i < num_to_insert {
-            debug!{"get(%u) = %u", i, hm.get(i)};
+            debug!("get(%u) = %u", i, hm.get(i));
             assert (hm.get(i) == i * i);
             i += 1u;
         }
-        debug!{"*** finished test_removal"};
+        debug!("*** finished test_removal");
     }
 
     #[test]
index bd4520e44a4f0f6520c2e0461e40d73ec523d238..f7a7f42afcfb15e09b31e6914a1dcd4472cfb89d 100644 (file)
@@ -88,7 +88,7 @@ fn get_addr(++node: ~str, iotask: iotask)
         -> result::result<~[ip_addr], ip_get_addr_err> unsafe {
     do core::comm::listen |output_ch| {
         do str::as_buf(node) |node_ptr, len| {
-            log(debug, fmt!{"slice len %?", len});
+            log(debug, fmt!("slice len %?", len));
             let handle = create_uv_getaddrinfo_t();
             let handle_ptr = ptr::addr_of(handle);
             let handle_data: get_addr_data = {
@@ -161,10 +161,10 @@ fn parse_to_ipv4_rep(ip: ~str) -> result::result<ipv4_rep, ~str> {
             }
         });
         if vec::len(parts) != 4u {
-                result::err(fmt!{"'%s' doesn't have 4 parts", ip})
+                result::err(fmt!("'%s' doesn't have 4 parts", ip))
                 }
         else if vec::contains(parts, 256u) {
-                result::err(fmt!{"invalid octal in addr '%s'", ip})
+                result::err(fmt!("invalid octal in addr '%s'", ip))
                 }
         else {
             result::ok({a: parts[0] as u8, b: parts[1] as u8,
@@ -185,8 +185,8 @@ fn try_parse_addr(ip: ~str) -> result::result<ip_addr,parse_addr_err> {
 
             let new_addr = uv_ip4_addr(ip, 22);
             let reformatted_name = uv_ip4_name(&new_addr);
-            log(debug, fmt!{"try_parse_addr: input ip: %s reparsed ip: %s",
-                            ip, reformatted_name});
+            log(debug, fmt!("try_parse_addr: input ip: %s reparsed ip: %s",
+                            ip, reformatted_name));
             let ref_ip_rep_result = parse_to_ipv4_rep(reformatted_name);
             if result::is_err(ref_ip_rep_result) {
                 let err_str = result::get_err(ref_ip_rep_result);
@@ -230,13 +230,13 @@ fn try_parse_addr(ip: ~str) -> result::result<ip_addr,parse_addr_err> {
             // need to figure out how to establish a parse failure..
             let new_addr = uv_ip6_addr(ip, 22);
             let reparsed_name = uv_ip6_name(&new_addr);
-            log(debug, fmt!{"v6::try_parse_addr ip: '%s' reparsed '%s'",
-                            ip, reparsed_name});
+            log(debug, fmt!("v6::try_parse_addr ip: '%s' reparsed '%s'",
+                            ip, reparsed_name));
             // '::' appears to be uv_ip6_name() returns for bogus
             // parses..
             if  ip != ~"::" && reparsed_name == ~"::" {
-                result::err({err_msg:fmt!{"failed to parse '%s'",
-                                           ip}})
+                result::err({err_msg:fmt!("failed to parse '%s'",
+                                           ip)})
             }
             else {
                 result::ok(ipv6(new_addr))
@@ -257,7 +257,7 @@ fn try_parse_addr(ip: ~str) -> result::result<ip_addr,parse_addr_err> {
     if status == 0i32 {
         if res != (ptr::null::<addrinfo>()) {
             let mut out_vec = ~[];
-            log(debug, fmt!{"initial addrinfo: %?", res});
+            log(debug, fmt!("initial addrinfo: %?", res));
             let mut curr_addr = res;
             loop {
                 let new_ip_addr = if ll::is_ipv4_addrinfo(curr_addr) {
@@ -284,11 +284,11 @@ fn try_parse_addr(ip: ~str) -> result::result<ip_addr,parse_addr_err> {
                 }
                 else {
                     curr_addr = next_addr;
-                    log(debug, fmt!{"next_addr addrinfo: %?", curr_addr});
+                    log(debug, fmt!("next_addr addrinfo: %?", curr_addr));
                 }
             }
-            log(debug, fmt!{"successful process addrinfo result, len: %?",
-                            vec::len(out_vec)});
+            log(debug, fmt!("successful process addrinfo result, len: %?",
+                            vec::len(out_vec)));
             (*handle_data).output_ch.send(result::ok(out_vec));
         }
         else {
@@ -320,19 +320,19 @@ fn test_ip_ipv4_parse_and_format_ip() {
     fn test_ip_ipv6_parse_and_format_ip() {
         let localhost_str = ~"::1";
         let format_result = format_addr(v6::parse_addr(localhost_str));
-        log(debug, fmt!{"results: expected: '%s' actual: '%s'",
-            localhost_str, format_result});
+        log(debug, fmt!("results: expected: '%s' actual: '%s'",
+            localhost_str, format_result));
         assert format_result == localhost_str;
     }
     #[test]
     fn test_ip_ipv4_bad_parse() {
         match v4::try_parse_addr(~"b4df00d") {
           result::err(err_info) => {
-            log(debug, fmt!{"got error as expected %?", err_info});
+            log(debug, fmt!("got error as expected %?", err_info));
             assert true;
           }
           result::ok(addr) => {
-            fail fmt!{"Expected failure, but got addr %?", addr};
+            fail fmt!("Expected failure, but got addr %?", addr);
           }
         }
     }
@@ -341,11 +341,11 @@ fn test_ip_ipv4_bad_parse() {
     fn test_ip_ipv6_bad_parse() {
         match v6::try_parse_addr(~"::,~2234k;") {
           result::err(err_info) => {
-            log(debug, fmt!{"got error as expected %?", err_info});
+            log(debug, fmt!("got error as expected %?", err_info));
             assert true;
           }
           result::ok(addr) => {
-            fail fmt!{"Expected failure, but got addr %?", addr};
+            fail fmt!("Expected failure, but got addr %?", addr);
           }
         }
     }
@@ -361,15 +361,15 @@ fn test_ip_get_addr() {
         // note really sure how to realiably test/assert
         // this.. mostly just wanting to see it work, atm.
         let results = result::unwrap(ga_result);
-        log(debug, fmt!{"test_get_addr: Number of results for %s: %?",
-                        localhost_name, vec::len(results)});
+        log(debug, fmt!("test_get_addr: Number of results for %s: %?",
+                        localhost_name, vec::len(results)));
         for vec::each(results) |r| {
             let ipv_prefix = match r {
               ipv4(_) => ~"IPv4",
               ipv6(_) => ~"IPv6"
             };
-            log(debug, fmt!{"test_get_addr: result %s: '%s'",
-                            ipv_prefix, format_addr(r)});
+            log(debug, fmt!("test_get_addr: result %s: '%s'",
+                            ipv_prefix, format_addr(r)));
         }
         // at least one result.. this is going to vary from system
         // to system, based on stuff like the contents of /etc/hosts
index aadbe09bc4e1833067e27f5783635d13aa2863bd..64271eceed75f9a4621a9731e7316fefbe42b419 100644 (file)
@@ -140,15 +140,15 @@ fn connect(-input_ip: ip::ip_addr, port: uint,
         iotask: iotask
     };
     let socket_data_ptr = ptr::addr_of(*socket_data);
-    log(debug, fmt!{"tcp_connect result_ch %?", conn_data.result_ch});
+    log(debug, fmt!("tcp_connect result_ch %?", conn_data.result_ch));
     // get an unsafe representation of our stream_handle_ptr that
     // we can send into the interact cb to be handled in libuv..
-    log(debug, fmt!{"stream_handle_ptr outside interact %?",
-        stream_handle_ptr});
+    log(debug, fmt!("stream_handle_ptr outside interact %?",
+        stream_handle_ptr));
     do iotask::interact(iotask) |loop_ptr| {
         log(debug, ~"in interact cb for tcp client connect..");
-        log(debug, fmt!{"stream_handle_ptr in interact %?",
-            stream_handle_ptr});
+        log(debug, fmt!("stream_handle_ptr in interact %?",
+            stream_handle_ptr));
         match uv::ll::tcp_init( loop_ptr, stream_handle_ptr) {
           0i32 => {
             log(debug, ~"tcp_init successful");
@@ -165,7 +165,7 @@ fn connect(-input_ip: ip::ip_addr, port: uint,
                     // info.. should probably add an additional
                     // rust type that actually is closer to
                     // what the libuv API expects (ip str + port num)
-                    log(debug, fmt!{"addr: %?", addr});
+                    log(debug, fmt!("addr: %?", addr));
                     let in_addr = uv::ll::ip4_addr(addr_str, port as int);
                     uv::ll::tcp_connect(
                         connect_req_ptr,
@@ -174,7 +174,7 @@ fn connect(-input_ip: ip::ip_addr, port: uint,
                         tcp_connect_on_connect_cb)
                   }
                   ip::ipv6(addr) => {
-                    log(debug, fmt!{"addr: %?", addr});
+                    log(debug, fmt!("addr: %?", addr));
                     let in_addr = uv::ll::ip6_addr(addr_str, port as int);
                     uv::ll::tcp_connect6(
                         connect_req_ptr,
@@ -333,7 +333,7 @@ fn read_start(sock: tcp_socket)
 fn read_stop(sock: tcp_socket,
              -read_port: comm::Port<result::result<~[u8], tcp_err_data>>) ->
     result::result<(), tcp_err_data> unsafe {
-    log(debug, fmt!{"taking the read_port out of commission %?", read_port});
+    log(debug, fmt!("taking the read_port out of commission %?", read_port));
     let socket_data = ptr::addr_of(*sock.socket_data);
     read_stop_common_impl(socket_data)
 }
@@ -617,13 +617,13 @@ fn listen_common(-host_ip: ip::ip_addr, port: uint, backlog: uint,
                 let addr_str = ip::format_addr(loc_ip);
                 let bind_result = match loc_ip {
                   ip::ipv4(addr) => {
-                    log(debug, fmt!{"addr: %?", addr});
+                    log(debug, fmt!("addr: %?", addr));
                     let in_addr = uv::ll::ip4_addr(addr_str, port as int);
                     uv::ll::tcp_bind(server_stream_ptr,
                                      ptr::addr_of(in_addr))
                   }
                   ip::ipv6(addr) => {
-                    log(debug, fmt!{"addr: %?", addr});
+                    log(debug, fmt!("addr: %?", addr));
                     let in_addr = uv::ll::ip6_addr(addr_str, port as int);
                     uv::ll::tcp_bind6(server_stream_ptr,
                                      ptr::addr_of(in_addr))
@@ -661,8 +661,8 @@ fn listen_common(-host_ip: ip::ip_addr, port: uint, backlog: uint,
     match setup_result {
       some(err_data) => {
         do iotask::interact(iotask) |loop_ptr| {
-            log(debug, fmt!{"tcp::listen post-kill recv hl interact %?",
-                            loop_ptr});
+            log(debug, fmt!("tcp::listen post-kill recv hl interact %?",
+                            loop_ptr));
             (*server_data_ptr).active = false;
             uv::ll::close(server_stream_ptr, tcp_lfc_close_cb);
         };
@@ -677,8 +677,8 @@ fn listen_common(-host_ip: ip::ip_addr, port: uint, backlog: uint,
             result::err(address_in_use)
           }
           _ => {
-            log(debug, fmt!{"Got '%s' '%s' libuv error",
-                            err_data.err_name, err_data.err_msg});
+            log(debug, fmt!("Got '%s' '%s' libuv error",
+                            err_data.err_name, err_data.err_msg));
             result::err(
                 generic_listen_err(err_data.err_name, err_data.err_msg))
           }
@@ -688,8 +688,8 @@ fn listen_common(-host_ip: ip::ip_addr, port: uint, backlog: uint,
         on_establish_cb(kill_ch);
         let kill_result = core::comm::recv(kill_po);
         do iotask::interact(iotask) |loop_ptr| {
-            log(debug, fmt!{"tcp::listen post-kill recv hl interact %?",
-                            loop_ptr});
+            log(debug, fmt!("tcp::listen post-kill recv hl interact %?",
+                            loop_ptr));
             (*server_data_ptr).active = false;
             uv::ll::close(server_stream_ptr, tcp_lfc_close_cb);
         };
@@ -765,8 +765,8 @@ fn read(buf: &[mut u8], len: uint) -> uint {
                 if err_data.err_name == ~"EOF" {
                     break;
                 } else {
-                    debug!{"ERROR sock_buf as io::reader.read err %? %?",
-                           err_data.err_name, err_data.err_msg};
+                    debug!("ERROR sock_buf as io::reader.read err %? %?",
+                           err_data.err_name, err_data.err_msg);
 
                     return 0;
                 }
@@ -798,7 +798,7 @@ fn eof() -> bool {
         false // noop
     }
     fn seek(dist: int, seek: io::SeekStyle) {
-        log(debug, fmt!{"tcp_socket_buf seek stub %? %?", dist, seek});
+        log(debug, fmt!("tcp_socket_buf seek stub %? %?", dist, seek));
         // noop
     }
     fn tell() -> uint {
@@ -815,12 +815,12 @@ fn write(data: &[const u8]) unsafe {
                                         vec::slice(data, 0, vec::len(data)));
         if w_result.is_err() {
             let err_data = w_result.get_err();
-            log(debug, fmt!{"ERROR sock_buf as io::writer.writer err: %? %?",
-                             err_data.err_name, err_data.err_msg});
+            log(debug, fmt!("ERROR sock_buf as io::writer.writer err: %? %?",
+                             err_data.err_name, err_data.err_msg));
         }
     }
     fn seek(dist: int, seek: io::SeekStyle) {
-      log(debug, fmt!{"tcp_socket_buf seek stub %? %?", dist, seek});
+      log(debug, fmt!("tcp_socket_buf seek stub %? %?", dist, seek));
         // noop
     }
     fn tell() -> uint {
@@ -845,14 +845,14 @@ fn tear_down_socket_data(socket_data: @tcp_socket_data) unsafe {
     let close_data_ptr = ptr::addr_of(close_data);
     let stream_handle_ptr = (*socket_data).stream_handle_ptr;
     do iotask::interact((*socket_data).iotask) |loop_ptr| {
-        log(debug, fmt!{"interact dtor for tcp_socket stream %? loop %?",
-            stream_handle_ptr, loop_ptr});
+        log(debug, fmt!("interact dtor for tcp_socket stream %? loop %?",
+            stream_handle_ptr, loop_ptr));
         uv::ll::set_data_for_uv_handle(stream_handle_ptr,
                                        close_data_ptr);
         uv::ll::close(stream_handle_ptr, tcp_socket_dtor_close_cb);
     };
     core::comm::recv(closed_po);
-    log(debug, fmt!{"about to free socket_data at %?", socket_data});
+    log(debug, fmt!("about to free socket_data at %?", socket_data));
     rustrt::rust_uv_current_kernel_free(stream_handle_ptr
                                        as *libc::c_void);
     log(debug, ~"exiting dtor for tcp_socket");
@@ -931,7 +931,7 @@ fn read_start_common_impl(socket_data: *tcp_socket_data)
     let start_ch = core::comm::chan(start_po);
     log(debug, ~"in tcp::read_start before interact loop");
     do iotask::interact((*socket_data).iotask) |loop_ptr| {
-        log(debug, fmt!{"in tcp::read_start interact cb %?", loop_ptr});
+        log(debug, fmt!("in tcp::read_start interact cb %?", loop_ptr));
         match uv::ll::read_start(stream_handle_ptr as *uv::ll::uv_stream_t,
                                on_alloc_cb,
                                on_tcp_read_cb) {
@@ -971,7 +971,7 @@ fn write_common_impl(socket_data_ptr: *tcp_socket_data,
     };
     let write_data_ptr = ptr::addr_of(write_data);
     do iotask::interact((*socket_data_ptr).iotask) |loop_ptr| {
-        log(debug, fmt!{"in interact cb for tcp::write %?", loop_ptr});
+        log(debug, fmt!("in interact cb for tcp::write %?", loop_ptr));
         match uv::ll::write(write_req_ptr,
                           stream_handle_ptr,
                           write_buf_vec_ptr,
@@ -1075,8 +1075,8 @@ fn to_tcp_err() -> tcp_err_data {
 extern fn on_tcp_read_cb(stream: *uv::ll::uv_stream_t,
                     nread: libc::ssize_t,
                     ++buf: uv::ll::uv_buf_t) unsafe {
-    log(debug, fmt!{"entering on_tcp_read_cb stream: %? nread: %?",
-                    stream, nread});
+    log(debug, fmt!("entering on_tcp_read_cb stream: %? nread: %?",
+                    stream, nread));
     let loop_ptr = uv::ll::get_loop_for_uv_handle(stream);
     let socket_data_ptr = uv::ll::get_data_for_uv_handle(stream)
         as *tcp_socket_data;
@@ -1084,8 +1084,8 @@ fn to_tcp_err() -> tcp_err_data {
       // incoming err.. probably eof
       -1 => {
         let err_data = uv::ll::get_last_err_data(loop_ptr).to_tcp_err();
-        log(debug, fmt!{"on_tcp_read_cb: incoming err.. name %? msg %?",
-                        err_data.err_name, err_data.err_msg});
+        log(debug, fmt!("on_tcp_read_cb: incoming err.. name %? msg %?",
+                        err_data.err_name, err_data.err_msg));
         let reader_ch = (*socket_data_ptr).reader_ch;
         core::comm::send(reader_ch, result::err(err_data));
       }
@@ -1094,7 +1094,7 @@ fn to_tcp_err() -> tcp_err_data {
       // have data
       _ => {
         // we have data
-        log(debug, fmt!{"tcp on_read_cb nread: %d", nread as int});
+        log(debug, fmt!("tcp on_read_cb nread: %d", nread as int));
         let reader_ch = (*socket_data_ptr).reader_ch;
         let buf_base = uv::ll::get_base_from_buf(buf);
         let new_bytes = vec::unsafe::from_buf(buf_base, nread as uint);
@@ -1110,10 +1110,10 @@ fn to_tcp_err() -> tcp_err_data {
     -> uv::ll::uv_buf_t unsafe {
     log(debug, ~"tcp read on_alloc_cb!");
     let char_ptr = uv::ll::malloc_buf_base_of(suggested_size);
-    log(debug, fmt!{"tcp read on_alloc_cb h: %? char_ptr: %u sugsize: %u",
+    log(debug, fmt!("tcp read on_alloc_cb h: %? char_ptr: %u sugsize: %u",
                      handle,
                      char_ptr as uint,
-                     suggested_size as uint});
+                     suggested_size as uint));
     uv::ll::buf_init(char_ptr, suggested_size as uint)
 }
 
@@ -1160,11 +1160,11 @@ fn to_tcp_err() -> tcp_err_data {
     let data = uv::ll::get_data_for_uv_handle(handle) as
         *connect_req_data;
     core::comm::send((*data).closed_signal_ch, ());
-    log(debug, fmt!{"exiting steam_error_close_cb for %?", handle});
+    log(debug, fmt!("exiting steam_error_close_cb for %?", handle));
 }
 
 extern fn tcp_connect_close_cb(handle: *uv::ll::uv_tcp_t) unsafe {
-    log(debug, fmt!{"closed client tcp handle %?", handle});
+    log(debug, fmt!("closed client tcp handle %?", handle));
 }
 
 extern fn tcp_connect_on_connect_cb(connect_req_ptr: *uv::ll::uv_connect_t,
@@ -1172,7 +1172,7 @@ fn to_tcp_err() -> tcp_err_data {
     let conn_data_ptr = (uv::ll::get_data_for_req(connect_req_ptr)
                       as *connect_req_data);
     let result_ch = (*conn_data_ptr).result_ch;
-    log(debug, fmt!{"tcp_connect result_ch %?", result_ch});
+    log(debug, fmt!("tcp_connect result_ch %?", result_ch));
     let tcp_stream_ptr =
         uv::ll::get_stream_handle_from_connect_req(connect_req_ptr);
     match status {
@@ -1184,8 +1184,8 @@ fn to_tcp_err() -> tcp_err_data {
         log(debug, ~"error in tcp_connect_on_connect_cb");
         let loop_ptr = uv::ll::get_loop_for_uv_handle(tcp_stream_ptr);
         let err_data = uv::ll::get_last_err_data(loop_ptr);
-        log(debug, fmt!{"err_data %? %?", err_data.err_name,
-                        err_data.err_msg});
+        log(debug, fmt!("err_data %? %?", err_data.err_name,
+                        err_data.err_msg));
         core::comm::send(result_ch, conn_failure(err_data));
         uv::ll::set_data_for_uv_handle(tcp_stream_ptr,
                                        conn_data_ptr);
@@ -1314,10 +1314,10 @@ fn impl_gl_tcp_ipv4_server_and_client() {
         assert actual_resp_result.is_ok();
         let actual_resp = actual_resp_result.get();
         let actual_req = core::comm::recv(server_result_po);
-        log(debug, fmt!{"REQ: expected: '%s' actual: '%s'",
-                       expected_req, actual_req});
-        log(debug, fmt!{"RESP: expected: '%s' actual: '%s'",
-                       expected_resp, actual_resp});
+        log(debug, fmt!("REQ: expected: '%s' actual: '%s'",
+                       expected_req, actual_req));
+        log(debug, fmt!("RESP: expected: '%s' actual: '%s'",
+                       expected_resp, actual_resp));
         assert str::contains(actual_req, expected_req);
         assert str::contains(actual_resp, expected_resp);
     }
@@ -1453,27 +1453,27 @@ fn impl_gl_tcp_ipv4_server_client_reader_writer() {
         };
 
         let actual_req = core::comm::recv(server_result_po);
-        log(debug, fmt!{"REQ: expected: '%s' actual: '%s'",
-                       expected_req, actual_req});
-        log(debug, fmt!{"RESP: expected: '%s' actual: '%s'",
-                       expected_resp, actual_resp});
+        log(debug, fmt!("REQ: expected: '%s' actual: '%s'",
+                       expected_req, actual_req));
+        log(debug, fmt!("RESP: expected: '%s' actual: '%s'",
+                       expected_resp, actual_resp));
         assert str::contains(actual_req, expected_req);
         assert str::contains(actual_resp, expected_resp);
     }
 
     fn buf_write(+w: io::Writer, val: ~str) {
-        log(debug, fmt!{"BUF_WRITE: val len %?", str::len(val)});
+        log(debug, fmt!("BUF_WRITE: val len %?", str::len(val)));
         do str::byte_slice(val) |b_slice| {
-            log(debug, fmt!{"BUF_WRITE: b_slice len %?",
-                            vec::len(b_slice)});
+            log(debug, fmt!("BUF_WRITE: b_slice len %?",
+                            vec::len(b_slice)));
             w.write(b_slice)
         }
     }
 
     fn buf_read(+r: io::Reader, len: uint) -> ~str {
         let new_bytes = r.read_bytes(len);
-        log(debug, fmt!{"in buf_read.. new_bytes len: %?",
-                        vec::len(new_bytes)});
+        log(debug, fmt!("in buf_read.. new_bytes len: %?",
+                        vec::len(new_bytes)));
         str::from_bytes(new_bytes)
     }
 
@@ -1485,8 +1485,8 @@ fn run_tcp_test_server(server_ip: ~str, server_port: uint, resp: ~str,
         let listen_result = listen(server_ip_addr, server_port, 128u, iotask,
             // on_establish_cb -- called when listener is set up
             |kill_ch| {
-                log(debug, fmt!{"establish_cb %?",
-                    kill_ch});
+                log(debug, fmt!("establish_cb %?",
+                    kill_ch));
                 core::comm::send(cont_ch, ());
             },
             // risky to run this on the loop, but some users
@@ -1518,8 +1518,8 @@ fn run_tcp_test_server(server_ip: ~str, server_port: uint, resp: ~str,
                         match received_req_bytes {
                           result::ok(data) => {
                             log(debug, ~"SERVER: got REQ str::from_bytes..");
-                            log(debug, fmt!{"SERVER: REQ data len: %?",
-                                            vec::len(data)});
+                            log(debug, fmt!("SERVER: REQ data len: %?",
+                                            vec::len(data)));
                             server_ch.send(
                                 str::from_bytes(data));
                             log(debug, ~"SERVER: before write");
@@ -1528,8 +1528,8 @@ fn run_tcp_test_server(server_ip: ~str, server_port: uint, resp: ~str,
                             core::comm::send(kill_ch, none);
                           }
                           result::err(err_data) => {
-                            log(debug, fmt!{"SERVER: error recvd: %s %s",
-                                err_data.err_name, err_data.err_msg});
+                            log(debug, fmt!("SERVER: error recvd: %s %s",
+                                err_data.err_name, err_data.err_msg));
                             core::comm::send(kill_ch, some(err_data));
                             server_ch.send(~"");
                           }
@@ -1546,8 +1546,8 @@ fn run_tcp_test_server(server_ip: ~str, server_port: uint, resp: ~str,
         if result::is_err(listen_result) {
             match result::get_err(listen_result) {
               generic_listen_err(name, msg) => {
-                fail fmt!{"SERVER: exited abnormally name %s msg %s",
-                                name, msg};
+                fail fmt!("SERVER: exited abnormally name %s msg %s",
+                                name, msg);
               }
               access_denied => {
                 fail ~"SERVER: exited abnormally, got access denied..";
@@ -1558,7 +1558,7 @@ fn run_tcp_test_server(server_ip: ~str, server_port: uint, resp: ~str,
             }
         }
         let ret_val = server_ch.recv();
-        log(debug, fmt!{"SERVER: exited and got return val: '%s'", ret_val});
+        log(debug, fmt!("SERVER: exited and got return val: '%s'", ret_val));
         ret_val
     }
 
@@ -1568,12 +1568,12 @@ fn run_tcp_test_server_fail(server_ip: ~str, server_port: uint,
         let listen_result = listen(server_ip_addr, server_port, 128u, iotask,
             // on_establish_cb -- called when listener is set up
             |kill_ch| {
-                log(debug, fmt!{"establish_cb %?",
-                    kill_ch});
+                log(debug, fmt!("establish_cb %?",
+                    kill_ch));
             },
             |new_conn, kill_ch| {
-                fail fmt!{"SERVER: shouldn't be called.. %? %?",
-                           new_conn, kill_ch};
+                fail fmt!("SERVER: shouldn't be called.. %? %?",
+                           new_conn, kill_ch);
         });
         // err check on listen_result
         if result::is_err(listen_result) {
@@ -1609,8 +1609,8 @@ fn run_tcp_test_client(server_ip: ~str, server_port: uint, resp: ~str,
             else {
                 client_ch.send(str::from_bytes(read_result.get()));
                 let ret_val = client_ch.recv();
-                log(debug, fmt!{"CLIENT: after client_ch recv ret: '%s'",
-                   ret_val});
+                log(debug, fmt!("CLIENT: after client_ch recv ret: '%s'",
+                   ret_val));
                 ok(ret_val)
             }
         }
@@ -1622,8 +1622,8 @@ fn tcp_write_single(sock: tcp_socket, val: ~[u8]) {
         if result::is_err(write_result) {
             log(debug, ~"tcp_write_single: write failed!");
             let err_data = result::get_err(write_result);
-            log(debug, fmt!{"tcp_write_single err name: %s msg: %s",
-                err_data.err_name, err_data.err_msg});
+            log(debug, fmt!("tcp_write_single err name: %s msg: %s",
+                err_data.err_name, err_data.err_msg));
             // meh. torn on what to do here.
             fail ~"tcp_write_single failed";
         }
index 7dbb07a6aad6d1a1e30e04d9850d4e662e9a631a..34ea2433bedbb64122838e919e1a9f42b3502b3e 100644 (file)
@@ -47,11 +47,11 @@ fn map_slices<A: copy send, B: copy send>(
                         let len = end - base;
                         let slice = (ptr::offset(p, base),
                                      len * sys::size_of::<A>());
-                        log(info, fmt!{"pre-slice: %?", (base, slice)});
+                        log(info, fmt!("pre-slice: %?", (base, slice)));
                         let slice : &[A] =
                             unsafe::reinterpret_cast(slice);
-                        log(info, fmt!{"slice: %?",
-                                       (base, vec::len(slice), end - base)});
+                        log(info, fmt!("slice: %?",
+                                       (base, vec::len(slice), end - base)));
                         assert(vec::len(slice) == end - base);
                         f(base, slice)
                     }
@@ -62,7 +62,7 @@ fn map_slices<A: copy send, B: copy send>(
         }
         log(info, ~"tasks spawned");
 
-        log(info, fmt!{"num_tasks: %?", (num_tasks, futures.len())});
+        log(info, fmt!("num_tasks: %?", (num_tasks, futures.len())));
         assert(num_tasks == futures.len());
 
         let r = do futures.map() |ys| {
index 252ab3dd8e21b4fdcda45d371715bbb3e473e4a3..4e21da29fd77bbbf90eabbdc5d9968e8e09802ca 100644 (file)
@@ -8,63 +8,63 @@ fn emit_nil() {
     }
 
     fn emit_uint(v: uint) {
-        self.write_str(fmt!{"%?u", v});
+        self.write_str(fmt!("%?u", v));
     }
 
     fn emit_u64(v: u64) {
-        self.write_str(fmt!{"%?_u64", v});
+        self.write_str(fmt!("%?_u64", v));
     }
 
     fn emit_u32(v: u32) {
-        self.write_str(fmt!{"%?_u32", v});
+        self.write_str(fmt!("%?_u32", v));
     }
 
     fn emit_u16(v: u16) {
-        self.write_str(fmt!{"%?_u16", v});
+        self.write_str(fmt!("%?_u16", v));
     }
 
     fn emit_u8(v: u8) {
-        self.write_str(fmt!{"%?_u8", v});
+        self.write_str(fmt!("%?_u8", v));
     }
 
     fn emit_int(v: int) {
-        self.write_str(fmt!{"%?", v});
+        self.write_str(fmt!("%?", v));
     }
 
     fn emit_i64(v: i64) {
-        self.write_str(fmt!{"%?_i64", v});
+        self.write_str(fmt!("%?_i64", v));
     }
 
     fn emit_i32(v: i32) {
-        self.write_str(fmt!{"%?_i32", v});
+        self.write_str(fmt!("%?_i32", v));
     }
 
     fn emit_i16(v: i16) {
-        self.write_str(fmt!{"%?_i16", v});
+        self.write_str(fmt!("%?_i16", v));
     }
 
     fn emit_i8(v: i8) {
-        self.write_str(fmt!{"%?_i8", v});
+        self.write_str(fmt!("%?_i8", v));
     }
 
     fn emit_bool(v: bool) {
-        self.write_str(fmt!{"%b", v});
+        self.write_str(fmt!("%b", v));
     }
 
     fn emit_float(v: float) {
-        self.write_str(fmt!{"%?_f", v});
+        self.write_str(fmt!("%?_f", v));
     }
 
     fn emit_f64(v: f64) {
-        self.write_str(fmt!{"%?_f64", v});
+        self.write_str(fmt!("%?_f64", v));
     }
 
     fn emit_f32(v: f32) {
-        self.write_str(fmt!{"%?_f32", v});
+        self.write_str(fmt!("%?_f32", v));
     }
 
     fn emit_str(v: &str) {
-        self.write_str(fmt!{"%?", v});
+        self.write_str(fmt!("%?", v));
     }
 
     fn emit_enum(_name: ~str, f: fn()) {
index 04b04f505a452baa8ce4084e5e312e4db72545b8..5a7e77ead480023ce70b6ff100433c6de4bb51c0 100644 (file)
@@ -27,7 +27,7 @@ fn mk<T: copy>() -> smallintmap<T> {
  */
 #[inline(always)]
 fn insert<T: copy>(self: smallintmap<T>, key: uint, val: T) {
-    //io::println(fmt!{"%?", key});
+    //io::println(fmt!("%?", key));
     self.v.grow_set_elt(key, none, some(val));
 }
 
@@ -50,7 +50,7 @@ fn insert<T: copy>(self: smallintmap<T>, key: uint, val: T) {
 pure fn get<T: copy>(self: smallintmap<T>, key: uint) -> T {
     match find(self, key) {
       none => {
-        error!{"smallintmap::get(): key not present"};
+        error!("smallintmap::get(): key not present");
         fail;
       }
       some(v) => return v
index df13fcba1afa7469cfc065a0ea4d40450495b4de..256ee4ecd739dc718ed9e377e94540f8d4173c48 100644 (file)
@@ -250,7 +250,7 @@ fn test_simple() {
         let pairs = vec::zip(expected, immut_names);
         for vec::each(pairs) |p| {
             let (a, b) = p;
-            debug!{"%d %d", a, b};
+            debug!("%d %d", a, b);
             assert (a == b);
         }
     }
index 09bde8d6b3f72f5164147a2db3017a3a6d46df33..a0cc26b6658e2542214a1930d4ce5a16b88f92ce 100644 (file)
@@ -110,9 +110,9 @@ fn callback(event: testevent, st: console_test_state) {
           te_filtered(filtered_tests) => {
             st.total = vec::len(filtered_tests);
             let noun = if st.total != 1u { ~"tests" } else { ~"test" };
-            st.out.write_line(fmt!{"\nrunning %u %s", st.total, noun});
+            st.out.write_line(fmt!("\nrunning %u %s", st.total, noun));
           }
-          te_wait(test) => st.out.write_str(fmt!{"test %s ... ", test.name}),
+          te_wait(test) => st.out.write_str(fmt!("test %s ... ", test.name)),
           te_result(test, result) => {
             match st.log_out {
                 some(f) => write_log(f, result, test),
@@ -145,7 +145,7 @@ fn callback(event: testevent, st: console_test_state) {
                                             ~[io::Create, io::Truncate]) {
           result::ok(w) => some(w),
           result::err(s) => {
-              fail(fmt!{"can't open output file: %s", s})
+              fail(fmt!("can't open output file: %s", s))
           }
         },
         none => none
@@ -170,23 +170,23 @@ fn callback(event: testevent, st: console_test_state) {
         print_failures(st);
     }
 
-    st.out.write_str(fmt!{"\nresult: "});
+    st.out.write_str(fmt!("\nresult: "));
     if success {
         // There's no parallelism at this point so it's safe to use color
         write_ok(st.out, true);
     } else { write_failed(st.out, true); }
-    st.out.write_str(fmt!{". %u passed; %u failed; %u ignored\n\n", st.passed,
-                          st.failed, st.ignored});
+    st.out.write_str(fmt!(". %u passed; %u failed; %u ignored\n\n", st.passed,
+                          st.failed, st.ignored));
 
     return success;
 
     fn write_log(out: io::Writer, result: test_result, test: test_desc) {
-        out.write_line(fmt!{"%s %s",
+        out.write_line(fmt!("%s %s",
                     match result {
                         tr_ok => ~"ok",
                         tr_failed => ~"failed",
                         tr_ignored => ~"ignored"
-                    }, test.name});
+                    }, test.name));
     }
 
     fn write_ok(out: io::Writer, use_color: bool) {
@@ -218,7 +218,7 @@ fn print_failures(st: console_test_state) {
     let failures = vec::map(failures, |test| test.name);
     let failures = sort::merge_sort(str::le, failures);
     for vec::each(failures) |name| {
-        st.out.write_line(fmt!{"    %s", name});
+        st.out.write_line(fmt!("    %s", name));
     }
 }
 
@@ -279,7 +279,7 @@ fn run_tests(opts: test_opts, tests: ~[test_desc],
     // It's tempting to just spawn all the tests at once, but since we have
     // many tests that run in other processes we would be making a big mess.
     let concurrency = get_concurrency();
-    debug!{"using %u test tasks", concurrency};
+    debug!("using %u test tasks", concurrency);
 
     let total = vec::len(filtered_tests);
     let mut run_idx = 0u;
index 1aa6c4d74dab71c0b34e95536bcbd6f2ec86c621..4f557fd95734fc45bbabdd78614e7e4ec4dd3955 100644 (file)
@@ -200,9 +200,9 @@ fn parse_char(s: ~str, pos: uint, c: char) -> result<uint, ~str> {
         if c == ch {
             ok(next)
         } else {
-            err(fmt!{"Expected %?, found %?",
+            err(fmt!("Expected %?, found %?",
                 str::from_char(c),
-                str::from_char(ch)})
+                str::from_char(ch)))
         }
     }
 
@@ -511,7 +511,7 @@ fn parse_type(s: ~str, pos: uint, ch: char, tm: tm_mut)
           }
           '%' => parse_char(s, pos, '%'),
           ch => {
-            err(fmt!{"unknown formatting type: %?", str::from_char(ch)})
+            err(fmt!("unknown formatting type: %?", str::from_char(ch)))
           }
         }
     }
@@ -625,70 +625,70 @@ fn parse_type(ch: char, tm: tm) -> ~str {
             11 => ~"Dec",
             _  => die()
           },
-          'C' => fmt!{"%02d", (tm.tm_year as int + 1900) / 100},
+          'C' => fmt!("%02d", (tm.tm_year as int + 1900) / 100),
           'c' => {
-            fmt!{"%s %s %s %s %s",
+            fmt!("%s %s %s %s %s",
                 parse_type('a', tm),
                 parse_type('b', tm),
                 parse_type('e', tm),
                 parse_type('T', tm),
-                parse_type('Y', tm)}
+                parse_type('Y', tm))
           }
           'D' | 'x' => {
-            fmt!{"%s/%s/%s",
+            fmt!("%s/%s/%s",
                 parse_type('m', tm),
                 parse_type('d', tm),
-                parse_type('y', tm)}
+                parse_type('y', tm))
           }
-          'd' => fmt!{"%02d", tm.tm_mday as int},
-          'e' => fmt!{"%2d", tm.tm_mday as int},
+          'd' => fmt!("%02d", tm.tm_mday as int),
+          'e' => fmt!("%2d", tm.tm_mday as int),
           'F' => {
-            fmt!{"%s-%s-%s",
+            fmt!("%s-%s-%s",
                 parse_type('Y', tm),
                 parse_type('m', tm),
-                parse_type('d', tm)}
+                parse_type('d', tm))
           }
           //'G' {}
           //'g' {}
-          'H' => fmt!{"%02d", tm.tm_hour as int},
+          'H' => fmt!("%02d", tm.tm_hour as int),
           'I' => {
             let mut h = tm.tm_hour as int;
             if h == 0 { h = 12 }
             if h > 12 { h -= 12 }
-            fmt!{"%02d", h}
+            fmt!("%02d", h)
           }
-          'j' => fmt!{"%03d", tm.tm_yday as int + 1},
-          'k' => fmt!{"%2d", tm.tm_hour as int},
+          'j' => fmt!("%03d", tm.tm_yday as int + 1),
+          'k' => fmt!("%2d", tm.tm_hour as int),
           'l' => {
             let mut h = tm.tm_hour as int;
             if h == 0 { h = 12 }
             if h > 12 { h -= 12 }
-            fmt!{"%2d", h}
+            fmt!("%2d", h)
           }
-          'M' => fmt!{"%02d", tm.tm_min as int},
-          'm' => fmt!{"%02d", tm.tm_mon as int + 1},
+          'M' => fmt!("%02d", tm.tm_min as int),
+          'm' => fmt!("%02d", tm.tm_mon as int + 1),
           'n' => ~"\n",
           'P' => if tm.tm_hour as int < 12 { ~"am" } else { ~"pm" },
           'p' => if tm.tm_hour as int < 12 { ~"AM" } else { ~"PM" },
           'R' => {
-            fmt!{"%s:%s",
+            fmt!("%s:%s",
                 parse_type('H', tm),
-                parse_type('M', tm)}
+                parse_type('M', tm))
           }
           'r' => {
-            fmt!{"%s:%s:%s %s",
+            fmt!("%s:%s:%s %s",
                 parse_type('I', tm),
                 parse_type('M', tm),
                 parse_type('S', tm),
-                parse_type('p', tm)}
+                parse_type('p', tm))
           }
-          'S' => fmt!{"%02d", tm.tm_sec as int},
-          's' => fmt!{"%d", tm.to_timespec().sec as int},
+          'S' => fmt!("%02d", tm.tm_sec as int),
+          's' => fmt!("%d", tm.to_timespec().sec as int),
           'T' | 'X' => {
-            fmt!{"%s:%s:%s",
+            fmt!("%s:%s:%s",
                 parse_type('H', tm),
                 parse_type('M', tm),
-                parse_type('S', tm)}
+                parse_type('S', tm))
           }
           't' => ~"\t",
           //'U' {}
@@ -698,24 +698,24 @@ fn parse_type(ch: char, tm: tm) -> ~str {
           }
           //'V' {}
           'v' => {
-            fmt!{"%s-%s-%s",
+            fmt!("%s-%s-%s",
                 parse_type('e', tm),
                 parse_type('b', tm),
-                parse_type('Y', tm)}
+                parse_type('Y', tm))
           }
           //'W' {}
           'w' => int::str(tm.tm_wday as int),
           //'X' {}
           //'x' {}
           'Y' => int::str(tm.tm_year as int + 1900),
-          'y' => fmt!{"%02d", (tm.tm_year as int + 1900) % 100},
+          'y' => fmt!("%02d", (tm.tm_year as int + 1900) % 100),
           'Z' => tm.tm_zone,
           'z' => {
             let sign = if tm.tm_gmtoff > 0_i32 { '+' } else { '-' };
             let mut m = i32::abs(tm.tm_gmtoff) / 60_i32;
             let h = m / 60_i32;
             m -= h * 60_i32;
-            fmt!{"%c%02d%02d", sign, h as int, m as int}
+            fmt!("%c%02d%02d", sign, h as int, m as int)
           }
           //'+' {}
           '%' => ~"%",
@@ -807,7 +807,7 @@ fn rfc3339() -> ~str {
             let mut m = i32::abs(self.tm_gmtoff) / 60_i32;
             let h = m / 60_i32;
             m -= h * 60_i32;
-            s + fmt!{"%c%02d:%02d", sign, h as int, m as int}
+            s + fmt!("%c%02d:%02d", sign, h as int, m as int)
         }
     }
 }
@@ -888,7 +888,7 @@ fn test_at() {
         let time = { sec: 1234567890_i64, nsec: 54321_i32 };
         let local = at(time);
 
-        error!{"time_at: %?", local};
+        error!("time_at: %?", local);
 
         assert local.tm_sec == 30_i32;
         assert local.tm_min == 31_i32;
@@ -1094,7 +1094,7 @@ fn test_ctime() {
         let utc   = at_utc(time);
         let local = at(time);
 
-        error!{"test_ctime: %? %?", utc.ctime(), local.ctime()};
+        error!("test_ctime: %? %?", utc.ctime(), local.ctime());
 
         assert utc.ctime()   == ~"Fri Feb 13 23:31:30 2009";
         assert local.ctime() == ~"Fri Feb 13 15:31:30 2009";
index 67df1e9e1903b949c08ae1f32b395c96a6283c27..02c2294f8c4888d7e2205229bd25c7a7242c8465 100644 (file)
@@ -108,8 +108,8 @@ fn recv_timeout<T: copy send>(iotask: iotask,
     // FIXME: This could be written clearer (#2618)
     either::either(
         |left_val| {
-            log(debug, fmt!{"recv_time .. left_val %?",
-                           left_val});
+            log(debug, fmt!("recv_time .. left_val %?",
+                           left_val));
             none
         }, |right_val| {
             some(*right_val)
@@ -120,7 +120,7 @@ fn recv_timeout<T: copy send>(iotask: iotask,
 // INTERNAL API
 extern fn delayed_send_cb(handle: *uv::ll::uv_timer_t,
                                 status: libc::c_int) unsafe {
-    log(debug, fmt!{"delayed_send_cb handle %? status %?", handle, status});
+    log(debug, fmt!("delayed_send_cb handle %? status %?", handle, status));
     let timer_done_ch =
         *(uv::ll::get_data_for_uv_handle(handle) as *comm::Chan<()>);
     let stop_result = uv::ll::timer_stop(handle);
@@ -136,7 +136,7 @@ fn recv_timeout<T: copy send>(iotask: iotask,
 }
 
 extern fn delayed_send_close_cb(handle: *uv::ll::uv_timer_t) unsafe {
-    log(debug, fmt!{"delayed_send_close_cb handle %?", handle});
+    log(debug, fmt!("delayed_send_close_cb handle %?", handle));
     let timer_done_ch =
         *(uv::ll::get_data_for_uv_handle(handle) as *comm::Chan<()>);
     comm::send(timer_done_ch, ());
index 669b4f16e1b9d27e90d2f7a035cf01b3b2ac1b96..1c301a78260f9ce80c5026e1045041bb5e2dfb43 100644 (file)
@@ -37,10 +37,10 @@ fn get_monitor_task_gl() -> iotask unsafe {
 
     let monitor_loop_chan_ptr = rustrt::rust_uv_get_kernel_global_chan_ptr();
 
-    debug!{"ENTERING global_loop::get() loop chan: %?",
-           monitor_loop_chan_ptr};
+    debug!("ENTERING global_loop::get() loop chan: %?",
+           monitor_loop_chan_ptr);
 
-    debug!{"before priv::chan_from_global_ptr"};
+    debug!("before priv::chan_from_global_ptr");
     type monchan = Chan<iotask>;
 
     let monitor_ch =
@@ -50,31 +50,31 @@ fn get_monitor_task_gl() -> iotask unsafe {
                                                 (task::SingleThreaded)
                                                 .unlinked()
                                            }) |msg_po| {
-        debug!{"global monitor task starting"};
+        debug!("global monitor task starting");
 
         // As a weak task the runtime will notify us when to exit
         do weaken_task() |weak_exit_po| {
-            debug!{"global monitor task is now weak"};
+            debug!("global monitor task is now weak");
             let hl_loop = spawn_loop();
             loop {
-                debug!{"in outer_loop..."};
+                debug!("in outer_loop...");
                 match select2(weak_exit_po, msg_po) {
                   Left(weak_exit) => {
                     // all normal tasks have ended, tell the
                     // libuv loop to tear_down, then exit
-                    debug!{"weak_exit_po recv'd msg: %?", weak_exit};
+                    debug!("weak_exit_po recv'd msg: %?", weak_exit);
                     iotask::exit(hl_loop);
                     break;
                   }
                   Right(fetch_ch) => {
-                    debug!{"hl_loop req recv'd: %?", fetch_ch};
+                    debug!("hl_loop req recv'd: %?", fetch_ch);
                     fetch_ch.send(hl_loop);
                   }
                 }
             }
-            debug!{"global monitor task is leaving weakend state"};
+            debug!("global monitor task is leaving weakend state");
         };
-        debug!{"global monitor task exiting"};
+        debug!("global monitor task exiting");
     };
 
     // once we have a chan to the monitor loop, we ask it for
@@ -91,14 +91,14 @@ fn spawn_loop() -> iotask unsafe {
             // The I/O loop task also needs to be weak so it doesn't keep
             // the runtime alive
             do weaken_task |weak_exit_po| {
-                debug!{"global libuv task is now weak %?", weak_exit_po};
+                debug!("global libuv task is now weak %?", weak_exit_po);
                 task_body();
 
                 // We don't wait for the exit message on weak_exit_po
                 // because the monitor task will tell the uv loop when to
                 // exit
 
-                debug!{"global libuv task is leaving weakened state"};
+                debug!("global libuv task is leaving weakened state");
             }
         }
     };
@@ -112,8 +112,8 @@ mod test {
             timer_ptr as *libc::c_void) as *comm::Chan<bool>;
         let exit_ch = *exit_ch_ptr;
         core::comm::send(exit_ch, true);
-        log(debug, fmt!{"EXIT_CH_PTR simple_timer_close_cb exit_ch_ptr: %?",
-                       exit_ch_ptr});
+        log(debug, fmt!("EXIT_CH_PTR simple_timer_close_cb exit_ch_ptr: %?",
+                       exit_ch_ptr));
     }
     extern fn simple_timer_cb(timer_ptr: *ll::uv_timer_t,
                              _status: libc::c_int) unsafe {
@@ -133,8 +133,8 @@ fn impl_uv_hl_simple_timer(iotask: iotask) unsafe {
         let exit_po = core::comm::port::<bool>();
         let exit_ch = core::comm::chan(exit_po);
         let exit_ch_ptr = ptr::addr_of(exit_ch);
-        log(debug, fmt!{"EXIT_CH_PTR newly created exit_ch_ptr: %?",
-                       exit_ch_ptr});
+        log(debug, fmt!("EXIT_CH_PTR newly created exit_ch_ptr: %?",
+                       exit_ch_ptr));
         let timer_handle = ll::timer_t();
         let timer_ptr = ptr::addr_of(timer_handle);
         do iotask::interact(iotask) |loop_ptr| {
index f6ccbeb5d0d7b660aad7630fa86f6999cf2e4ec5..2643edc87bdb1326fb698d603ecf3dc4b1056024 100644 (file)
@@ -30,9 +30,9 @@ fn spawn_iotask(-task: task::TaskBuilder) -> iotask {
     do listen |iotask_ch| {
 
         do task.sched_mode(task::SingleThreaded).spawn {
-            debug!{"entering libuv task"};
+            debug!("entering libuv task");
             run_loop(iotask_ch);
-            debug!{"libuv task exiting"};
+            debug!("libuv task exiting");
         };
 
         iotask_ch.recv()
@@ -137,8 +137,8 @@ fn send_msg(iotask: iotask,
 extern fn wake_up_cb(async_handle: *ll::uv_async_t,
                     status: int) unsafe {
 
-    log(debug, fmt!{"wake_up_cb extern.. handle: %? status: %?",
-                     async_handle, status});
+    log(debug, fmt!("wake_up_cb extern.. handle: %? status: %?",
+                     async_handle, status));
 
     let loop_ptr = ll::get_loop_for_uv_handle(async_handle);
     let data = ll::get_data_for_uv_handle(async_handle) as *iotask_loop_data;
@@ -161,22 +161,22 @@ fn begin_teardown(data: *iotask_loop_data) unsafe {
 extern fn tear_down_close_cb(handle: *ll::uv_async_t) unsafe {
     let loop_ptr = ll::get_loop_for_uv_handle(handle);
     let loop_refs = ll::loop_refcount(loop_ptr);
-    log(debug, fmt!{"tear_down_close_cb called, closing handle at %? refs %?",
-                    handle, loop_refs});
+    log(debug, fmt!("tear_down_close_cb called, closing handle at %? refs %?",
+                    handle, loop_refs));
     assert loop_refs == 1i32;
 }
 
 #[cfg(test)]
 mod test {
     extern fn async_close_cb(handle: *ll::uv_async_t) unsafe {
-        log(debug, fmt!{"async_close_cb handle %?", handle});
+        log(debug, fmt!("async_close_cb handle %?", handle));
         let exit_ch = (*(ll::get_data_for_uv_handle(handle)
                         as *ah_data)).exit_ch;
         core::comm::send(exit_ch, ());
     }
     extern fn async_handle_cb(handle: *ll::uv_async_t, status: libc::c_int)
         unsafe {
-        log(debug, fmt!{"async_handle_cb handle %? status %?",handle,status});
+        log(debug, fmt!("async_handle_cb handle %? status %?",handle,status));
         ll::close(handle, async_close_cb);
     }
     type ah_data = {
@@ -214,13 +214,13 @@ unsafe fn spawn_test_loop(exit_ch: comm::Chan<()>) -> iotask {
     }
 
     extern fn lifetime_handle_close(handle: *libc::c_void) unsafe {
-        log(debug, fmt!{"lifetime_handle_close ptr %?", handle});
+        log(debug, fmt!("lifetime_handle_close ptr %?", handle));
     }
 
     extern fn lifetime_async_callback(handle: *libc::c_void,
                                      status: libc::c_int) {
-        log(debug, fmt!{"lifetime_handle_close ptr %? status %?",
-                        handle, status});
+        log(debug, fmt!("lifetime_handle_close ptr %? status %?",
+                        handle, status));
     }
 
     #[test]
index 0737e61a7c1515b11000083f9854848b184bb6bd..79a2856a1c75434394a228ba0288b36e98d2d32c 100644 (file)
@@ -707,8 +707,8 @@ unsafe fn tcp_connect(connect_ptr: *uv_connect_t,
                       addr_ptr: *sockaddr_in,
                       ++after_connect_cb: *u8)
 -> libc::c_int {
-    log(debug, fmt!{"b4 foreign tcp_connect--addr port: %u cb: %u",
-                    (*addr_ptr).sin_port as uint, after_connect_cb as uint});
+    log(debug, fmt!("b4 foreign tcp_connect--addr port: %u cb: %u",
+                    (*addr_ptr).sin_port as uint, after_connect_cb as uint));
     return rustrt::rust_uv_tcp_connect(connect_ptr, tcp_handle_ptr,
                                     after_connect_cb, addr_ptr);
 }
@@ -788,10 +788,10 @@ unsafe fn async_send(async_handle: *uv_async_t) {
 unsafe fn buf_init(++input: *u8, len: uint) -> uv_buf_t {
     let out_buf = { base: ptr::null(), len: 0 as libc::size_t };
     let out_buf_ptr = ptr::addr_of(out_buf);
-    log(debug, fmt!{"buf_init - input %u len %u out_buf: %u",
+    log(debug, fmt!("buf_init - input %u len %u out_buf: %u",
                      input as uint,
                      len as uint,
-                     out_buf_ptr as uint});
+                     out_buf_ptr as uint));
     // yuck :/
     rustrt::rust_uv_buf_init(out_buf_ptr, input, len as size_t);
     //let result = rustrt::rust_uv_buf_init_2(input, len as size_t);
@@ -799,9 +799,9 @@ unsafe fn buf_init(++input: *u8, len: uint) -> uv_buf_t {
     let res_base = get_base_from_buf(out_buf);
     let res_len = get_len_from_buf(out_buf);
     //let res_base = get_base_from_buf(result);
-    log(debug, fmt!{"buf_init - result %u len %u",
+    log(debug, fmt!("buf_init - result %u len %u",
                      res_base as uint,
-                     res_len as uint});
+                     res_len as uint));
     return out_buf;
     //return result;
 }
@@ -845,8 +845,8 @@ unsafe fn ip6_name(src: &sockaddr_in6) -> ~str {
                        0u8,0u8,0u8,0u8,0u8,0u8];
     do vec::as_buf(dst) |dst_buf, size| {
         let src_unsafe_ptr = assimilate(src);
-        log(debug, fmt!{"val of src *sockaddr_in6: %? sockaddr_in6: %?",
-                        src_unsafe_ptr, src});
+        log(debug, fmt!("val of src *sockaddr_in6: %? sockaddr_in6: %?",
+                        src_unsafe_ptr, src));
         let result = rustrt::rust_uv_ip6_name(src_unsafe_ptr,
                                               dst_buf, size as libc::size_t);
         match result {
@@ -962,8 +962,8 @@ unsafe fn get_last_err_info(uv_loop: *libc::c_void) -> ~str {
     let err_ptr = ptr::addr_of(err);
     let err_name = str::unsafe::from_c_str(err_name(err_ptr));
     let err_msg = str::unsafe::from_c_str(strerror(err_ptr));
-    return fmt!{"LIBUV ERROR: name: %s msg: %s",
-                    err_name, err_msg};
+    return fmt!("LIBUV ERROR: name: %s msg: %s",
+                    err_name, err_msg);
 }
 
 unsafe fn get_last_err_data(uv_loop: *libc::c_void) -> uv_err_data {
@@ -1013,8 +1013,8 @@ enum tcp_read_data {
     };
 
     extern fn after_close_cb(handle: *libc::c_void) {
-        log(debug, fmt!{"after uv_close! handle ptr: %?",
-                        handle});
+        log(debug, fmt!("after uv_close! handle ptr: %?",
+                        handle));
     }
 
     extern fn on_alloc_cb(handle: *libc::c_void,
@@ -1022,10 +1022,10 @@ enum tcp_read_data {
         -> uv_buf_t unsafe {
         log(debug, ~"on_alloc_cb!");
         let char_ptr = malloc_buf_base_of(suggested_size);
-        log(debug, fmt!{"on_alloc_cb h: %? char_ptr: %u sugsize: %u",
+        log(debug, fmt!("on_alloc_cb h: %? char_ptr: %u sugsize: %u",
                          handle,
                          char_ptr as uint,
-                         suggested_size as uint});
+                         suggested_size as uint));
         return buf_init(char_ptr, suggested_size as uint);
     }
 
@@ -1033,11 +1033,11 @@ enum tcp_read_data {
                         nread: libc::ssize_t,
                         ++buf: uv_buf_t) unsafe {
         let nread = nread as int;
-        log(debug, fmt!{"CLIENT entering on_read_cb nred: %d",
-                        nread});
+        log(debug, fmt!("CLIENT entering on_read_cb nred: %d",
+                        nread));
         if (nread > 0) {
             // we have data
-            log(debug, fmt!{"CLIENT read: data! nread: %d", nread});
+            log(debug, fmt!("CLIENT read: data! nread: %d", nread));
             read_stop(stream);
             let client_data =
                 get_data_for_uv_handle(stream as *libc::c_void)
@@ -1065,20 +1065,20 @@ enum tcp_read_data {
 
     extern fn on_write_complete_cb(write_req: *uv_write_t,
                                   status: libc::c_int) unsafe {
-        log(debug, fmt!{"CLIENT beginning on_write_complete_cb status: %d",
-                         status as int});
+        log(debug, fmt!("CLIENT beginning on_write_complete_cb status: %d",
+                         status as int));
         let stream = get_stream_handle_from_write_req(write_req);
-        log(debug, fmt!{"CLIENT on_write_complete_cb: tcp:%d write_handle:%d",
-            stream as int, write_req as int});
+        log(debug, fmt!("CLIENT on_write_complete_cb: tcp:%d write_handle:%d",
+            stream as int, write_req as int));
         let result = read_start(stream, on_alloc_cb, on_read_cb);
-        log(debug, fmt!{"CLIENT ending on_write_complete_cb .. status: %d",
-                         result as int});
+        log(debug, fmt!("CLIENT ending on_write_complete_cb .. status: %d",
+                         result as int));
     }
 
     extern fn on_connect_cb(connect_req_ptr: *uv_connect_t,
                                  status: libc::c_int) unsafe {
-        log(debug, fmt!{"beginning on_connect_cb .. status: %d",
-                         status as int});
+        log(debug, fmt!("beginning on_connect_cb .. status: %d",
+                         status as int));
         let stream =
             get_stream_handle_from_connect_req(connect_req_ptr);
         if (status == 0i32) {
@@ -1087,14 +1087,14 @@ enum tcp_read_data {
                 connect_req_ptr as *libc::c_void)
                 as *request_wrapper;
             let write_handle = (*client_data).write_req;
-            log(debug, fmt!{"on_connect_cb: tcp: %d write_hdl: %d",
-                            stream as int, write_handle as int});
+            log(debug, fmt!("on_connect_cb: tcp: %d write_hdl: %d",
+                            stream as int, write_handle as int));
             let write_result = write(write_handle,
                               stream as *libc::c_void,
                               (*client_data).req_buf,
                               on_write_complete_cb);
-            log(debug, fmt!{"on_connect_cb: write() status: %d",
-                             write_result as int});
+            log(debug, fmt!("on_connect_cb: write() status: %d",
+                             write_result as int));
         }
         else {
             let test_loop = get_loop_for_uv_handle(
@@ -1121,7 +1121,7 @@ fn impl_uv_tcp_request(ip: ~str, port: int, req_str: ~str,
         // data field in our uv_connect_t struct
         let req_str_bytes = str::bytes(req_str);
         let req_msg_ptr: *u8 = vec::unsafe::to_ptr(req_str_bytes);
-        log(debug, fmt!{"req_msg ptr: %u", req_msg_ptr as uint});
+        log(debug, fmt!("req_msg ptr: %u", req_msg_ptr as uint));
         let req_msg = ~[
             buf_init(req_msg_ptr, vec::len(req_str_bytes))
         ];
@@ -1129,9 +1129,9 @@ fn impl_uv_tcp_request(ip: ~str, port: int, req_str: ~str,
         // this to C..
         let write_handle = write_t();
         let write_handle_ptr = ptr::addr_of(write_handle);
-        log(debug, fmt!{"tcp req: tcp stream: %d write_handle: %d",
+        log(debug, fmt!("tcp req: tcp stream: %d write_handle: %d",
                          tcp_handle_ptr as int,
-                         write_handle_ptr as int});
+                         write_handle_ptr as int));
         let client_data = { writer_handle: write_handle_ptr,
                     req_buf: ptr::addr_of(req_msg),
                     read_chan: client_chan };
@@ -1145,12 +1145,12 @@ fn impl_uv_tcp_request(ip: ~str, port: int, req_str: ~str,
             let addr = ip4_addr(ip, port);
             // FIXME ref #2064
             let addr_ptr = ptr::addr_of(addr);
-            log(debug, fmt!{"after build addr in rust. port: %u",
-                             addr.sin_port as uint});
+            log(debug, fmt!("after build addr in rust. port: %u",
+                             addr.sin_port as uint));
 
             // this should set up the connection request..
-            log(debug, fmt!{"b4 call tcp_connect connect cb: %u ",
-                            on_connect_cb as uint});
+            log(debug, fmt!("b4 call tcp_connect connect cb: %u ",
+                            on_connect_cb as uint));
             let tcp_connect_result = tcp_connect(
                 connect_req_ptr, tcp_handle_ptr,
                 addr_ptr, on_connect_cb);
@@ -1181,8 +1181,8 @@ fn impl_uv_tcp_request(ip: ~str, port: int, req_str: ~str,
     }
 
     extern fn server_after_close_cb(handle: *libc::c_void) unsafe {
-        log(debug, fmt!{"SERVER server stream closed, should exit.. h: %?",
-                   handle});
+        log(debug, fmt!("SERVER server stream closed, should exit.. h: %?",
+                   handle));
     }
 
     extern fn client_stream_after_close_cb(handle: *libc::c_void)
@@ -1210,15 +1210,15 @@ fn impl_uv_tcp_request(ip: ~str, port: int, req_str: ~str,
         let nread = nread as int;
         if (nread > 0) {
             // we have data
-            log(debug, fmt!{"SERVER read: data! nread: %d", nread});
+            log(debug, fmt!("SERVER read: data! nread: %d", nread));
 
             // pull out the contents of the write from the client
             let buf_base = get_base_from_buf(buf);
             let buf_len = get_len_from_buf(buf) as uint;
-            log(debug, fmt!{"SERVER buf base: %u, len: %u, nread: %d",
+            log(debug, fmt!("SERVER buf base: %u, len: %u, nread: %d",
                             buf_base as uint,
                             buf_len as uint,
-                            nread});
+                            nread));
             let bytes = vec::unsafe::from_buf(buf_base, buf_len);
             let request_str = str::from_bytes(bytes);
 
@@ -1238,8 +1238,8 @@ fn impl_uv_tcp_request(ip: ~str, port: int, req_str: ~str,
                     client_stream_ptr as *libc::c_void,
                     (*client_data).server_resp_buf,
                     after_server_resp_write);
-                log(debug, fmt!{"SERVER: resp write result: %d",
-                            write_result as int});
+                log(debug, fmt!("SERVER: resp write result: %d",
+                            write_result as int));
                 if (write_result != 0i32) {
                     log(debug, ~"bad result for server resp write()");
                     log(debug, get_last_err_info(
@@ -1273,8 +1273,8 @@ fn impl_uv_tcp_request(ip: ~str, port: int, req_str: ~str,
                                server_stream_ptr as *libc::c_void);
         if status != 0i32 {
             let err_msg = get_last_err_info(test_loop);
-            log(debug, fmt!{"server_connect_cb: non-zero status: %?",
-                         err_msg});
+            log(debug, fmt!("server_connect_cb: non-zero status: %?",
+                         err_msg));
             return;
         }
         let server_data = get_data_for_uv_handle(
@@ -1301,20 +1301,20 @@ fn impl_uv_tcp_request(ip: ~str, port: int, req_str: ~str,
                     log(debug, ~"successful server read start");
                 }
                 else {
-                    log(debug, fmt!{"server_connection_cb: bad read:%d",
-                                    read_result as int});
+                    log(debug, fmt!("server_connection_cb: bad read:%d",
+                                    read_result as int));
                     assert false;
                 }
             }
             else {
-                log(debug, fmt!{"server_connection_cb: bad accept: %d",
-                            accept_result as int});
+                log(debug, fmt!("server_connection_cb: bad accept: %d",
+                            accept_result as int));
                 assert false;
             }
         }
         else {
-            log(debug, fmt!{"server_connection_cb: bad client init: %d",
-                        client_init_result as int});
+            log(debug, fmt!("server_connection_cb: bad client init: %d",
+                        client_init_result as int));
             assert false;
         }
     }
@@ -1333,8 +1333,8 @@ fn impl_uv_tcp_request(ip: ~str, port: int, req_str: ~str,
     };
 
     extern fn async_close_cb(handle: *libc::c_void) {
-        log(debug, fmt!{"SERVER: closing async cb... h: %?",
-                   handle});
+        log(debug, fmt!("SERVER: closing async cb... h: %?",
+                   handle));
     }
 
     extern fn continue_async_cb(async_handle: *uv_async_t,
@@ -1369,7 +1369,7 @@ fn impl_uv_tcp_server(server_ip: ~str,
 
         let resp_str_bytes = str::bytes(server_resp_msg);
         let resp_msg_ptr: *u8 = vec::unsafe::to_ptr(resp_str_bytes);
-        log(debug, fmt!{"resp_msg ptr: %u", resp_msg_ptr as uint});
+        log(debug, fmt!("resp_msg ptr: %u", resp_msg_ptr as uint));
         let resp_msg = ~[
             buf_init(resp_msg_ptr, vec::len(resp_str_bytes))
         ];
@@ -1428,26 +1428,26 @@ fn impl_uv_tcp_server(server_ip: ~str,
                         log(debug, ~"server uv::run() has returned");
                     }
                     else {
-                        log(debug, fmt!{"uv_async_init failure: %d",
-                                async_result as int});
+                        log(debug, fmt!("uv_async_init failure: %d",
+                                async_result as int));
                         assert false;
                     }
                 }
                 else {
-                    log(debug, fmt!{"non-zero result on uv_listen: %d",
-                                listen_result as int});
+                    log(debug, fmt!("non-zero result on uv_listen: %d",
+                                listen_result as int));
                     assert false;
                 }
             }
             else {
-                log(debug, fmt!{"non-zero result on uv_tcp_bind: %d",
-                            bind_result as int});
+                log(debug, fmt!("non-zero result on uv_tcp_bind: %d",
+                            bind_result as int));
                 assert false;
             }
         }
         else {
-            log(debug, fmt!{"non-zero result on uv_tcp_init: %d",
-                        tcp_init_result as int});
+            log(debug, fmt!("non-zero result on uv_tcp_init: %d",
+                        tcp_init_result as int));
             assert false;
         }
         loop_delete(test_loop);
@@ -1524,8 +1524,8 @@ fn test_uv_ll_tcp_server_and_request() unsafe {
     fn test_uv_ll_struct_size_uv_tcp_t() {
         let foreign_handle_size = rustrt::rust_uv_helper_uv_tcp_t_size();
         let rust_handle_size = sys::size_of::<uv_tcp_t>();
-        let output = fmt!{"uv_tcp_t -- foreign: %u rust: %u",
-                          foreign_handle_size as uint, rust_handle_size};
+        let output = fmt!("uv_tcp_t -- foreign: %u rust: %u",
+                          foreign_handle_size as uint, rust_handle_size);
         log(debug, output);
         assert foreign_handle_size as uint == rust_handle_size;
     }
@@ -1535,8 +1535,8 @@ fn test_uv_ll_struct_size_uv_connect_t() {
         let foreign_handle_size =
             rustrt::rust_uv_helper_uv_connect_t_size();
         let rust_handle_size = sys::size_of::<uv_connect_t>();
-        let output = fmt!{"uv_connect_t -- foreign: %u rust: %u",
-                          foreign_handle_size as uint, rust_handle_size};
+        let output = fmt!("uv_connect_t -- foreign: %u rust: %u",
+                          foreign_handle_size as uint, rust_handle_size);
         log(debug, output);
         assert foreign_handle_size as uint == rust_handle_size;
     }
@@ -1546,8 +1546,8 @@ fn test_uv_ll_struct_size_uv_buf_t() {
         let foreign_handle_size =
             rustrt::rust_uv_helper_uv_buf_t_size();
         let rust_handle_size = sys::size_of::<uv_buf_t>();
-        let output = fmt!{"uv_buf_t -- foreign: %u rust: %u",
-                          foreign_handle_size as uint, rust_handle_size};
+        let output = fmt!("uv_buf_t -- foreign: %u rust: %u",
+                          foreign_handle_size as uint, rust_handle_size);
         log(debug, output);
         assert foreign_handle_size as uint == rust_handle_size;
     }
@@ -1557,8 +1557,8 @@ fn test_uv_ll_struct_size_uv_write_t() {
         let foreign_handle_size =
             rustrt::rust_uv_helper_uv_write_t_size();
         let rust_handle_size = sys::size_of::<uv_write_t>();
-        let output = fmt!{"uv_write_t -- foreign: %u rust: %u",
-                          foreign_handle_size as uint, rust_handle_size};
+        let output = fmt!("uv_write_t -- foreign: %u rust: %u",
+                          foreign_handle_size as uint, rust_handle_size);
         log(debug, output);
         assert foreign_handle_size as uint == rust_handle_size;
     }
@@ -1569,8 +1569,8 @@ fn test_uv_ll_struct_size_sockaddr_in() {
         let foreign_handle_size =
             rustrt::rust_uv_helper_sockaddr_in_size();
         let rust_handle_size = sys::size_of::<sockaddr_in>();
-        let output = fmt!{"sockaddr_in -- foreign: %u rust: %u",
-                          foreign_handle_size as uint, rust_handle_size};
+        let output = fmt!("sockaddr_in -- foreign: %u rust: %u",
+                          foreign_handle_size as uint, rust_handle_size);
         log(debug, output);
         assert foreign_handle_size as uint == rust_handle_size;
     }
@@ -1580,8 +1580,8 @@ fn test_uv_ll_struct_size_sockaddr_in6() {
         let foreign_handle_size =
             rustrt::rust_uv_helper_sockaddr_in6_size();
         let rust_handle_size = sys::size_of::<sockaddr_in6>();
-        let output = fmt!{"sockaddr_in6 -- foreign: %u rust: %u",
-                          foreign_handle_size as uint, rust_handle_size};
+        let output = fmt!("sockaddr_in6 -- foreign: %u rust: %u",
+                          foreign_handle_size as uint, rust_handle_size);
         log(debug, output);
         // FIXME #1645 .. rust appears to pad structs to the nearest byte..?
         // .. can't get the uv::ll::sockaddr_in6 to == 28 :/
@@ -1595,8 +1595,8 @@ fn test_uv_ll_struct_size_addr_in() {
         let foreign_handle_size =
             rustrt::rust_uv_helper_addr_in_size();
         let rust_handle_size = sys::size_of::<addr_in>();
-        let output = fmt!{"addr_in -- foreign: %u rust: %u",
-                          foreign_handle_size as uint, rust_handle_size};
+        let output = fmt!("addr_in -- foreign: %u rust: %u",
+                          foreign_handle_size as uint, rust_handle_size);
         log(debug, output);
         // FIXME #1645 .. see note above about struct padding
         assert (4u+foreign_handle_size as uint) == rust_handle_size;
@@ -1608,8 +1608,8 @@ fn test_uv_ll_struct_size_uv_async_t() {
         let foreign_handle_size =
             rustrt::rust_uv_helper_uv_async_t_size();
         let rust_handle_size = sys::size_of::<uv_async_t>();
-        let output = fmt!{"uv_async_t -- foreign: %u rust: %u",
-                          foreign_handle_size as uint, rust_handle_size};
+        let output = fmt!("uv_async_t -- foreign: %u rust: %u",
+                          foreign_handle_size as uint, rust_handle_size);
         log(debug, output);
         assert foreign_handle_size as uint == rust_handle_size;
     }
@@ -1620,8 +1620,8 @@ fn test_uv_ll_struct_size_uv_timer_t() {
         let foreign_handle_size =
             rustrt::rust_uv_helper_uv_timer_t_size();
         let rust_handle_size = sys::size_of::<uv_timer_t>();
-        let output = fmt!{"uv_timer_t -- foreign: %u rust: %u",
-                          foreign_handle_size as uint, rust_handle_size};
+        let output = fmt!("uv_timer_t -- foreign: %u rust: %u",
+                          foreign_handle_size as uint, rust_handle_size);
         log(debug, output);
         assert foreign_handle_size as uint == rust_handle_size;
     }
@@ -1633,8 +1633,8 @@ fn test_uv_ll_struct_size_uv_getaddrinfo_t() {
         let foreign_handle_size =
             rustrt::rust_uv_helper_uv_getaddrinfo_t_size();
         let rust_handle_size = sys::size_of::<uv_getaddrinfo_t>();
-        let output = fmt!{"uv_getaddrinfo_t -- foreign: %u rust: %u",
-                          foreign_handle_size as uint, rust_handle_size};
+        let output = fmt!("uv_getaddrinfo_t -- foreign: %u rust: %u",
+                          foreign_handle_size as uint, rust_handle_size);
         log(debug, output);
         assert foreign_handle_size as uint == rust_handle_size;
     }
@@ -1646,8 +1646,8 @@ fn test_uv_ll_struct_size_addrinfo() {
         let foreign_handle_size =
             rustrt::rust_uv_helper_addrinfo_size();
         let rust_handle_size = sys::size_of::<addrinfo>();
-        let output = fmt!{"addrinfo -- foreign: %u rust: %u",
-                          foreign_handle_size as uint, rust_handle_size};
+        let output = fmt!("addrinfo -- foreign: %u rust: %u",
+                          foreign_handle_size as uint, rust_handle_size);
         log(debug, output);
         assert foreign_handle_size as uint == rust_handle_size;
     }
index 9c90a422c53a4cb3b4b71785fc26cb98312c947d..fbcfb3139d18c4642ca1883cd965eff37e622f06 100644 (file)
@@ -25,7 +25,7 @@ fn path_ident_to_str(p: path, i: ident, itr: ident_interner) -> ~str {
         //FIXME /* FIXME (#2543) */ copy *i
         *itr.get(i)
     } else {
-        fmt!{"%s::%s", path_to_str(p, itr), *itr.get(i)}
+        fmt!("%s::%s", path_to_str(p, itr), *itr.get(i))
     }
 }
 
@@ -296,7 +296,7 @@ fn map_stmt(stmt: @stmt, cx: ctx, v: vt) {
 fn node_id_to_str(map: map, id: node_id, itr: ident_interner) -> ~str {
     match map.find(id) {
       none => {
-        fmt!{"unknown node (id=%d)", id}
+        fmt!("unknown node (id=%d)", id)
       }
       some(node_item(item, path)) => {
         let path_str = path_ident_to_str(*path, item.ident, itr);
@@ -315,48 +315,48 @@ fn node_id_to_str(map: map, id: node_id, itr: ident_interner) -> ~str {
         fmt!("%s %s (id=%?)", item_str, path_str, id)
       }
       some(node_foreign_item(item, abi, path)) => {
-        fmt!{"foreign item %s with abi %? (id=%?)",
-             path_ident_to_str(*path, item.ident, itr), abi, id}
+        fmt!("foreign item %s with abi %? (id=%?)",
+             path_ident_to_str(*path, item.ident, itr), abi, id)
       }
       some(node_method(m, impl_did, path)) => {
-        fmt!{"method %s in %s (id=%?)",
-             *itr.get(m.ident), path_to_str(*path, itr), id}
+        fmt!("method %s in %s (id=%?)",
+             *itr.get(m.ident), path_to_str(*path, itr), id)
       }
       some(node_trait_method(tm, impl_did, path)) => {
         let m = ast_util::trait_method_to_ty_method(*tm);
-        fmt!{"method %s in %s (id=%?)",
-             *itr.get(m.ident), path_to_str(*path, itr), id}
+        fmt!("method %s in %s (id=%?)",
+             *itr.get(m.ident), path_to_str(*path, itr), id)
       }
       some(node_variant(variant, def_id, path)) => {
-        fmt!{"variant %s in %s (id=%?)",
-             *itr.get(variant.node.name), path_to_str(*path, itr), id}
+        fmt!("variant %s in %s (id=%?)",
+             *itr.get(variant.node.name), path_to_str(*path, itr), id)
       }
       some(node_expr(expr)) => {
-        fmt!{"expr %s (id=%?)", pprust::expr_to_str(expr, itr), id}
+        fmt!("expr %s (id=%?)", pprust::expr_to_str(expr, itr), id)
       }
       some(node_stmt(stmt)) => {
-        fmt!{"stmt %s (id=%?)",
-             pprust::stmt_to_str(*stmt, itr), id}
+        fmt!("stmt %s (id=%?)",
+             pprust::stmt_to_str(*stmt, itr), id)
       }
       // FIXMEs are as per #2410
       some(node_export(_, path)) => {
-        fmt!{"export %s (id=%?)", // add more info here
-             path_to_str(*path, itr), id}
+        fmt!("export %s (id=%?)", // add more info here
+             path_to_str(*path, itr), id)
       }
       some(node_arg(_, _)) => { // add more info here
-        fmt!{"arg (id=%?)", id}
+        fmt!("arg (id=%?)", id)
       }
       some(node_local(_)) => { // add more info here
-        fmt!{"local (id=%?)", id}
+        fmt!("local (id=%?)", id)
       }
       some(node_ctor(*)) => { // add more info here
-        fmt!{"node_ctor (id=%?)", id}
+        fmt!("node_ctor (id=%?)", id)
       }
       some(node_dtor(*)) => { // add more info here
-        fmt!{"node_dtor (id=%?)", id}
+        fmt!("node_dtor (id=%?)", id)
       }
       some(node_block(_)) => {
-        fmt!{"block"}
+        fmt!("block")
       }
     }
 }
index c339d322af8dc9ea2bccab60c4f83427f4078e38..c1838c7780237f2305933bf920b70fe17f5b5ed9 100644 (file)
@@ -368,7 +368,7 @@ fn require_unique_names(diagnostic: span_handler,
         // FIXME: How do I silence the warnings? --pcw (#2619)
         if map.contains_key(name) {
             diagnostic.span_fatal(meta.span,
-                                  fmt!{"duplicate meta item `%s`", name});
+                                  fmt!("duplicate meta item `%s`", name));
         }
         map.insert(name, ());
     }
index e0e93b1eda58b478c5df00fb6a41aa47845b22dd..bbaaf2deb350a0b08deff5824e45418a76b2b594 100644 (file)
@@ -73,7 +73,7 @@ fn new_filemap(+filename: filename, src: @~str,
 fn mk_substr_filename(cm: codemap, sp: span) -> ~str
 {
     let pos = lookup_char_pos(cm, sp.lo);
-    return fmt!{"<%s:%u:%u>", pos.file.name, pos.line, pos.col};
+    return fmt!("<%s:%u:%u>", pos.file.name, pos.line, pos.col);
 }
 
 fn next_line(file: filemap, chpos: uint, byte_pos: uint) {
@@ -93,7 +93,7 @@ fn lookup_line(map: codemap, pos: uint, lookup: lookup_fn)
         if lookup(map.files[m].start_pos) > pos { b = m; } else { a = m; }
     }
     if (a >= len) {
-        fail fmt!{"position %u does not resolve to a source location", pos}
+        fail fmt!("position %u does not resolve to a source location", pos)
     }
     let f = map.files[a];
     a = 0u;
@@ -166,15 +166,15 @@ enum expn_info_ {
 fn span_to_str_no_adj(sp: span, cm: codemap) -> ~str {
     let lo = lookup_char_pos(cm, sp.lo);
     let hi = lookup_char_pos(cm, sp.hi);
-    return fmt!{"%s:%u:%u: %u:%u", lo.file.name,
-             lo.line, lo.col, hi.line, hi.col}
+    return fmt!("%s:%u:%u: %u:%u", lo.file.name,
+             lo.line, lo.col, hi.line, hi.col)
 }
 
 fn span_to_str(sp: span, cm: codemap) -> ~str {
     let lo = lookup_char_pos_adj(cm, sp.lo);
     let hi = lookup_char_pos_adj(cm, sp.hi);
-    return fmt!{"%s:%u:%u: %u:%u", lo.filename,
-             lo.line, lo.col, hi.line, hi.col}
+    return fmt!("%s:%u:%u: %u:%u", lo.filename,
+             lo.line, lo.col, hi.line, hi.col)
 }
 
 type file_lines = {file: filemap, lines: ~[uint]};
index 38c8131147cdc86d046ddc64e7ea5234deb9afe9..0c622cf7a7c0dea12181230d86909921bf7b5783 100644 (file)
@@ -91,8 +91,8 @@ fn abort_if_errors() {
           0u => return,
           1u => s = ~"aborting due to previous error",
           _  => {
-            s = fmt!{"aborting due to %u previous errors",
-                     self.err_count};
+            s = fmt!("aborting due to %u previous errors",
+                     self.err_count);
           }
         }
         self.fatal(s);
@@ -113,7 +113,7 @@ fn emit(cmsp: option<(codemap::codemap, span)>, msg: ~str, lvl: level) {
 }
 
 fn ice_msg(msg: ~str) -> ~str {
-    fmt!{"internal compiler error: %s", msg}
+    fmt!("internal compiler error: %s", msg)
 }
 
 fn mk_span_handler(handler: handler, cm: codemap::codemap) -> span_handler {
@@ -168,16 +168,16 @@ fn print_diagnostic(topic: ~str, lvl: level, msg: ~str) {
     let use_color = term::color_supported() &&
         io::stderr().get_type() == io::Screen;
     if str::is_not_empty(topic) {
-        io::stderr().write_str(fmt!{"%s ", topic});
+        io::stderr().write_str(fmt!("%s ", topic));
     }
     if use_color {
         term::fg(io::stderr(), diagnosticcolor(lvl));
     }
-    io::stderr().write_str(fmt!{"%s:", diagnosticstr(lvl)});
+    io::stderr().write_str(fmt!("%s:", diagnosticstr(lvl)));
     if use_color {
         term::reset(io::stderr());
     }
-    io::stderr().write_str(fmt!{" %s\n", msg});
+    io::stderr().write_str(fmt!(" %s\n", msg));
 }
 
 fn emit(cmsp: option<(codemap::codemap, span)>,
@@ -212,13 +212,13 @@ fn highlight_lines(cm: codemap::codemap, sp: span,
     }
     // Print the offending lines
     for display_lines.each |line| {
-        io::stderr().write_str(fmt!{"%s:%u ", fm.name, line + 1u});
+        io::stderr().write_str(fmt!("%s:%u ", fm.name, line + 1u));
         let s = codemap::get_line(fm, line as int) + ~"\n";
         io::stderr().write_str(s);
     }
     if elided {
         let last_line = display_lines[vec::len(display_lines) - 1u];
-        let s = fmt!{"%s:%u ", fm.name, last_line + 1u};
+        let s = fmt!("%s:%u ", fm.name, last_line + 1u);
         let mut indent = str::len(s);
         let mut out = ~"";
         while indent > 0u { out += ~" "; indent -= 1u; }
@@ -257,7 +257,7 @@ fn print_macro_backtrace(cm: codemap::codemap, sp: span) {
         let ss = option::map_default(ei.callie.span, @~"",
                                      |span| @codemap::span_to_str(span, cm));
         print_diagnostic(*ss, note,
-                         fmt!{"in expansion of #%s", ei.callie.name});
+                         fmt!("in expansion of #%s", ei.callie.name));
         let ss = codemap::span_to_str(ei.call_site, cm);
         print_diagnostic(ss, note, ~"expansion site");
         print_macro_backtrace(cm, ei.call_site);
index e5b65b41fc83d7c89380def3c58b3f4bbe7012be..d094bfe6f01913eb8dae6ddd7f70d1df04136c65 100644 (file)
@@ -356,7 +356,7 @@ fn ser_variant(cx: ext_ctxt,
                argfn: fn(-@ast::expr, uint, ast::blk) -> @ast::expr)
     -> ast::arm {
     let vnames = do vec::from_fn(vec::len(tys)) |i| {
-        cx.parse_sess().interner.intern(@fmt!{"__v%u", i})
+        cx.parse_sess().interner.intern(@fmt!("__v%u", i))
     };
     let pats = do vec::from_fn(vec::len(tys)) |i| {
         cx.binder_pat(tys[i].span, vnames[i])
@@ -406,7 +406,7 @@ fn ser_ty(cx: ext_ctxt, tps: ser_tps_map,
 
       ast::ty_bot => {
         cx.span_err(
-            ty.span, fmt!{"Cannot serialize bottom type"});
+            ty.span, fmt!("Cannot serialize bottom type"));
         ~[]
       }
 
@@ -553,7 +553,7 @@ fn mk_ser_fn(cx: ext_ctxt, span: span, name: ast::ident,
              ident: cx.ident_of(~"__s" + cx.str_of(tp.ident)),
              id: cx.next_id()});
 
-    debug!{"tp_inputs = %?", tp_inputs};
+    debug!("tp_inputs = %?", tp_inputs);
 
 
     let ser_inputs: ~[ast::arg] =
@@ -574,7 +574,7 @@ fn mk_ser_fn(cx: ext_ctxt, span: span, name: ast::ident,
             tp.ident,
             fn@(v: @ast::expr) -> ~[@ast::stmt] {
                 let f = cx.var_ref(span, arg_ident);
-                debug!{"serializing type arg %s", cx.str_of(arg_ident)};
+                debug!("serializing type arg %s", cx.str_of(arg_ident));
                 ~[#ast[stmt]{$(f)($(v));}]
             });
     }
@@ -765,7 +765,7 @@ fn mk_deser_fn(cx: ext_ctxt, span: span,
              ident: cx.ident_of(~"__d" + cx.str_of(tp.ident)),
              id: cx.next_id()});
 
-    debug!{"tp_inputs = %?", tp_inputs};
+    debug!("tp_inputs = %?", tp_inputs);
 
     let deser_inputs: ~[ast::arg] =
         vec::append(~[{mode: ast::expl(ast::by_ref),
index bb8a845d731a0f75447b2923fafb7bfd19eb60f4..b16a8f11427ae1da76663ceb172bd1033630c1b7 100644 (file)
@@ -267,21 +267,21 @@ fn get_mac_args(cx: ext_ctxt, sp: span, arg: ast::mac_arg,
               match max {
                 some(max) if ! (min <= elts_len && elts_len <= max) => {
                   cx.span_fatal(sp,
-                                fmt!{"#%s takes between %u and %u arguments.",
-                                     name, min, max});
+                                fmt!("#%s takes between %u and %u arguments.",
+                                     name, min, max));
                 }
                 none if ! (min <= elts_len) => {
-                  cx.span_fatal(sp, fmt!{"#%s needs at least %u arguments.",
-                                         name, min});
+                  cx.span_fatal(sp, fmt!("#%s needs at least %u arguments.",
+                                         name, min));
                 }
                 _ => return elts /* we are good */
               }
           }
         _ => {
-            cx.span_fatal(sp, fmt!{"#%s: malformed invocation", name})
+            cx.span_fatal(sp, fmt!("#%s: malformed invocation", name))
         }
       },
-      none => cx.span_fatal(sp, fmt!{"#%s: missing arguments", name})
+      none => cx.span_fatal(sp, fmt!("#%s: missing arguments", name))
     }
 }
 
index fb083744321172bf6d94d1d9ec4f0c2a8a7381d3..0b6c2ea5a9912af6ae2c7cb157a99588470e358e 100644 (file)
@@ -31,12 +31,12 @@ fn expand_expr(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt,
                 match exts.find(*extname) {
                   none => {
                     cx.span_fatal(pth.span,
-                                  fmt!{"macro undefined: '%s'", *extname})
+                                  fmt!("macro undefined: '%s'", *extname))
                   }
                   some(item_decorator(_)) => {
                     cx.span_fatal(
                         pth.span,
-                        fmt!{"%s can only be used as a decorator", *extname});
+                        fmt!("%s can only be used as a decorator", *extname));
                   }
                   some(normal({expander: exp, span: exp_sp})) => {
                     let expanded = exp(cx, mac.span, args, body);
@@ -56,8 +56,8 @@ fn expand_expr(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt,
                   }
                   some(expr_tt(_)) => {
                     cx.span_fatal(pth.span,
-                                  fmt!{"this tt-style macro should be \
-                                        invoked '%s!{...}'", *extname})
+                                  fmt!("this tt-style macro should be \
+                                        invoked '%s!(...)'", *extname))
                   }
                   some(item_tt(*)) => {
                     cx.span_fatal(pth.span,
@@ -76,14 +76,14 @@ fn expand_expr(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt,
                 match exts.find(*extname) {
                   none => {
                     cx.span_fatal(pth.span,
-                                  fmt!{"macro undefined: '%s'", *extname})
+                                  fmt!("macro undefined: '%s'", *extname))
                   }
                   some(expr_tt({expander: exp, span: exp_sp})) => {
                     let expanded = match exp(cx, mac.span, tts) {
                       mr_expr(e) => e,
                       _ => cx.span_fatal(
-                          pth.span, fmt!{"non-expr macro in expr pos: %s",
-                                         *extname})
+                          pth.span, fmt!("non-expr macro in expr pos: %s",
+                                         *extname))
                     };
 
                     cx.bt_push(expanded_from({call_site: s,
@@ -110,8 +110,8 @@ fn expand_expr(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt,
                   }
                   _ => {
                     cx.span_fatal(pth.span,
-                                  fmt!{"'%s' is not a tt-style macro",
-                                       *extname})
+                                  fmt!("'%s' is not a tt-style macro",
+                                       *extname))
                   }
 
                 }
@@ -202,7 +202,7 @@ fn expand_item_mac(exts: hashmap<~str, syntax_extension>,
         match exts.find(*extname) {
           none => {
             cx.span_fatal(pth.span,
-                          fmt!{"macro undefined: '%s'", *extname})
+                          fmt!("macro undefined: '%s'", *extname))
           }
           some(item_tt(expand)) => {
             let expanded = expand.expander(cx, it.span, it.ident, tts);
@@ -223,7 +223,7 @@ fn expand_item_mac(exts: hashmap<~str, syntax_extension>,
             return maybe_it
           }
           _ => cx.span_fatal(it.span,
-                            fmt!{"%s is not a legal here", *extname})
+                            fmt!("%s is not a legal here", *extname))
         }
       }
       _ => cx.span_bug(it.span, ~"invalid item macro invocation")
index 9392ea5ad3c01e994a50f50fb03a5c9cc1fd4bbe..6e459a551fe2c7ec5ebffc92b9886ea4ed91dad6 100644 (file)
@@ -18,7 +18,7 @@ fn expand_syntax_ext(cx: ext_ctxt, sp: span, arg: ast::mac_arg,
         expr_to_str(cx, args[0],
                     ~"first argument to #fmt must be a string literal.");
     let fmtspan = args[0].span;
-    debug!{"Format string:"};
+    debug!("Format string:");
     log(debug, fmt);
     fn parse_fmt_err_(cx: ext_ctxt, sp: span, msg: ~str) -> ! {
         cx.span_fatal(sp, msg);
@@ -193,15 +193,15 @@ fn is_signed_type(cnv: conv) -> bool {
     fn log_conv(c: conv) {
         match c.param {
           some(p) => { log(debug, ~"param: " + int::to_str(p, 10u)); }
-          _ => debug!{"param: none"}
+          _ => debug!("param: none")
         }
         for c.flags.each |f| {
             match f {
-              flag_left_justify => debug!{"flag: left justify"},
-              flag_left_zero_pad => debug!{"flag: left zero pad"},
-              flag_space_for_sign => debug!{"flag: left space pad"},
-              flag_sign_always => debug!{"flag: sign always"},
-              flag_alternate => debug!{"flag: alternate"}
+              flag_left_justify => debug!("flag: left justify"),
+              flag_left_zero_pad => debug!("flag: left zero pad"),
+              flag_space_for_sign => debug!("flag: left space pad"),
+              flag_sign_always => debug!("flag: sign always"),
+              flag_alternate => debug!("flag: alternate")
             }
         }
         match c.width {
@@ -209,33 +209,33 @@ fn log_conv(c: conv) {
               debug, ~"width: count is " + int::to_str(i, 10u)),
           count_is_param(i) => log(
               debug, ~"width: count is param " + int::to_str(i, 10u)),
-          count_is_next_param => debug!{"width: count is next param"},
-          count_implied => debug!{"width: count is implied"}
+          count_is_next_param => debug!("width: count is next param"),
+          count_implied => debug!("width: count is implied")
         }
         match c.precision {
           count_is(i) => log(
               debug, ~"prec: count is " + int::to_str(i, 10u)),
           count_is_param(i) => log(
               debug, ~"prec: count is param " + int::to_str(i, 10u)),
-          count_is_next_param => debug!{"prec: count is next param"},
-          count_implied => debug!{"prec: count is implied"}
+          count_is_next_param => debug!("prec: count is next param"),
+          count_implied => debug!("prec: count is implied")
         }
         match c.ty {
-          ty_bool => debug!{"type: bool"},
-          ty_str => debug!{"type: str"},
-          ty_char => debug!{"type: char"},
+          ty_bool => debug!("type: bool"),
+          ty_str => debug!("type: str"),
+          ty_char => debug!("type: char"),
           ty_int(s) => match s {
-            signed => debug!{"type: signed"},
-            unsigned => debug!{"type: unsigned"}
+            signed => debug!("type: signed"),
+            unsigned => debug!("type: unsigned")
           },
-          ty_bits => debug!{"type: bits"},
+          ty_bits => debug!("type: bits"),
           ty_hex(cs) => match cs {
-            case_upper => debug!{"type: uhex"},
-            case_lower => debug!{"type: lhex"},
+            case_upper => debug!("type: uhex"),
+            case_lower => debug!("type: lhex"),
           },
-          ty_octal => debug!{"type: octal"},
-          ty_float => debug!{"type: float"},
-          ty_poly => debug!{"type: poly"}
+          ty_octal => debug!("type: octal"),
+          ty_float => debug!("type: float"),
+          ty_poly => debug!("type: poly")
         }
     }
     let fmt_sp = args[0].span;
@@ -254,7 +254,7 @@ fn log_conv(c: conv) {
                               ~"not enough arguments to #fmt " +
                                   ~"for the given format string");
             }
-            debug!{"Building conversion:"};
+            debug!("Building conversion:");
             log_conv(conv);
             let arg_expr = args[n];
             let c_expr = make_new_conv(cx, fmt_sp, conv, arg_expr);
@@ -266,8 +266,8 @@ fn log_conv(c: conv) {
 
     if expected_nargs < nargs {
         cx.span_fatal
-            (sp, fmt!{"too many arguments to #fmt. found %u, expected %u",
-                           nargs, expected_nargs});
+            (sp, fmt!("too many arguments to #fmt. found %u, expected %u",
+                           nargs, expected_nargs));
     }
 
     let arg_vec = mk_fixed_vec_e(cx, fmt_sp, piece_exprs);
index b7ad5c21bd93940ed57024700f66dab3cfe06054..60d1d666a7fdc490e16c86dd8eee8e947d8c8677 100644 (file)
@@ -32,9 +32,9 @@ fn visit_state(state: state, _m: &[()]) {
         if state.messages.len() == 0 {
             self.span_warn(
                 state.span, // use a real span!
-                fmt!{"state %s contains no messages, \
+                fmt!("state %s contains no messages, \
                       consider stepping to a terminal state instead",
-                      state.name})
+                      state.name))
         }
     }
 
@@ -48,8 +48,8 @@ fn visit_message(name: ~str, _span: span, _tys: &[@ast::ty],
                 // track span information.
                 self.span_err(
                     proto.get_state(next).span,
-                    fmt!{"message %s steps to undefined state, %s",
-                         name, next});
+                    fmt!("message %s steps to undefined state, %s",
+                         name, next));
             }
             else {
                 let next = proto.get_state(next);
@@ -57,11 +57,11 @@ fn visit_message(name: ~str, _span: span, _tys: &[@ast::ty],
                 if next.ty_params.len() != next_tys.len() {
                     self.span_err(
                         next.span, // use a real span
-                        fmt!{"message %s target (%s) \
+                        fmt!("message %s target (%s) \
                               needs %u type parameters, but got %u",
                              name, next.name,
                              next.ty_params.len(),
-                             next_tys.len()});
+                             next_tys.len()));
                 }
             }
           }
index 2325e4ed27d58e14ad740235be97a819b19bfe6e..a3dfdb6a76960b8b1a6cb1f63622ee570c9da4bc 100644 (file)
@@ -32,7 +32,7 @@
 import ast_builder::empty_span;
 
 fn analyze(proto: protocol, _cx: ext_ctxt) {
-    debug!{"initializing colive analysis"};
+    debug!("initializing colive analysis");
     let num_states = proto.num_states();
     let colive = do (copy proto.states).map_to_vec |state| {
         let bv = ~bitv(num_states, false);
@@ -46,7 +46,7 @@ fn analyze(proto: protocol, _cx: ext_ctxt) {
     let mut changed = true;
     while changed {
         changed = false;
-        debug!{"colive iteration %?", i};
+        debug!("colive iteration %?", i);
         for colive.eachi |i, this_colive| {
             let this = proto.get_state_by_id(i);
             for this_colive.ones |j| {
@@ -59,7 +59,7 @@ fn analyze(proto: protocol, _cx: ext_ctxt) {
         i += 1;
     }
 
-    debug!{"colive analysis complete"};
+    debug!("colive analysis complete");
 
     // Determine if we're bounded
     let mut self_live = ~[];
@@ -72,20 +72,20 @@ fn analyze(proto: protocol, _cx: ext_ctxt) {
     if self_live.len() > 0 {
         let states = str::connect(self_live.map(|s| s.name), ~" ");
 
-        debug!{"protocol %s is unbounded due to loops involving: %s",
-               proto.name, states};
+        debug!("protocol %s is unbounded due to loops involving: %s",
+               proto.name, states);
 
         // Someday this will be configurable with a warning
         //cx.span_warn(empty_span(),
-        //              fmt!{"protocol %s is unbounded due to loops \
+        //              fmt!("protocol %s is unbounded due to loops \
         //                    involving these states: %s",
         //                   *proto.name,
-        //                   states});
+        //                   states));
 
         proto.bounded = some(false);
     }
     else {
-        debug!{"protocol %s is bounded. yay!", proto.name};
+        debug!("protocol %s is bounded. yay!", proto.name);
         proto.bounded = some(true);
     }
 }
\ No newline at end of file
index b5a1ae588a72cb1be9be3387779b092b7396ee3e..315d02eadd38003521373fdf42ef309bfdfbfbc1 100644 (file)
@@ -39,7 +39,7 @@ trait gen_init {
 
 impl message: gen_send {
     fn gen_send(cx: ext_ctxt, try: bool) -> @ast::item {
-        debug!{"pipec: gen_send"};
+        debug!("pipec: gen_send");
         match self {
           message(id, span, tys, this,
                   some({state: next, tys: next_tys})) => {
@@ -75,9 +75,9 @@ fn gen_send(cx: ext_ctxt, try: bool) -> @ast::item {
                 body += fmt!("let %s = pipes::send_packet_buffered(\
                               ptr::addr_of(b.buffer.data.%s));\n",
                              sp, next.name);
-                body += fmt!{"let %s = pipes::recv_packet_buffered(\
+                body += fmt!("let %s = pipes::recv_packet_buffered(\
                               ptr::addr_of(b.buffer.data.%s));\n",
-                             rp, next.name};
+                             rp, next.name);
             }
             else {
                 let pat = match (this.dir, next.dir) {
@@ -97,7 +97,7 @@ fn gen_send(cx: ext_ctxt, try: bool) -> @ast::item {
                                       ~", "));
 
             if !try {
-                body += fmt!{"pipes::send(pipe, message);\n"};
+                body += fmt!("pipes::send(pipe, message);\n");
                 // return the new channel
                 body += ~"c }";
             }
@@ -127,7 +127,7 @@ fn gen_send(cx: ext_ctxt, try: bool) -> @ast::item {
           }
 
             message(id, span, tys, this, none) => {
-                debug!{"pipec: no next state"};
+                debug!("pipec: no next state");
                 let arg_names = tys.mapi(|i, _ty| (~"x_" + i.to_str()));
 
                 let args_ast = (arg_names, tys).map(
@@ -150,13 +150,13 @@ fn gen_send(cx: ext_ctxt, try: bool) -> @ast::item {
                 };
 
                 let mut body = ~"{ ";
-                body += fmt!{"let message = %s::%s%s;\n",
+                body += fmt!("let message = %s::%s%s;\n",
                              this.proto.name,
                              self.name(),
-                             message_args};
+                             message_args);
 
                 if !try {
-                    body += fmt!{"pipes::send(pipe, message);\n"};
+                    body += fmt!("pipes::send(pipe, message);\n");
                     body += ~" }";
                 } else {
                     body += fmt!("if pipes::send(pipe, message) { \
@@ -192,7 +192,7 @@ fn to_ty(cx: ext_ctxt) -> @ast::ty {
 
 impl state: to_type_decls {
     fn to_type_decls(cx: ext_ctxt) -> ~[@ast::item] {
-        debug!{"pipec: to_type_decls"};
+        debug!("pipec: to_type_decls");
         // This compiles into two different type declarations. Say the
         // state is called ping. This will generate both `ping` and
         // `ping_message`. The first contains data that the user cares
@@ -238,7 +238,7 @@ fn to_type_decls(cx: ext_ctxt) -> ~[@ast::item] {
     }
 
     fn to_endpoint_decls(cx: ext_ctxt, dir: direction) -> ~[@ast::item] {
-        debug!{"pipec: to_endpoint_decls"};
+        debug!("pipec: to_endpoint_decls");
         let dir = match dir {
           send => (*self).dir,
           recv => (*self).dir.reverse()
@@ -293,7 +293,7 @@ impl protocol: gen_init {
     fn gen_init(cx: ext_ctxt) -> @ast::item {
         let ext_cx = cx;
 
-        debug!{"gen_init"};
+        debug!("gen_init");
         let start_state = self.states[0];
 
         let body = if !self.is_bounded() {
@@ -320,12 +320,12 @@ fn gen_init(cx: ext_ctxt) -> @ast::item {
             }
         };
 
-        cx.parse_item(fmt!{"fn init%s() -> (client::%s, server::%s)\
+        cx.parse_item(fmt!("fn init%s() -> (client::%s, server::%s)\
                             { import pipes::has_buffer; %s }",
                            start_state.ty_params.to_source(cx),
                            start_state.to_ty(cx).to_source(cx),
                            start_state.to_ty(cx).to_source(cx),
-                           body.to_source(cx)})
+                           body.to_source(cx)))
     }
 
     fn gen_buffer_init(ext_cx: ext_ctxt) -> @ast::expr {
@@ -337,7 +337,7 @@ fn gen_buffer_init(ext_cx: ext_ctxt) -> @ast::expr {
     }
 
     fn gen_init_bounded(ext_cx: ext_ctxt) -> @ast::expr {
-        debug!{"gen_init_bounded"};
+        debug!("gen_init_bounded");
         let buffer_fields = self.gen_buffer_init(ext_cx);
 
         let buffer = #ast {
@@ -349,11 +349,11 @@ fn gen_init_bounded(ext_cx: ext_ctxt) -> @ast::expr {
             ext_cx.block(
                 self.states.map_to_vec(
                     |s| ext_cx.parse_stmt(
-                        fmt!{"data.%s.set_buffer(buffer)",
-                             s.name})),
+                        fmt!("data.%s.set_buffer(buffer)",
+                             s.name))),
                 ext_cx.parse_expr(
-                    fmt!{"ptr::addr_of(data.%s)",
-                         self.states[0].name})));
+                    fmt!("ptr::addr_of(data.%s)",
+                         self.states[0].name))));
 
         #ast {{
             let buffer = $(buffer);
@@ -490,7 +490,7 @@ fn parse_item(s: ~str) -> @ast::item {
         match res {
           some(ast) => ast,
           none => {
-            error!{"Parse error with ```\n%s\n```", s};
+            error!("Parse error with ```\n%s\n```", s);
             fail
           }
         }
index 62c5329525fecb68f07abe400511c2d51d5d3624..eea4e434956ad4f346815aba3484846f91f71eb9 100644 (file)
@@ -152,9 +152,9 @@ fn is_bounded() -> bool {
         let bounded = self.bounded.get();
         bounded
         //if bounded && self.has_ty_params() {
-        //    debug!{"protocol %s has is bounded, but type parameters\
+        //    debug!("protocol %s has is bounded, but type parameters\
         //            are not yet supported.",
-        //           *self.name};
+        //           *self.name);
         //    false
         //}
         //else { bounded }
index 8024f5f9542d092fa2a6a8e5be77b3462b4dd6d5..de4d1975e24a60eaf6bc78aacb6d382214c3712c 100644 (file)
@@ -205,7 +205,7 @@ fn finish<T: qq_helper>
 {
     let cm = ecx.codemap();
     let str = @codemap::span_to_snippet(body.span, cm);
-    debug!{"qquote--str==%?", str};
+    debug!("qquote--str==%?", str);
     let fname = codemap::mk_substr_filename(cm, body.span);
     let node = parse_from_source_str
         (f, fname, codemap::fss_internal(body.span), str,
@@ -231,7 +231,7 @@ fn finish<T: qq_helper>
     do str::chars_iter(*str) |ch| {
         if (j < g_len && i == cx.gather[j].lo) {
             assert ch == '$';
-            let repl = fmt!{"$%u ", j};
+            let repl = fmt!("$%u ", j);
             state = skip(str::char_len(repl));
             str2 += repl;
         }
index 5b9bac1948f091c42c8b8f9bd22e208598be0cff..7c37312a4333a28adc260431ac454844256d50ce 100644 (file)
@@ -255,9 +255,9 @@ fn mark_ident(&&i: ident, _fld: ast_fold, b: bindings,
 
 fn wrong_occurs(cx: ext_ctxt, l: ident, l_c: uint, r: ident, r_c: uint)
     -> ~str {
-    fmt!{"'%s' occurs %u times, but '%s' occurs %u times",
+    fmt!("'%s' occurs %u times, but '%s' occurs %u times",
          *cx.parse_sess().interner.get(l), l_c,
-         *cx.parse_sess().interner.get(r), r_c}
+         *cx.parse_sess().interner.get(r), r_c)
 }
 
 /* handle sequences (anywhere in the AST) of exprs, either real or ...ed */
index c323f201b8323d6b4f6d0e4afb84f5f41217c790..b74a1165b793a4512c99578d9b80e7ca2c7e0cd8 100644 (file)
@@ -13,7 +13,7 @@
 export expand_include_str;
 export expand_include_bin;
 
-/* line!{}: expands to the current line number */
+/* line!(): expands to the current line number */
 fn expand_line(cx: ext_ctxt, sp: span, arg: ast::mac_arg,
                _body: ast::mac_body) -> @ast::expr {
     get_mac_args(cx, sp, arg, 0u, option::some(0u), ~"line");
@@ -21,7 +21,7 @@ fn expand_line(cx: ext_ctxt, sp: span, arg: ast::mac_arg,
     return mk_uint(cx, sp, loc.line);
 }
 
-/* col!{}: expands to the current column number */
+/* col!(): expands to the current column number */
 fn expand_col(cx: ext_ctxt, sp: span, arg: ast::mac_arg,
               _body: ast::mac_body) -> @ast::expr {
     get_mac_args(cx, sp, arg, 0u, option::some(0u), ~"col");
@@ -29,7 +29,7 @@ fn expand_col(cx: ext_ctxt, sp: span, arg: ast::mac_arg,
     return mk_uint(cx, sp, loc.col);
 }
 
-/* file!{}: expands to the current filename */
+/* file!(): expands to the current filename */
 /* The filemap (`loc.file`) contains a bunch more information we could spit
  * out if we wanted. */
 fn expand_file(cx: ext_ctxt, sp: span, arg: ast::mac_arg,
index 896b6f6e54fc6a2f39a852fe5215ae6f75b7f2e6..c9a6928a72dc53747bd64a737f1b17abc889a45a 100644 (file)
@@ -274,15 +274,15 @@ fn parse(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader, ms: ~[matcher])
                 let nts = str::connect(vec::map(bb_eis, |ei| {
                     match ei.elts[ei.idx].node {
                       match_nonterminal(bind,name,_) => {
-                        fmt!{"%s ('%s')", *sess.interner.get(name),
-                             *sess.interner.get(bind)}
+                        fmt!("%s ('%s')", *sess.interner.get(name),
+                             *sess.interner.get(bind))
                       }
                       _ => fail
                     } }), ~" or ");
-                return error(sp, fmt!{
+                return error(sp, fmt!(
                     "Local ambiguity: multiple parsing options: \
                      built-in NTs %s or %u other options.",
-                    nts, next_eis.len()});
+                    nts, next_eis.len()));
             } else if (bb_eis.len() == 0u && next_eis.len() == 0u) {
                 return failure(sp, ~"No rules expected the token "
                             + to_str(rdr.interner(), tok));
index 1653c57bf2cf36c99438cc16fd2a532b52826dad..981e483f13df319f1d80d6f70c9dd693d82787fb 100644 (file)
@@ -112,9 +112,9 @@ fn lis_merge(lhs: lis, rhs: lis, r: tt_reader) -> lis {
             lis_constraint(r_len, r_id) => {
                 let l_n = *r.interner.get(l_id);
                 let r_n = *r.interner.get(r_id);
-                lis_contradiction(fmt!{"Inconsistent lockstep iteration: \
+                lis_contradiction(fmt!("Inconsistent lockstep iteration: \
                                        '%s' has %u items, but '%s' has %u",
-                                        l_n, l_len, r_n, r_len})
+                                        l_n, l_len, r_n, r_len))
             }
           }
         }
@@ -231,8 +231,8 @@ fn tt_next_token(&&r: tt_reader) -> {tok: token, sp: span} {
               matched_seq(*) => {
                 r.sp_diag.span_fatal(
                     copy r.cur_span, /* blame the macro writer */
-                    fmt!{"variable '%s' is still repeating at this depth",
-                         *r.interner.get(ident)});
+                    fmt!("variable '%s' is still repeating at this depth",
+                         *r.interner.get(ident)));
               }
             }
           }
index 09edbda4335d5af1c8cfda901d95f67d4548ec8c..b80e472c04747d47958aee61d0fdeb6f6b67aaf2 100644 (file)
@@ -118,7 +118,7 @@ fn consume_non_eol_whitespace(rdr: string_reader) {
 }
 
 fn push_blank_line_comment(rdr: string_reader, &comments: ~[cmnt]) {
-    debug!{">>> blank-line comment"};
+    debug!(">>> blank-line comment");
     let v: ~[~str] = ~[];
     vec::push(comments, {style: blank_line, lines: v, pos: rdr.chpos});
 }
@@ -136,9 +136,9 @@ fn consume_whitespace_counting_blank_lines(rdr: string_reader,
 
 fn read_shebang_comment(rdr: string_reader, code_to_the_left: bool,
                                                         &comments: ~[cmnt]) {
-    debug!{">>> shebang comment"};
+    debug!(">>> shebang comment");
     let p = rdr.chpos;
-    debug!{"<<< shebang comment"};
+    debug!("<<< shebang comment");
     vec::push(comments, {
         style: if code_to_the_left { trailing } else { isolated },
         lines: ~[read_one_line_comment(rdr)],
@@ -148,7 +148,7 @@ fn read_shebang_comment(rdr: string_reader, code_to_the_left: bool,
 
 fn read_line_comments(rdr: string_reader, code_to_the_left: bool,
                                                         &comments: ~[cmnt]) {
-    debug!{">>> line comments"};
+    debug!(">>> line comments");
     let p = rdr.chpos;
     let mut lines: ~[~str] = ~[];
     while rdr.curr == '/' && nextch(rdr) == '/' {
@@ -160,7 +160,7 @@ fn read_line_comments(rdr: string_reader, code_to_the_left: bool,
         vec::push(lines, line);
         consume_non_eol_whitespace(rdr);
     }
-    debug!{"<<< line comments"};
+    debug!("<<< line comments");
     if !lines.is_empty() {
         vec::push(comments, {
             style: if code_to_the_left { trailing } else { isolated },
@@ -193,7 +193,7 @@ fn trim_whitespace_prefix_and_push_line(&lines: ~[~str],
 
 fn read_block_comment(rdr: string_reader, code_to_the_left: bool,
                                                         &comments: ~[cmnt]) {
-    debug!{">>> block comment"};
+    debug!(">>> block comment");
     let p = rdr.chpos;
     let mut lines: ~[~str] = ~[];
     let mut col: uint = rdr.col;
@@ -215,7 +215,7 @@ fn read_block_comment(rdr: string_reader, code_to_the_left: bool,
     let mut curr_line = ~"/*";
     let mut level: int = 1;
     while level > 0 {
-        debug!{"=== block comment level %d", level};
+        debug!("=== block comment level %d", level);
         if is_eof(rdr) {(rdr as reader).fatal(~"unterminated block comment");}
         if rdr.curr == '\n' {
             trim_whitespace_prefix_and_push_line(lines, curr_line, col);
@@ -246,7 +246,7 @@ fn read_block_comment(rdr: string_reader, code_to_the_left: bool,
     if !is_eof(rdr) && rdr.curr != '\n' && vec::len(lines) == 1u {
         style = mixed;
     }
-    debug!{"<<< block comment"};
+    debug!("<<< block comment");
     vec::push(comments, {style: style, lines: lines, pos: p});
 }
 
@@ -258,7 +258,7 @@ fn peeking_at_comment(rdr: string_reader) -> bool {
 
 fn consume_comment(rdr: string_reader, code_to_the_left: bool,
                    &comments: ~[cmnt]) {
-    debug!{">>> consume comment"};
+    debug!(">>> consume comment");
     if rdr.curr == '/' && nextch(rdr) == '/' {
         read_line_comments(rdr, code_to_the_left, comments);
     } else if rdr.curr == '/' && nextch(rdr) == '*' {
@@ -266,7 +266,7 @@ fn consume_comment(rdr: string_reader, code_to_the_left: bool,
     } else if rdr.curr == '#' && nextch(rdr) == '!' {
         read_shebang_comment(rdr, code_to_the_left, comments);
     } else { fail; }
-    debug!{"<<< consume comment"};
+    debug!("<<< consume comment");
 }
 
 type lit = {lit: ~str, pos: uint};
index 1d260268d3f6b1364a19136d5060c65962f38378..afb9c91fc8d845ba960f7252855b617314538d41 100644 (file)
@@ -115,7 +115,7 @@ fn eat(tok: token::token) -> bool {
     // A sanity check that the word we are asking for is a known keyword
     fn require_keyword(word: ~str) {
         if !self.keywords.contains_key_ref(&word) {
-            self.bug(fmt!{"unknown keyword: %s", word});
+            self.bug(fmt!("unknown keyword: %s", word));
         }
     }
 
index 60d2fadb04ce0ae883a27cfacba0ab184b249680..2eafa4a6f34aeed407e8982d11f4315707b4b209 100644 (file)
@@ -20,9 +20,9 @@ fn eval_crate_directives(cx: ctx,
 fn eval_crate_directives_to_mod(cx: ctx, cdirs: ~[@ast::crate_directive],
                                 prefix: ~str, suffix: option<~str>)
     -> (ast::_mod, ~[ast::attribute]) {
-    debug!{"eval crate prefix: %s", prefix};
-    debug!{"eval crate suffix: %s",
-           option::get_default(suffix, ~"none")};
+    debug!("eval crate prefix: %s", prefix);
+    debug!("eval crate suffix: %s",
+           option::get_default(suffix, ~"none"));
     let (cview_items, citems, cattrs)
         = parse_companion_mod(cx, prefix, suffix);
     let mut view_items: ~[@ast::view_item] = ~[];
@@ -63,9 +63,9 @@ fn file_exists(path: ~str) -> bool {
     }
 
     let modpath = companion_file(prefix, suffix);
-    debug!{"looking for companion mod %s", modpath};
+    debug!("looking for companion mod %s", modpath);
     if file_exists(modpath) {
-        debug!{"found companion mod"};
+        debug!("found companion mod");
         let (p0, r0) = new_parser_etc_from_file(cx.sess, cx.cfg,
                                                 modpath, SOURCE_FILE);
         let inner_attrs = p0.parse_inner_attrs_and_next();
index a796073c9dd964bd381a0a1edb4b97ef4b3f7910..854633aa06ecab429580231b7dcec7175cbb8bdd 100644 (file)
@@ -419,8 +419,8 @@ fn scan_number(c: char, rdr: string_reader) -> token::token {
         }
         let parsed = option::get(u64::from_str_radix(num_str, base as u64));
 
-        debug!{"lexing %s as an unsuffixed integer literal",
-               num_str};
+        debug!("lexing %s as an unsuffixed integer literal",
+               num_str);
         return token::LIT_INT_UNSUFFIXED(parsed as i64);
     }
 }
@@ -431,7 +431,7 @@ fn scan_numeric_escape(rdr: string_reader, n_hex_digits: uint) -> char {
         let n = rdr.curr;
         bump(rdr);
         if !is_hex_digit(n) {
-            rdr.fatal(fmt!{"illegal numeric character escape: %d", n as int});
+            rdr.fatal(fmt!("illegal numeric character escape: %d", n as int));
         }
         accum_int *= 16;
         accum_int += hex_digit_val(n);
@@ -578,7 +578,7 @@ fn binop(rdr: string_reader, op: token::binop) -> token::token {
               'u' => { c2 = scan_numeric_escape(rdr, 4u); }
               'U' => { c2 = scan_numeric_escape(rdr, 8u); }
               c2 => {
-                rdr.fatal(fmt!{"unknown character escape: %d", c2 as int});
+                rdr.fatal(fmt!("unknown character escape: %d", c2 as int));
               }
             }
         }
@@ -593,8 +593,8 @@ fn binop(rdr: string_reader, op: token::binop) -> token::token {
         bump(rdr);
         while rdr.curr != '"' {
             if is_eof(rdr) {
-                rdr.fatal(fmt!{"unterminated double quote string: %s",
-                               get_str_from(rdr, n)});
+                rdr.fatal(fmt!("unterminated double quote string: %s",
+                               get_str_from(rdr, n)));
             }
 
             let ch = rdr.curr;
@@ -621,7 +621,7 @@ fn binop(rdr: string_reader, op: token::binop) -> token::token {
                     str::push_char(accum_str, scan_numeric_escape(rdr, 8u));
                   }
                   c2 => {
-                    rdr.fatal(fmt!{"unknown string escape: %d", c2 as int});
+                    rdr.fatal(fmt!("unknown string escape: %d", c2 as int));
                   }
                 }
               }
@@ -656,7 +656,7 @@ fn binop(rdr: string_reader, op: token::binop) -> token::token {
       '/' => { return binop(rdr, token::SLASH); }
       '^' => { return binop(rdr, token::CARET); }
       '%' => { return binop(rdr, token::PERCENT); }
-      c => { rdr.fatal(fmt!{"unknown start of token: %d", c as int}); }
+      c => { rdr.fatal(fmt!("unknown start of token: %d", c as int)); }
     }
 }
 
index f81d6de25b47cffca39eba1a1508931599facc25..2aef7c99dbc9d772e52f75c287bbb306f472481f 100644 (file)
@@ -126,7 +126,7 @@ enum view_item_parse_mode {
 /* The expr situation is not as complex as I thought it would be.
 The important thing is to make sure that lookahead doesn't balk
 at INTERPOLATED tokens */
-macro_rules! maybe_whole_expr {
+macro_rules! maybe_whole_expr (
     {$p:expr} => { match copy $p.token {
       INTERPOLATED(token::nt_expr(e)) => {
         $p.bump();
@@ -139,9 +139,9 @@ macro_rules! maybe_whole_expr {
       }
       _ => ()
     }}
-}
+)
 
-macro_rules! maybe_whole {
+macro_rules! maybe_whole (
     {$p:expr, $constructor:ident} => { match copy $p.token {
       INTERPOLATED(token::$constructor(x)) => { $p.bump(); return x; }
       _ => ()
@@ -166,7 +166,7 @@ macro_rules! maybe_whole {
       _ => ()
     }}
 
-}
+)
 
 
 pure fn maybe_append(+lhs: ~[attribute], rhs: option<~[attribute]>)
@@ -325,13 +325,13 @@ fn parse_trait_methods() -> ~[trait_method] {
             let self_ty = if is_static { static_sty } else { self_ty };
 
             let hi = p.last_span.hi;
-            debug!{"parse_trait_methods(): trait method signature ends in \
+            debug!("parse_trait_methods(): trait method signature ends in \
                     `%s`",
-                   token_to_str(p.reader, p.token)};
+                   token_to_str(p.reader, p.token));
             match p.token {
               token::SEMI => {
                 p.bump();
-                debug!{"parse_trait_methods(): parsing required method"};
+                debug!("parse_trait_methods(): parsing required method");
                 // NB: at the moment, visibility annotations on required
                 // methods are ignored; this could change.
                 required({ident: ident, attrs: attrs,
@@ -340,7 +340,7 @@ fn parse_trait_methods() -> ~[trait_method] {
                           id: p.get_id(), span: mk_sp(lo, hi)})
               }
               token::LBRACE => {
-                debug!{"parse_trait_methods(): parsing provided method"};
+                debug!("parse_trait_methods(): parsing provided method");
                 let (inner_attrs, body) =
                     p.parse_inner_attrs_and_block(true);
                 let attrs = vec::append(attrs, inner_attrs);
@@ -441,7 +441,7 @@ fn parse_region_with_sep() -> @region {
     }
 
     fn parse_ty(colons_before_params: bool) -> @ty {
-        maybe_whole!{self, nt_ty};
+        maybe_whole!(self, nt_ty);
 
         let lo = self.span.lo;
 
@@ -708,7 +708,7 @@ fn parse_path_without_tps_(
         parse_ident: fn(parser) -> ident,
         parse_last_ident: fn(parser) -> ident) -> @path {
 
-        maybe_whole!{self, nt_path};
+        maybe_whole!(self, nt_path);
         let lo = self.span.lo;
         let global = self.eat(token::MOD_SEP);
         let mut ids = ~[];
@@ -735,9 +735,9 @@ fn parse_value_path() -> @path {
     }
 
     fn parse_path_with_tps(colons: bool) -> @path {
-        debug!{"parse_path_with_tps(colons=%b)", colons};
+        debug!("parse_path_with_tps(colons=%b)", colons);
 
-        maybe_whole!{self, nt_path};
+        maybe_whole!(self, nt_path);
         let lo = self.span.lo;
         let path = self.parse_path_without_tps();
         if colons && !self.eat(token::MOD_SEP) {
@@ -829,7 +829,7 @@ fn to_expr(e: pexpr) -> @expr {
     }
 
     fn parse_bottom_expr() -> pexpr {
-        maybe_whole_expr!{self};
+        maybe_whole_expr!(self);
         let lo = self.span.lo;
         let mut hi = self.span.hi;
 
@@ -1197,7 +1197,7 @@ fn parse_sep_and_zerok() -> (option<token::token>, bool) {
     }
 
     fn parse_token_tree() -> token_tree {
-        maybe_whole!{deref self, nt_tt};
+        maybe_whole!(deref self, nt_tt);
 
         fn parse_tt_tok(p: parser, delim_ok: bool) -> token_tree {
             match p.token {
@@ -1249,7 +1249,7 @@ fn parse_tt_tok(p: parser, delim_ok: bool) -> token_tree {
     fn parse_matchers() -> ~[matcher] {
         // unification of matchers and token_trees would vastly improve
         // the interpolation of matchers
-        maybe_whole!{self, nt_matchers};
+        maybe_whole!(self, nt_matchers);
         let name_idx = @mut 0u;
         return match self.token {
           token::LBRACE | token::LPAREN | token::LBRACKET => {
@@ -1598,9 +1598,9 @@ fn parse_sugary_call_expr(keyword: ~str,
             // There may be other types of expressions that can
             // represent the callee in `for` and `do` expressions
             // but they aren't represented by tests
-            debug!{"sugary call on %?", e.node};
+            debug!("sugary call on %?", e.node);
             self.span_fatal(
-                lo, fmt!{"`%s` must be followed by a block call", keyword});
+                lo, fmt!("`%s` must be followed by a block call", keyword));
           }
         }
     }
@@ -1801,7 +1801,7 @@ fn parse_pat_fields(refutable: bool) -> (~[ast::field_pat], bool) {
     }
 
     fn parse_pat(refutable: bool) -> @pat {
-        maybe_whole!{self, nt_pat};
+        maybe_whole!(self, nt_pat);
 
         let lo = self.span.lo;
         let mut hi = self.span.hi;
@@ -2077,7 +2077,7 @@ fn parse_instance_var(pr: visibility) -> @class_member {
     }
 
     fn parse_stmt(+first_item_attrs: ~[attribute]) -> @stmt {
-        maybe_whole!{self, nt_stmt};
+        maybe_whole!(self, nt_stmt);
 
         fn check_expected_item(p: parser, current_attrs: ~[attribute]) {
             // If we have attributes then we should have an item
@@ -2140,7 +2140,7 @@ fn parse_block() -> blk {
     fn parse_inner_attrs_and_block(parse_attrs: bool)
         -> (~[attribute], blk) {
 
-        maybe_whole!{pair_empty self, nt_block};
+        maybe_whole!(pair_empty self, nt_block);
 
         fn maybe_parse_inner_attrs_and_next(p: parser, parse_attrs: bool) ->
             {inner: ~[attribute], next: ~[attribute]} {
@@ -2812,7 +2812,7 @@ fn parse_mod_items(term: token::token,
                            token_to_str(self.reader, self.token) + ~"`");
               }
             }
-            debug!{"parse_mod_items: attrs=%?", attrs};
+            debug!("parse_mod_items: attrs=%?", attrs);
         }
 
         if first && attrs_remaining.len() > 0u {
@@ -3139,7 +3139,7 @@ fn fn_expr_lookahead(tok: token::token) -> bool {
 
     fn parse_item_or_view_item(+attrs: ~[attribute], items_allowed: bool)
                             -> item_or_view_item {
-        maybe_whole!{iovi self,nt_item};
+        maybe_whole!(iovi self,nt_item);
         let lo = self.span.lo;
 
         let visibility;
@@ -3303,7 +3303,7 @@ fn parse_view_path() -> @view_path {
         let lo = self.span.lo;
         let first_ident = self.parse_ident();
         let mut path = ~[first_ident];
-        debug!{"parsed view_path: %s", *self.id_to_str(first_ident)};
+        debug!("parsed view_path: %s", *self.id_to_str(first_ident));
         match self.token {
           token::EQ => {
             // x = foo::bar
index 7282eaafb79454589c49f5847bcebaff1a51dd3f..fbca90b5f4982a6cb5060e34bb897a1f43e413bf 100644 (file)
@@ -63,7 +63,7 @@ enum token { STRING(@~str, int), BREAK(break_t), BEGIN(begin_t), END, EOF, }
 
 fn tok_str(++t: token) -> ~str {
     match t {
-      STRING(s, len) => return fmt!{"STR(%s,%d)", *s, len},
+      STRING(s, len) => return fmt!("STR(%s,%d)", *s, len),
       BREAK(_) => return ~"BREAK",
       BEGIN(_) => return ~"BEGIN",
       END => return ~"END",
@@ -81,7 +81,7 @@ fn buf_str(toks: ~[mut token], szs: ~[mut int], left: uint, right: uint,
     while i != right && L != 0u {
         L -= 1u;
         if i != left { s += ~", "; }
-        s += fmt!{"%d=%s", szs[i], tok_str(toks[i])};
+        s += fmt!("%d=%s", szs[i], tok_str(toks[i]));
         i += 1u;
         i %= n;
     }
@@ -99,7 +99,7 @@ fn mk_printer(out: io::Writer, linewidth: uint) -> printer {
     // Yes 3, it makes the ring buffers big enough to never
     // fall behind.
     let n: uint = 3u * linewidth;
-    debug!{"mk_printer %u", linewidth};
+    debug!("mk_printer %u", linewidth);
     let token: ~[mut token] = vec::to_mut(vec::from_elem(n, EOF));
     let size: ~[mut int] = vec::to_mut(vec::from_elem(n, 0));
     let scan_stack: ~[mut uint] = vec::to_mut(vec::from_elem(n, 0u));
@@ -237,7 +237,7 @@ fn last_token() -> token { self.token[self.right] }
     // be very careful with this!
     fn replace_last_token(t: token) { self.token[self.right] = t; }
     fn pretty_print(t: token) {
-        debug!{"pp ~[%u,%u]", self.left, self.right};
+        debug!("pp ~[%u,%u]", self.left, self.right);
         match t {
           EOF => {
             if !self.scan_stack_empty {
@@ -254,18 +254,18 @@ fn pretty_print(t: token) {
                 self.left = 0u;
                 self.right = 0u;
             } else { self.advance_right(); }
-            debug!{"pp BEGIN(%d)/buffer ~[%u,%u]",
-                   b.offset, self.left, self.right};
+            debug!("pp BEGIN(%d)/buffer ~[%u,%u]",
+                   b.offset, self.left, self.right);
             self.token[self.right] = t;
             self.size[self.right] = -self.right_total;
             self.scan_push(self.right);
           }
           END => {
             if self.scan_stack_empty {
-                debug!{"pp END/print ~[%u,%u]", self.left, self.right};
+                debug!("pp END/print ~[%u,%u]", self.left, self.right);
                 self.print(t, 0);
             } else {
-                debug!{"pp END/buffer ~[%u,%u]", self.left, self.right};
+                debug!("pp END/buffer ~[%u,%u]", self.left, self.right);
                 self.advance_right();
                 self.token[self.right] = t;
                 self.size[self.right] = -1;
@@ -279,8 +279,8 @@ fn pretty_print(t: token) {
                 self.left = 0u;
                 self.right = 0u;
             } else { self.advance_right(); }
-            debug!{"pp BREAK(%d)/buffer ~[%u,%u]",
-                   b.offset, self.left, self.right};
+            debug!("pp BREAK(%d)/buffer ~[%u,%u]",
+                   b.offset, self.left, self.right);
             self.check_stack(0);
             self.scan_push(self.right);
             self.token[self.right] = t;
@@ -289,12 +289,12 @@ fn pretty_print(t: token) {
           }
           STRING(s, len) => {
             if self.scan_stack_empty {
-                debug!{"pp STRING('%s')/print ~[%u,%u]",
-                       *s, self.left, self.right};
+                debug!("pp STRING('%s')/print ~[%u,%u]",
+                       *s, self.left, self.right);
                 self.print(t, len);
             } else {
-                debug!{"pp STRING('%s')/buffer ~[%u,%u]",
-                       *s, self.left, self.right};
+                debug!("pp STRING('%s')/buffer ~[%u,%u]",
+                       *s, self.left, self.right);
                 self.advance_right();
                 self.token[self.right] = t;
                 self.size[self.right] = len;
@@ -305,14 +305,14 @@ fn pretty_print(t: token) {
         }
     }
     fn check_stream() {
-        debug!{"check_stream ~[%u, %u] with left_total=%d, right_total=%d",
-               self.left, self.right, self.left_total, self.right_total};
+        debug!("check_stream ~[%u, %u] with left_total=%d, right_total=%d",
+               self.left, self.right, self.left_total, self.right_total);
         if self.right_total - self.left_total > self.space {
-            debug!{"scan window is %d, longer than space on line (%d)",
-                   self.right_total - self.left_total, self.space};
+            debug!("scan window is %d, longer than space on line (%d)",
+                   self.right_total - self.left_total, self.space);
             if !self.scan_stack_empty {
                 if self.left == self.scan_stack[self.bottom] {
-                    debug!{"setting %u to infinity and popping", self.left};
+                    debug!("setting %u to infinity and popping", self.left);
                     self.size[self.scan_pop_bottom()] = size_infinity;
                 }
             }
@@ -321,7 +321,7 @@ fn check_stream() {
         }
     }
     fn scan_push(x: uint) {
-        debug!{"scan_push %u", x};
+        debug!("scan_push %u", x);
         if self.scan_stack_empty {
             self.scan_stack_empty = false;
         } else {
@@ -357,8 +357,8 @@ fn advance_right() {
         assert (self.right != self.left);
     }
     fn advance_left(++x: token, L: int) {
-        debug!{"advnce_left ~[%u,%u], sizeof(%u)=%d", self.left, self.right,
-               self.left, L};
+        debug!("advnce_left ~[%u,%u], sizeof(%u)=%d", self.left, self.right,
+               self.left, L);
         if L >= 0 {
             self.print(x, L);
             match x {
@@ -398,13 +398,13 @@ fn check_stack(k: int) {
         }
     }
     fn print_newline(amount: int) {
-        debug!{"NEWLINE %d", amount};
+        debug!("NEWLINE %d", amount);
         self.out.write_str(~"\n");
         self.pending_indentation = 0;
         self.indent(amount);
     }
     fn indent(amount: int) {
-        debug!{"INDENT %d", amount};
+        debug!("INDENT %d", amount);
         self.pending_indentation += amount;
     }
     fn get_top() -> print_stack_elt {
@@ -423,24 +423,24 @@ fn print_str(s: ~str) {
         self.out.write_str(s);
     }
     fn print(x: token, L: int) {
-        debug!{"print %s %d (remaining line space=%d)", tok_str(x), L,
-               self.space};
+        debug!("print %s %d (remaining line space=%d)", tok_str(x), L,
+               self.space);
         log(debug, buf_str(self.token, self.size, self.left, self.right, 6u));
         match x {
           BEGIN(b) => {
             if L > self.space {
                 let col = self.margin - self.space + b.offset;
-                debug!{"print BEGIN -> push broken block at col %d", col};
+                debug!("print BEGIN -> push broken block at col %d", col);
                 self.print_stack.push({offset: col,
                                        pbreak: broken(b.breaks)});
             } else {
-                debug!{"print BEGIN -> push fitting block"};
+                debug!("print BEGIN -> push fitting block");
                 self.print_stack.push({offset: 0,
                                        pbreak: fits});
             }
           }
           END => {
-            debug!{"print END -> pop END"};
+            debug!("print END -> pop END");
             assert (self.print_stack.len() != 0u);
             self.print_stack.pop();
           }
@@ -448,25 +448,25 @@ fn print(x: token, L: int) {
             let top = self.get_top();
             match top.pbreak {
               fits => {
-                debug!{"print BREAK(%d) in fitting block", b.blank_space};
+                debug!("print BREAK(%d) in fitting block", b.blank_space);
                 self.space -= b.blank_space;
                 self.indent(b.blank_space);
               }
               broken(consistent) => {
-                debug!{"print BREAK(%d+%d) in consistent block",
-                       top.offset, b.offset};
+                debug!("print BREAK(%d+%d) in consistent block",
+                       top.offset, b.offset);
                 self.print_newline(top.offset + b.offset);
                 self.space = self.margin - (top.offset + b.offset);
               }
               broken(inconsistent) => {
                 if L > self.space {
-                    debug!{"print BREAK(%d+%d) w/ newline in inconsistent",
-                           top.offset, b.offset};
+                    debug!("print BREAK(%d+%d) w/ newline in inconsistent",
+                           top.offset, b.offset);
                     self.print_newline(top.offset + b.offset);
                     self.space = self.margin - (top.offset + b.offset);
                 } else {
-                    debug!{"print BREAK(%d) w/o newline in inconsistent",
-                           b.blank_space};
+                    debug!("print BREAK(%d) w/o newline in inconsistent",
+                           b.blank_space);
                     self.indent(b.blank_space);
                     self.space -= b.blank_space;
                 }
@@ -474,7 +474,7 @@ fn print(x: token, L: int) {
             }
           }
           STRING(s, len) => {
-            debug!{"print STRING(%s)", *s};
+            debug!("print STRING(%s)", *s);
             assert (L == len);
             // assert L <= space;
             self.space -= len;
index 04f800a72386381a2283cca26555f8ae8e86ba7c..8320d438b4e631557c7ae6a36ad430260c1ac367 100644 (file)
@@ -937,14 +937,14 @@ fn print_mac(s: ps, m: ast::mac) {
         bclose(s, m.span);
       }
       ast::mac_ellipsis => word(s.s, ~"..."),
-      ast::mac_var(v) => word(s.s, fmt!{"$%u", v}),
+      ast::mac_var(v) => word(s.s, fmt!("$%u", v)),
       _ => { /* fixme */ }
     }
 }
 
 fn print_vstore(s: ps, t: ast::vstore) {
     match t {
-      ast::vstore_fixed(some(i)) => word(s.s, fmt!{"%u", i}),
+      ast::vstore_fixed(some(i)) => word(s.s, fmt!("%u", i)),
       ast::vstore_fixed(none) => word(s.s, ~"_"),
       ast::vstore_uniq => word(s.s, ~"~"),
       ast::vstore_box => word(s.s, ~"@"),
index 58e884340e6822eb7790d44cb0b994db10525f68..33fce8bc72c7ac8f8d5cfba84a9c8d9d42128b29 100644 (file)
@@ -343,7 +343,7 @@ fn crate_meta_extras_hash(symbol_hasher: &hash::State,
                               metas: provided_metas,
                               dep_hashes: ~[~str]) -> ~str {
         fn len_and_str(s: ~str) -> ~str {
-            return fmt!{"%u_%s", str::len(s), s};
+            return fmt!("%u_%s", str::len(s), s);
         }
 
         fn len_and_str_lit(l: ast::lit) -> ~str {
@@ -379,8 +379,8 @@ fn len_and_str_lit(l: ast::lit) -> ~str {
 
     fn warn_missing(sess: session, name: ~str, default: ~str) {
         if !sess.building_library { return; }
-        sess.warn(fmt!{"missing crate link meta `%s`, using `%s` as default",
-                       name, default});
+        sess.warn(fmt!("missing crate link meta `%s`, using `%s` as default",
+                       name, default));
     }
 
     fn crate_meta_name(sess: session, _crate: ast::crate,
@@ -393,8 +393,8 @@ fn crate_meta_name(sess: session, _crate: ast::crate,
                         let mut os =
                             str::split_char(path::basename(output), '.');
                         if (vec::len(os) < 2u) {
-                            sess.fatal(fmt!{"output file name `%s` doesn't\
-                              appear to have an extension", output});
+                            sess.fatal(fmt!("output file name `%s` doesn't\
+                              appear to have an extension", output));
                         }
                         vec::pop(os);
                         str::connect(os, ~".")
@@ -505,7 +505,7 @@ fn mangle(sess: session, ss: path) -> ~str {
     for ss.each |s| {
         match s { path_name(s) | path_mod(s) => {
           let sani = sanitize(sess.str_of(s));
-          n += fmt!{"%u%s", str::len(sani), sani};
+          n += fmt!("%u%s", str::len(sani), sani);
         } }
     }
     n += ~"E"; // End name-sequence.
@@ -581,12 +581,12 @@ fn rmext(filename: ~str) -> ~str {
 
     let output = if sess.building_library {
         let long_libname =
-            os::dll_filename(fmt!{"%s-%s-%s",
-                                  lm.name, lm.extras_hash, lm.vers});
-        debug!{"link_meta.name:  %s", lm.name};
-        debug!{"long_libname: %s", long_libname};
-        debug!{"out_filename: %s", out_filename};
-        debug!{"dirname(out_filename): %s", path::dirname(out_filename)};
+            os::dll_filename(fmt!("%s-%s-%s",
+                                  lm.name, lm.extras_hash, lm.vers));
+        debug!("link_meta.name:  %s", lm.name);
+        debug!("long_libname: %s", long_libname);
+        debug!("out_filename: %s", out_filename);
+        debug!("dirname(out_filename): %s", path::dirname(out_filename));
 
         path::connect(path::dirname(out_filename), long_libname)
     } else { out_filename };
@@ -703,14 +703,14 @@ fn rmext(filename: ~str) -> ~str {
     // extern libraries might live, based on the addl_lib_search_paths
     vec::push_all(cc_args, rpath::get_rpath_flags(sess, output));
 
-    debug!{"%s link args: %s", cc_prog, str::connect(cc_args, ~" ")};
+    debug!("%s link args: %s", cc_prog, str::connect(cc_args, ~" "));
     // We run 'cc' here
     let prog = run::program_output(cc_prog, cc_args);
     if 0 != prog.status {
-        sess.err(fmt!{"linking with `%s` failed with code %d",
-                      cc_prog, prog.status});
-        sess.note(fmt!{"%s arguments: %s",
-                       cc_prog, str::connect(cc_args, ~" ")});
+        sess.err(fmt!("linking with `%s` failed with code %d",
+                      cc_prog, prog.status));
+        sess.note(fmt!("%s arguments: %s",
+                       cc_prog, str::connect(cc_args, ~" ")));
         sess.note(prog.err + prog.out);
         sess.abort_if_errors();
     }
@@ -723,8 +723,8 @@ fn rmext(filename: ~str) -> ~str {
     // Remove the temporary object file if we aren't saving temps
     if !sess.opts.save_temps {
         if ! os::remove_file(obj_filename) {
-            sess.warn(fmt!{"failed to delete object file `%s`",
-                           obj_filename});
+            sess.warn(fmt!("failed to delete object file `%s`",
+                           obj_filename));
         }
     }
 }
index 85975897facaf92ca2fa2d91f34444ddfa5a4006..b6f6d17e444031ce5df6624ef35d257477bfc922 100644 (file)
@@ -21,7 +21,7 @@ fn get_rpath_flags(sess: session::session, out_filename: ~str) -> ~[~str] {
         return ~[];
     }
 
-    debug!{"preparing the RPATH!"};
+    debug!("preparing the RPATH!");
 
     let cwd = os::getcwd();
     let sysroot = sess.filesearch.sysroot();
@@ -45,20 +45,20 @@ fn get_sysroot_absolute_rt_lib(sess: session::session) -> path::Path {
 }
 
 fn rpaths_to_flags(rpaths: ~[~str]) -> ~[~str] {
-    vec::map(rpaths, |rpath| fmt!{"-Wl,-rpath,%s",rpath} )
+    vec::map(rpaths, |rpath| fmt!("-Wl,-rpath,%s",rpath) )
 }
 
 fn get_rpaths(os: session::os, cwd: path::Path, sysroot: path::Path,
               output: path::Path, libs: ~[path::Path],
               target_triple: ~str) -> ~[~str] {
-    debug!{"cwd: %s", cwd};
-    debug!{"sysroot: %s", sysroot};
-    debug!{"output: %s", output};
-    debug!{"libs:"};
+    debug!("cwd: %s", cwd);
+    debug!("sysroot: %s", sysroot);
+    debug!("output: %s", output);
+    debug!("libs:");
     for libs.each |libpath| {
-        debug!{"    %s", libpath};
+        debug!("    %s", libpath);
     }
-    debug!{"target_triple: %s", target_triple};
+    debug!("target_triple: %s", target_triple);
 
     // Use relative paths to the libraries. Binaries can be moved
     // as long as they maintain the relative relationship to the
@@ -73,9 +73,9 @@ fn get_rpaths(os: session::os, cwd: path::Path, sysroot: path::Path,
     let fallback_rpaths = ~[get_install_prefix_rpath(cwd, target_triple)];
 
     fn log_rpaths(desc: ~str, rpaths: ~[~str]) {
-        debug!{"%s rpaths:", desc};
+        debug!("%s rpaths:", desc);
         for rpaths.each |rpath| {
-            debug!{"    %s", rpath};
+            debug!("    %s", rpath);
         }
     }
 
@@ -124,8 +124,8 @@ fn get_rpath_relative_to_output(os: session::os,
 fn get_relative_to(abs1: path::Path, abs2: path::Path) -> path::Path {
     assert path::path_is_absolute(abs1);
     assert path::path_is_absolute(abs2);
-    debug!{"finding relative path from %s to %s",
-           abs1, abs2};
+    debug!("finding relative path from %s to %s",
+           abs1, abs2);
     let normal1 = path::normalize(abs1);
     let normal2 = path::normalize(abs2);
     let split1 = path::split(normal1);
@@ -171,7 +171,7 @@ fn get_absolute(cwd: path::Path, lib: path::Path) -> path::Path {
 }
 
 fn get_install_prefix_rpath(cwd: path::Path, target_triple: ~str) -> ~str {
-    let install_prefix = env!{"CFG_PREFIX"};
+    let install_prefix = env!("CFG_PREFIX");
 
     if install_prefix == ~"" {
         fail ~"rustc compiled without CFG_PREFIX environment variable";
@@ -222,7 +222,7 @@ fn test_get_absolute2() {
     #[test]
     fn test_prefix_rpath() {
         let res = get_install_prefix_rpath(~"/usr/lib", ~"triple");
-        let d = path::connect(env!{"CFG_PREFIX"}, ~"/lib/rustc/triple/lib");
+        let d = path::connect(env!("CFG_PREFIX"), ~"/lib/rustc/triple/lib");
         assert str::ends_with(res, d);
     }
 
index be113d4e992277328dcb9dc9949c6c663c9c8abc..97358154e99b8409f335ccf8a6f314196194045f 100644 (file)
@@ -116,8 +116,8 @@ fn time<T>(do_it: bool, what: ~str, thunk: fn() -> T) -> T {
     let start = std::time::precise_time_s();
     let rv = thunk();
     let end = std::time::precise_time_s();
-    io::stdout().write_str(fmt!{"time: %3.3f s\t%s\n",
-                                end - start, what});
+    io::stdout().write_str(fmt!("time: %3.3f s\t%s\n",
+                                end - start, what));
     return rv;
 }
 
@@ -403,7 +403,7 @@ fn host_triple() -> ~str {
     // FIXME (#2400): Instead of grabbing the host triple we really should
     // be grabbing (at compile time) the target triple that this rustc is
     // built with and calling that (at runtime) the host triple.
-    let ht = env!{"CFG_HOST_TRIPLE"};
+    let ht = env!("CFG_HOST_TRIPLE");
     return if ht != ~"" {
             ht
         } else {
@@ -438,8 +438,8 @@ fn build_session_options(matches: getopts::matches,
             let lint_name = str::replace(lint_name, ~"-", ~"_");
             match lint_dict.find(lint_name) {
               none => {
-                early_error(demitter, fmt!{"unknown %s flag: %s",
-                                           level_name, lint_name});
+                early_error(demitter, fmt!("unknown %s flag: %s",
+                                           level_name, lint_name));
               }
               some(lint) => {
                 vec::push(lint_opts, (lint.lint, level));
@@ -458,7 +458,7 @@ fn build_session_options(matches: getopts::matches,
             if name == debug_flag { this_bit = bit; break; }
         }
         if this_bit == 0u {
-            early_error(demitter, fmt!{"unknown debug flag: %s", debug_flag})
+            early_error(demitter, fmt!("unknown debug flag: %s", debug_flag))
         }
         debugging_opts |= this_bit;
     }
index f115125647765614c1802c7ca05793050b76e295..0770a132a1d3d7aa6b5a086d17862546bc65973a 100644 (file)
 
 fn version(argv0: ~str) {
     let mut vers = ~"unknown version";
-    let env_vers = env!{"CFG_VERSION"};
+    let env_vers = env!("CFG_VERSION");
     if str::len(env_vers) != 0u { vers = env_vers; }
-    io::println(fmt!{"%s %s", argv0, vers});
-    io::println(fmt!{"host: %s", host_triple()});
+    io::println(fmt!("%s %s", argv0, vers));
+    io::println(fmt!("host: %s", host_triple()));
 }
 
 fn usage(argv0: ~str) {
-    io::println(fmt!{"Usage: %s [options] <input>\n", argv0} +
+    io::println(fmt!("Usage: %s [options] <input>\n", argv0) +
                  ~"
 Options:
 
@@ -85,14 +85,14 @@ 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, ~"----"), ~"-------", ~"-------"});
+    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, ~"----"), ~"-------", ~"-------"));
     for lint_dict.each |k, v| {
         let k = str::replace(k, ~"_", ~"-");
-        io::println(fmt!{"    %s  %7.7s  %s",
+        io::println(fmt!("    %s  %7.7s  %s",
                          padded(max_key, k),
                          match v.default {
                              lint::allow => ~"allow",
@@ -100,16 +100,16 @@ fn padded(max: uint, s: ~str) -> ~str {
                              lint::deny => ~"deny",
                              lint::forbid => ~"forbid"
                          },
-                         v.desc});
+                         v.desc));
     }
     io::println(~"");
 }
 
 fn describe_debug_flags() {
-    io::println(fmt!{"\nAvailable debug options:\n"});
+    io::println(fmt!("\nAvailable debug options:\n"));
     for session::debugging_opts_map().each |pair| {
         let (name, desc, _) = pair;
-        io::println(fmt!{"    -Z%-20s -- %s", name, desc});
+        io::println(fmt!("    -Z%-20s -- %s", name, desc));
     }
 }
 
index 85770b7b6dd43ef7ce3ce8607ab41335eb76f95a..28d0af2aec2c6c92a3589bfca15520e02553c8c4 100644 (file)
@@ -7,7 +7,7 @@
 fn inject_intrinsic(sess: session,
                     crate: @ast::crate) -> @ast::crate {
 
-    let intrinsic_module = @include_str!{"intrinsic.rs"};
+    let intrinsic_module = @include_str!("intrinsic.rs");
 
     let item = parse::parse_item_from_source_str(~"<intrinsic>",
                                                  intrinsic_module,
index 33908f004f564cf4c399f7cecb34dcad0d71e96a..cba7e89dcbb1210bd6f8e30014a295ff57e8df91 100644 (file)
@@ -100,8 +100,8 @@ fn fold_item(cx: test_ctxt, &&i: @ast::item, fld: fold::ast_fold) ->
    option<@ast::item> {
 
     vec::push(cx.path, i.ident);
-    debug!{"current path: %s",
-           ast_util::path_name_i(cx.path, cx.sess.parse_sess.interner)};
+    debug!("current path: %s",
+           ast_util::path_name_i(cx.path, cx.sess.parse_sess.interner));
 
     if is_test_fn(i) {
         match i.node {
@@ -111,12 +111,12 @@ fn fold_item(cx: test_ctxt, &&i: @ast::item, fld: fold::ast_fold) ->
                 ~"unsafe functions cannot be used for tests");
           }
           _ => {
-            debug!{"this is a test function"};
+            debug!("this is a test function");
             let test = {span: i.span,
                         path: cx.path, ignore: is_ignored(cx, i),
                         should_fail: should_fail(i)};
             cx.testfns.push(test);
-            debug!{"have %u test functions", cx.testfns.len()};
+            debug!("have %u test functions", cx.testfns.len());
           }
         }
     }
@@ -203,8 +203,8 @@ fn mk_test_module(cx: test_ctxt) -> @ast::item {
          vis: ast::public,
          span: dummy_sp()};
 
-    debug!{"Synthetic test module:\n%s\n",
-           pprust::item_to_str(@item, cx.sess.intr())};
+    debug!("Synthetic test module:\n%s\n",
+           pprust::item_to_str(@item, cx.sess.intr()));
 
     return @item;
 }
@@ -280,7 +280,7 @@ fn mk_test_desc_vec_ty(cx: test_ctxt) -> @ast::ty {
 }
 
 fn mk_test_desc_vec(cx: test_ctxt) -> @ast::expr {
-    debug!{"building test vector from %u tests", cx.testfns.len()};
+    debug!("building test vector from %u tests", cx.testfns.len());
     let mut descs = ~[];
     for cx.testfns.each |test| {
         vec::push(descs, mk_test_desc_rec(cx, test));
@@ -300,8 +300,8 @@ fn mk_test_desc_rec(cx: test_ctxt, test: test) -> @ast::expr {
     let span = test.span;
     let path = test.path;
 
-    debug!{"encoding %s", ast_util::path_name_i(path,
-                                                cx.sess.parse_sess.interner)};
+    debug!("encoding %s", ast_util::path_name_i(path,
+                                                cx.sess.parse_sess.interner));
 
     let name_lit: ast::lit =
         nospan(ast::lit_str(@ast_util::path_name_i(path, cx.sess.parse_sess
index 8f705781adfd429f0e7abd63b962c64c4670f412..1ad517b3007ffe058cf05b4e485615b2faecfdda 100644 (file)
@@ -1090,7 +1090,7 @@ fn tys_str(names: type_names, outer: ~[TypeRef],
             if addrspace == 0u {
                 ~""
             } else {
-                fmt!{"addrspace(%u)", addrspace}
+                fmt!("addrspace(%u)", addrspace)
             }
         };
         return addrstr + ~"*" +
index 2a3b59bf349a95c1d9c019a095fe485527a84b24..5867dc12672711b945df85c885fd8912c3e25527 100644 (file)
@@ -45,11 +45,11 @@ fn read_crates(diag: span_handler, crate: ast::crate,
 };
 
 fn dump_crates(crate_cache: DVec<cache_entry>) {
-    debug!{"resolved crates:"};
+    debug!("resolved crates:");
     for crate_cache.each |entry| {
-        debug!{"cnum: %?", entry.cnum};
-        debug!{"span: %?", entry.span};
-        debug!{"hash: %?", entry.hash};
+        debug!("cnum: %?", entry.cnum);
+        debug!("span: %?", entry.span);
+        debug!("hash: %?", entry.hash);
     }
 }
 
@@ -73,7 +73,7 @@ fn warn_if_multiple_versions(e: env, diag: span_handler,
 
         if matches.len() != 1u {
             diag.handler().warn(
-                fmt!{"using multiple versions of crate `%s`", name});
+                fmt!("using multiple versions of crate `%s`", name));
             for matches.each |match_| {
                 diag.span_note(match_.span, ~"used here");
                 let attrs = ~[
@@ -99,7 +99,7 @@ fn warn_if_multiple_versions(e: env, diag: span_handler,
 fn visit_view_item(e: env, i: @ast::view_item) {
     match i.node {
       ast::view_item_use(ident, meta_items, id) => {
-        debug!{"resolving use stmt. ident: %?, meta: %?", ident, meta_items};
+        debug!("resolving use stmt. ident: %?, meta: %?", ident, meta_items);
         let cnum = resolve_crate(e, ident, meta_items, ~"", i.span);
         cstore::add_use_stmt_cnum(e.cstore, id, cnum);
       }
@@ -236,7 +236,7 @@ fn resolve_crate(e: env, ident: ast::ident, metas: ~[@ast::meta_item],
 
 // Go through the crate metadata and load any crates that it references
 fn resolve_crate_deps(e: env, cdata: @~[u8]) -> cstore::cnum_map {
-    debug!{"resolving deps of external crate"};
+    debug!("resolving deps of external crate");
     // The map from crate numbers in the crate we're resolving to local crate
     // numbers
     let cnum_map = int_hash::<ast::crate_num>();
@@ -244,17 +244,17 @@ fn resolve_crate_deps(e: env, cdata: @~[u8]) -> cstore::cnum_map {
         let extrn_cnum = dep.cnum;
         let cname = dep.name;
         let cmetas = metas_with(dep.vers, ~"vers", ~[]);
-        debug!{"resolving dep crate %s ver: %s hash: %s",
-               *e.intr.get(dep.name), dep.vers, dep.hash};
+        debug!("resolving dep crate %s ver: %s hash: %s",
+               *e.intr.get(dep.name), dep.vers, dep.hash);
         match existing_match(e, metas_with_ident(*e.intr.get(cname), cmetas),
                              dep.hash) {
           some(local_cnum) => {
-            debug!{"already have it"};
+            debug!("already have it");
             // We've already seen this crate
             cnum_map.insert(extrn_cnum, local_cnum);
           }
           none => {
-            debug!{"need to load it"};
+            debug!("need to load it");
             // This is a new one so we've got to load it
             // FIXME (#2404): Need better error reporting than just a bogus
             // span.
index 09de007f0a56937faf4fac53eed67e2794376c02..dbf4d7d5566d19e353d4618bcd0ff5e15ca658b1 100644 (file)
@@ -137,17 +137,17 @@ fn get_field_type(tcx: ty::ctxt, class_id: ast::def_id,
     let cstore = tcx.cstore;
     let cdata = cstore::get_crate_data(cstore, class_id.crate);
     let all_items = ebml::get_doc(ebml::doc(cdata.data), tag_items);
-    debug!{"Looking up %?", class_id};
+    debug!("Looking up %?", class_id);
     let class_doc = expect(tcx.diag,
                            decoder::maybe_find_item(class_id.node, all_items),
-                           || fmt!{"get_field_type: class ID %? not found",
-                                   class_id} );
-    debug!{"looking up %? : %?", def, class_doc};
+                           || fmt!("get_field_type: class ID %? not found",
+                                   class_id) );
+    debug!("looking up %? : %?", def, class_doc);
     let the_field = expect(tcx.diag,
         decoder::maybe_find_item(def.node, class_doc),
-        || fmt!{"get_field_type: in class %?, field ID %? not found",
-                 class_id, def} );
-    debug!{"got field data %?", the_field};
+        || fmt!("get_field_type: in class %?, field ID %? not found",
+                 class_id, def) );
+    debug!("got field data %?", the_field);
     let ty = decoder::item_type(def, the_field, tcx, cdata);
     return {bounds: @~[],
             region_param: none,
index 56ea0f028f6a910f3658acdd561a400bd2d17af1..4b65953781a65d1821bba2b29f6a1f49f3b80aa4 100644 (file)
@@ -163,14 +163,14 @@ fn get_dep_hashes(cstore: cstore) -> ~[~str] {
     for p(cstore).use_crate_map.each_value |cnum| {
         let cdata = cstore::get_crate_data(cstore, cnum);
         let hash = decoder::get_crate_hash(cdata.data);
-        debug!{"Add hash[%s]: %s", cdata.name, hash};
+        debug!("Add hash[%s]: %s", cdata.name, hash);
         vec::push(result, {name: cdata.name, hash: hash});
     };
     pure fn lteq(a: &crate_hash, b: &crate_hash) -> bool {a.name <= b.name}
     let sorted = std::sort::merge_sort(lteq, result);
-    debug!{"sorted:"};
+    debug!("sorted:");
     for sorted.each |x| {
-        debug!{"  hash[%s]: %s", x.name, x.hash};
+        debug!("  hash[%s]: %s", x.name, x.hash);
     }
     fn mapper(ch: crate_hash) -> ~str { return ch.hash; }
     return vec::map(sorted, mapper);
index b78be76dc690aeb7390639bb39c364db3a80aa12..37f00be40ff2da1f03a9e2214cfc5aa92b736c3d 100644 (file)
@@ -100,7 +100,7 @@ fn find_item(item_id: int, items: ebml::doc) -> ebml::doc {
 fn lookup_item(item_id: int, data: @~[u8]) -> ebml::doc {
     let items = ebml::get_doc(ebml::doc(data), tag_items);
     match maybe_find_item(item_id, items) {
-       none => fail(fmt!{"lookup_item: id not found: %d", item_id}),
+       none => fail(fmt!("lookup_item: id not found: %d", item_id)),
        some(d) => d
     }
 }
@@ -379,8 +379,8 @@ fn get_class_method(intr: ident_interner, cdata: cmd, id: ast::node_id,
     let mut found = none;
     let cls_items = match maybe_find_item(id, items) {
       some(it) => it,
-      none => fail (fmt!{"get_class_method: class id not found \
-                              when looking up method %s", *intr.get(name)})
+      none => fail (fmt!("get_class_method: class id not found \
+                              when looking up method %s", *intr.get(name)))
     };
     for ebml::tagged_docs(cls_items, tag_item_trait_method) |mid| {
         let m_did = item_def_id(mid, cdata);
@@ -390,8 +390,8 @@ fn get_class_method(intr: ident_interner, cdata: cmd, id: ast::node_id,
     }
     match found {
       some(found) => found,
-      none => fail (fmt!{"get_class_method: no method named %s",
-                         *intr.get(name)})
+      none => fail (fmt!("get_class_method: no method named %s",
+                         *intr.get(name)))
     }
 }
 
@@ -400,8 +400,8 @@ fn class_dtor(cdata: cmd, id: ast::node_id) -> option<ast::def_id> {
     let mut found = none;
     let cls_items = match maybe_find_item(id, items) {
             some(it) => it,
-            none     => fail (fmt!{"class_dtor: class id not found \
-              when looking up dtor for %d", id})
+            none     => fail (fmt!("class_dtor: class id not found \
+              when looking up dtor for %d", id))
     };
     for ebml::tagged_docs(cls_items, tag_item_dtor) |doc| {
          let doc1 = ebml::get_doc(doc, tag_def_id);
@@ -461,7 +461,7 @@ fn each_path(intr: ident_interner, cdata: cmd, f: fn(path_entry) -> bool) {
                 let def_id = item_def_id(item_doc, cdata);
 
                 // Construct the def for this item.
-                debug!{"(each_path) yielding explicit item: %s", path};
+                debug!("(each_path) yielding explicit item: %s", path);
                 let def_like = item_to_def_like(item_doc, def_id, cdata.cnum);
 
                 // Hand the information off to the iteratee.
@@ -539,7 +539,7 @@ fn maybe_get_item_ast(intr: ident_interner, cdata: cmd, tcx: ty::ctxt,
                       id: ast::node_id,
                       decode_inlined_item: decode_inlined_item
                      ) -> csearch::found_ast {
-    debug!{"Looking up item: %d", id};
+    debug!("Looking up item: %d", id);
     let item_doc = lookup_item(id, cdata.data);
     let path = vec::init(item_path(intr, item_doc));
     match decode_inlined_item(cdata, tcx, path, item_doc) {
@@ -609,7 +609,7 @@ fn get_mutability(ch: u8) -> ast::mutability {
             'm' => { ast::m_mutbl }
             'c' => { ast::m_const }
             _ => {
-                fail fmt!{"unknown mutability character: `%c`", ch as char}
+                fail fmt!("unknown mutability character: `%c`", ch as char)
             }
         }
     }
@@ -626,7 +626,7 @@ fn get_mutability(ch: u8) -> ast::mutability {
         '~' => { return ast::sty_uniq(get_mutability(string[1])); }
         '&' => { return ast::sty_region(get_mutability(string[1])); }
         _ => {
-            fail fmt!{"unknown self type code: `%c`", self_ty_kind as char};
+            fail fmt!("unknown self type code: `%c`", self_ty_kind as char);
         }
     }
 }
@@ -658,8 +658,8 @@ fn get_impls_for_mod(intr: ident_interner, cdata: cmd,
     for ebml::tagged_docs(mod_item, tag_mod_impl) |doc| {
         let did = ebml::with_doc_data(doc, |d| parse_def_id(d));
         let local_did = translate_def_id(cdata, did);
-        debug!{"(get impls for mod) getting did %? for '%?'",
-               local_did, name};
+        debug!("(get impls for mod) getting did %? for '%?'",
+               local_did, name);
           // The impl may be defined in a different crate. Ask the caller
           // to give us the metadata
         let impl_cdata = get_cdata(local_did.crate);
@@ -797,7 +797,7 @@ fn describe_def(items: ebml::doc, id: ast::def_id) -> ~str {
     if id.crate != ast::local_crate { return ~"external"; }
     let it = match maybe_find_item(id.node, items) {
         some(it) => it,
-        none => fail (fmt!{"describe_def: item not found %?", id})
+        none => fail (fmt!("describe_def: item not found %?", id))
     };
     return item_family_to_str(item_family(it));
 }
@@ -877,16 +877,16 @@ fn get_attributes(md: ebml::doc) -> ~[ast::attribute] {
 fn list_meta_items(intr: ident_interner,
                    meta_items: ebml::doc, out: io::Writer) {
     for get_meta_items(meta_items).each |mi| {
-        out.write_str(fmt!{"%s\n", pprust::meta_item_to_str(mi, intr)});
+        out.write_str(fmt!("%s\n", pprust::meta_item_to_str(mi, intr)));
     }
 }
 
 fn list_crate_attributes(intr: ident_interner, md: ebml::doc, hash: ~str,
                          out: io::Writer) {
-    out.write_str(fmt!{"=Crate Attributes (%s)=\n", hash});
+    out.write_str(fmt!("=Crate Attributes (%s)=\n", hash));
 
     for get_attributes(md).each |attr| {
-        out.write_str(fmt!{"%s\n", pprust::attribute_to_str(attr, intr)});
+        out.write_str(fmt!("%s\n", pprust::attribute_to_str(attr, intr)));
     }
 
     out.write_str(~"\n\n");
@@ -922,8 +922,8 @@ fn list_crate_deps(intr: ident_interner, data: @~[u8], out: io::Writer) {
 
     for get_crate_deps(intr, data).each |dep| {
         out.write_str(
-            fmt!{"%d %s-%s-%s\n",
-                 dep.cnum, *intr.get(dep.name), dep.hash, dep.vers});
+            fmt!("%d %s-%s-%s\n",
+                 dep.cnum, *intr.get(dep.name), dep.hash, dep.vers));
     }
 
     out.write_str(~"\n");
index f37cdd331ccad38dd48cb36e9ccc056d4a6691f3..8737e31e614bc94b6f91f06074ef43194d6b241d 100644 (file)
@@ -126,7 +126,7 @@ fn encode_family(ebml_w: ebml::writer, c: char) {
     ebml_w.end_tag();
 }
 
-fn def_to_str(did: def_id) -> ~str { fmt!{"%d:%d", did.crate, did.node} }
+fn def_to_str(did: def_id) -> ~str { fmt!("%d:%d", did.crate, did.node) }
 
 fn encode_ty_type_param_bounds(ebml_w: ebml::writer, ecx: @encode_ctxt,
                                params: @~[ty::param_bounds]) {
@@ -178,7 +178,7 @@ fn encode_symbol(ecx: @encode_ctxt, ebml_w: ebml::writer, id: node_id) {
       some(x) => x,
       none => {
         ecx.diag.handler().bug(
-            fmt!{"encode_symbol: id not found %d", id});
+            fmt!("encode_symbol: id not found %d", id));
       }
     };
     ebml_w.writer.write(str::bytes(sym));
@@ -265,20 +265,20 @@ fn encode_info_for_mod(ecx: @encode_ctxt, ebml_w: ebml::writer, md: _mod,
     encode_def_id(ebml_w, local_def(id));
     encode_family(ebml_w, 'm');
     encode_name(ecx, ebml_w, name);
-    debug!{"(encoding info for module) encoding info for module ID %d", id};
+    debug!("(encoding info for module) encoding info for module ID %d", id);
 
     // Encode info about all the module children.
     for md.items.each |item| {
         match item.node {
             item_impl(*) | item_class(*) => {
                 let (ident, did) = (item.ident, item.id);
-                debug!{"(encoding info for module) ... encoding impl %s \
+                debug!("(encoding info for module) ... encoding impl %s \
                         (%?/%?), exported? %?",
                         ecx.tcx.sess.str_of(ident),
                         did,
                         ast_map::node_id_to_str(ecx.tcx.items, did, ecx.tcx
                                                 .sess.parse_sess.interner),
-                        ast_util::is_exported(ident, md)};
+                        ast_util::is_exported(ident, md));
 
                 ebml_w.start_tag(tag_mod_impl);
                 ebml_w.wr_str(def_to_str(local_def(did)));
@@ -378,8 +378,8 @@ fn encode_info_for_class(ecx: @encode_ctxt, ebml_w: ebml::writer,
                 vec::push(*global_index, {val: id,
                                           pos: ebml_w.writer.tell()});
                 ebml_w.start_tag(tag_items_data_item);
-                debug!{"encode_info_for_class: doing %s %d",
-                       tcx.sess.str_of(nm), id};
+                debug!("encode_info_for_class: doing %s %d",
+                       tcx.sess.str_of(nm), id);
                 encode_visibility(ebml_w, vis);
                 encode_name(ecx, ebml_w, nm);
                 encode_path(ecx, ebml_w, path, ast_map::path_name(nm));
@@ -400,8 +400,8 @@ fn encode_info_for_class(ecx: @encode_ctxt, ebml_w: ebml::writer,
                           {val: m.id, pos: ebml_w.writer.tell()});
                 let impl_path = vec::append_one(path,
                                                 ast_map::path_name(m.ident));
-                debug!{"encode_info_for_class: doing %s %d",
-                       ecx.tcx.sess.str_of(m.ident), m.id};
+                debug!("encode_info_for_class: doing %s %d",
+                       ecx.tcx.sess.str_of(m.ident), m.id);
                 encode_info_for_method(ecx, ebml_w, impl_path,
                                        should_inline(m.attrs), id, m,
                                        vec::append(class_tps, m.tps));
@@ -423,9 +423,9 @@ fn encode_info_for_fn(ecx: @encode_ctxt, ebml_w: ebml::writer,
         encode_family(ebml_w, purity_fn_family(decl.purity));
         encode_type_param_bounds(ebml_w, ecx, tps);
         let its_ty = node_id_to_type(ecx.tcx, id);
-        debug!{"fn name = %s ty = %s its node id = %d",
+        debug!("fn name = %s ty = %s its node id = %d",
                ecx.tcx.sess.str_of(ident),
-               util::ppaux::ty_to_str(ecx.tcx, its_ty), id};
+               util::ppaux::ty_to_str(ecx.tcx, its_ty), id);
         encode_type(ecx, ebml_w, its_ty);
         encode_path(ecx, ebml_w, path, ast_map::path_name(ident));
         match item {
@@ -443,8 +443,8 @@ fn encode_info_for_method(ecx: @encode_ctxt, ebml_w: ebml::writer,
                           impl_path: ast_map::path, should_inline: bool,
                           parent_id: node_id,
                           m: @method, all_tps: ~[ty_param]) {
-    debug!{"encode_info_for_method: %d %s %u", m.id,
-           ecx.tcx.sess.str_of(m.ident), all_tps.len()};
+    debug!("encode_info_for_method: %d %s %u", m.id,
+           ecx.tcx.sess.str_of(m.ident), all_tps.len());
     ebml_w.start_tag(tag_items_data_item);
     encode_def_id(ebml_w, local_def(m.id));
     encode_family(ebml_w, purity_fn_family(m.decl.purity));
@@ -668,8 +668,8 @@ fn add_to_index_(item: @item, ebml_w: ebml::writer,
 
         /* Encode the constructor */
         for struct_def.ctor.each |ctor| {
-            debug!{"encoding info for ctor %s %d",
-                   ecx.tcx.sess.str_of(item.ident), ctor.node.id};
+            debug!("encoding info for ctor %s %d",
+                   ecx.tcx.sess.str_of(item.ident), ctor.node.id);
             vec::push(*index, {
                 val: ctor.node.id,
                 pos: ebml_w.writer.tell()
index 24e6d3267cc02aa736ca53d12fda5790dc304036..726618911639eb78cd4dc37ea4c8cc580c3ea2cb 100644 (file)
@@ -62,7 +62,7 @@ fn get_target_lib_file_path(file: Path) -> Path {
     }
 
     let sysroot = get_sysroot(maybe_sysroot);
-    debug!{"using sysroot = %s", sysroot};
+    debug!("using sysroot = %s", sysroot);
     {sysroot: sysroot,
      addl_lib_search_paths: addl_lib_search_paths,
      target_triple: target_triple} as filesearch
@@ -71,16 +71,16 @@ fn get_target_lib_file_path(file: Path) -> Path {
 fn search<T: copy>(filesearch: filesearch, pick: pick<T>) -> option<T> {
     let mut rslt = none;
     for filesearch.lib_search_paths().each |lib_search_path| {
-        debug!{"searching %s", lib_search_path};
+        debug!("searching %s", lib_search_path);
         for os::list_dir_path(lib_search_path).each |path| {
-            debug!{"testing %s", path};
+            debug!("testing %s", path);
             let maybe_picked = pick(path);
             if option::is_some(maybe_picked) {
-                debug!{"picked %s", path};
+                debug!("picked %s", path);
                 rslt = maybe_picked;
                 break;
             } else {
-                debug!{"rejected %s", path};
+                debug!("rejected %s", path);
             }
         }
         if option::is_some(rslt) { break; }
@@ -168,7 +168,7 @@ fn get_cargo_lib_path_nearest() -> result<Path, ~str> {
 // The name of the directory rustc expects libraries to be located.
 // On Unix should be "lib", on windows "bin"
 fn libdir() -> ~str {
-   let libdir = env!{"CFG_LIBDIR"};
+   let libdir = env!("CFG_LIBDIR");
    if str::is_empty(libdir) {
       fail ~"rustc compiled without CFG_LIBDIR environment variable";
    }
index f330ad56947213b88e4f1774755b37c8da25b5c7..f010b7e9754dff5dee8bbac7acf7a1c646428fa1 100644 (file)
@@ -43,8 +43,8 @@ fn load_library_crate(cx: ctxt) -> {ident: ~str, data: @~[u8]} {
       some(t) => return t,
       none => {
         cx.diag.span_fatal(
-            cx.span, fmt!{"can't find crate for `%s`",
-                          *cx.intr.get(cx.ident)});
+            cx.span, fmt!("can't find crate for `%s`",
+                          *cx.intr.get(cx.ident)));
       }
     }
 }
@@ -74,27 +74,27 @@ fn find_library_crate_aux(cx: ctxt,
 
     let mut matches = ~[];
     filesearch::search(filesearch, |path| {
-        debug!{"inspecting file %s", path};
+        debug!("inspecting file %s", path);
         let f: ~str = path::basename(path);
         if !(str::starts_with(f, prefix) && str::ends_with(f, suffix)) {
-            debug!{"skipping %s, doesn't look like %s*%s", path, prefix,
-                   suffix};
+            debug!("skipping %s, doesn't look like %s*%s", path, prefix,
+                   suffix);
             option::none::<()>
         } else {
-            debug!{"%s is a candidate", path};
+            debug!("%s is a candidate", path);
             match get_metadata_section(cx.os, path) {
               option::some(cvec) => {
                 if !crate_matches(cvec, cx.metas, cx.hash) {
-                    debug!{"skipping %s, metadata doesn't match", path};
+                    debug!("skipping %s, metadata doesn't match", path);
                     option::none::<()>
                 } else {
-                    debug!{"found %s with matching metadata", path};
+                    debug!("found %s with matching metadata", path);
                     vec::push(matches, {ident: path, data: cvec});
                     option::none::<()>
                 }
               }
               _ => {
-                debug!{"could not load metadata for %s", path};
+                debug!("could not load metadata for %s", path);
                 option::none::<()>
               }
             }
@@ -107,10 +107,10 @@ fn find_library_crate_aux(cx: ctxt,
         some(matches[0])
     } else {
         cx.diag.span_err(
-            cx.span, fmt!{"multiple matching crates for `%s`", crate_name});
+            cx.span, fmt!("multiple matching crates for `%s`", crate_name));
         cx.diag.handler().note(~"candidates:");
         for matches.each |match_| {
-            cx.diag.handler().note(fmt!{"path: %s", match_.ident});
+            cx.diag.handler().note(fmt!("path: %s", match_.ident));
             let attrs = decoder::get_crate_attributes(match_.data);
             note_linkage_attrs(cx.intr, cx.diag, attrs);
         }
@@ -137,8 +137,8 @@ fn crate_name_from_metas(metas: ~[@ast::meta_item]) -> ~str {
 fn note_linkage_attrs(intr: ident_interner, diag: span_handler,
                       attrs: ~[ast::attribute]) {
     for attr::find_linkage_metas(attrs).each |mi| {
-        diag.handler().note(fmt!{"meta: %s",
-              pprust::meta_item_to_str(mi,intr)});
+        diag.handler().note(fmt!("meta: %s",
+              pprust::meta_item_to_str(mi,intr)));
     }
 }
 
@@ -156,8 +156,8 @@ fn crate_matches(crate_data: @~[u8], metas: ~[@ast::meta_item],
 fn metadata_matches(extern_metas: ~[@ast::meta_item],
                     local_metas: ~[@ast::meta_item]) -> bool {
 
-    debug!{"matching %u metadata requirements against %u items",
-           vec::len(local_metas), vec::len(extern_metas)};
+    debug!("matching %u metadata requirements against %u items",
+           vec::len(local_metas), vec::len(extern_metas));
 
     for local_metas.each |needed| {
         if !attr::contains(extern_metas, needed) {
index 3677dce74d8f56407ebe8574b0235d7fa43a50c2..e8cfe22f0bcfc85f29c10c047406bb96aae3565f 100644 (file)
@@ -308,16 +308,16 @@ fn parse_ty(st: @pstate, conv: conv_did) -> ty::t {
       }
       'B' => ty::mk_opaque_box(st.tcx),
       'a' => {
-          debug!{"saw a class"};
+          debug!("saw a class");
           assert (next(st) == '[');
-          debug!{"saw a ["};
+          debug!("saw a [");
           let did = parse_def(st, conv);
-          debug!{"parsed a def_id %?", did};
+          debug!("parsed a def_id %?", did);
           let substs = parse_substs(st, conv);
           assert (next(st) == ']');
           return ty::mk_class(st.tcx, did, substs);
       }
-      c => { error!{"unexpected char in type string: %c", c}; fail;}
+      c => { error!("unexpected char in type string: %c", c); fail;}
     }
 }
 
@@ -403,7 +403,7 @@ fn parse_def_id(buf: &[u8]) -> ast::def_id {
     let len = vec::len(buf);
     while colon_idx < len && buf[colon_idx] != ':' as u8 { colon_idx += 1u; }
     if colon_idx == len {
-        error!{"didn't find ':' when parsing def id"};
+        error!("didn't find ':' when parsing def id");
         fail;
     }
 
@@ -412,13 +412,13 @@ fn parse_def_id(buf: &[u8]) -> ast::def_id {
 
     let crate_num = match uint::parse_buf(crate_part, 10u) {
        some(cn) => cn as int,
-       none => fail (fmt!{"internal error: parse_def_id: crate number \
-                               expected, but found %?", crate_part})
+       none => fail (fmt!("internal error: parse_def_id: crate number \
+                               expected, but found %?", crate_part))
     };
     let def_num = match uint::parse_buf(def_part, 10u) {
        some(dn) => dn as int,
-       none => fail (fmt!{"internal error: parse_def_id: id expected, but \
-                               found %?", def_part})
+       none => fail (fmt!("internal error: parse_def_id: id expected, but \
+                               found %?", def_part))
     };
     return {crate: crate_num, node: def_num};
 }
index 4158656aa54886d5829fd731686ba4b1cf891304..f8c2b87a95a0c9cd83abb390ce1b5fd59ea71c9a 100644 (file)
@@ -298,15 +298,15 @@ fn enc_sty(w: io::Writer, cx: @ctxt, st: ty::sty) {
       ty::ty_opaque_closure_ptr(ty::ck_uniq) => w.write_str(&"C~"),
       ty::ty_opaque_box => w.write_char('B'),
       ty::ty_class(def, substs) => {
-          debug!{"~~~~ %s", ~"a["};
+          debug!("~~~~ %s", ~"a[");
           w.write_str(&"a[");
           let s = cx.ds(def);
-          debug!{"~~~~ %s", s};
+          debug!("~~~~ %s", s);
           w.write_str(s);
-          debug!{"~~~~ %s", ~"|"};
+          debug!("~~~~ %s", ~"|");
           w.write_char('|');
           enc_substs(w, cx, substs);
-          debug!{"~~~~ %s", ~"]"};
+          debug!("~~~~ %s", ~"]");
           w.write_char(']');
       }
     }
index f6008ead9395cdc69c37ea28981338a9ded66ce6..b8e097dc8e92fbf503724b612628afd41ccc4d50 100644 (file)
@@ -82,10 +82,10 @@ fn encode_inlined_item(ecx: @e::encode_ctxt,
                        path: ast_map::path,
                        ii: ast::inlined_item,
                        maps: maps) {
-    debug!{"> Encoding inlined item: %s::%s (%u)",
+    debug!("> Encoding inlined item: %s::%s (%u)",
            ast_map::path_to_str(path, ecx.tcx.sess.parse_sess.interner),
            ecx.tcx.sess.str_of(ii.ident()),
-           ebml_w.writer.tell()};
+           ebml_w.writer.tell());
 
     let id_range = ast_util::compute_id_range_for_inlined_item(ii);
     do ebml_w.wr_tag(c::tag_ast as uint) {
@@ -94,10 +94,10 @@ fn encode_inlined_item(ecx: @e::encode_ctxt,
         encode_side_tables_for_ii(ecx, maps, ebml_w, ii);
     }
 
-    debug!{"< Encoded inlined fn: %s::%s (%u)",
+    debug!("< Encoded inlined fn: %s::%s (%u)",
            ast_map::path_to_str(path, ecx.tcx.sess.parse_sess.interner),
            ecx.tcx.sess.str_of(ii.ident()),
-           ebml_w.writer.tell()};
+           ebml_w.writer.tell());
 }
 
 fn decode_inlined_item(cdata: cstore::crate_metadata,
@@ -109,8 +109,8 @@ fn decode_inlined_item(cdata: cstore::crate_metadata,
     match par_doc.opt_child(c::tag_ast) {
       none => none,
       some(ast_doc) => {
-        debug!{"> Decoding inlined fn: %s::?",
-               ast_map::path_to_str(path, tcx.sess.parse_sess.interner)};
+        debug!("> Decoding inlined fn: %s::?",
+               ast_map::path_to_str(path, tcx.sess.parse_sess.interner));
         let ast_dsr = ebml::ebml_deserializer(ast_doc);
         let from_id_range = ast_util::deserialize_id_range(ast_dsr);
         let to_id_range = reserve_id_range(dcx.tcx.sess, from_id_range);
@@ -121,15 +121,15 @@ fn decode_inlined_item(cdata: cstore::crate_metadata,
         let ii = renumber_ast(xcx, raw_ii);
         ast_map::map_decoded_item(tcx.sess.diagnostic(),
                                   dcx.tcx.items, path, ii);
-        debug!{"Fn named: %s", tcx.sess.str_of(ii.ident())};
+        debug!("Fn named: %s", tcx.sess.str_of(ii.ident()));
         decode_side_tables(xcx, ast_doc);
-        debug!{"< Decoded inlined fn: %s::%s",
+        debug!("< Decoded inlined fn: %s::%s",
                ast_map::path_to_str(path, tcx.sess.parse_sess.interner),
-               tcx.sess.str_of(ii.ident())};
+               tcx.sess.str_of(ii.ident()));
         match ii {
           ast::ii_item(i) => {
-            debug!{">>> DECODED ITEM >>>\n%s\n<<< DECODED ITEM <<<",
-                   syntax::print::pprust::item_to_str(i, tcx.sess.intr())};
+            debug!(">>> DECODED ITEM >>>\n%s\n<<< DECODED ITEM <<<",
+                   syntax::print::pprust::item_to_str(i, tcx.sess.intr()));
           }
           _ => { }
         }
@@ -650,7 +650,7 @@ fn encode_side_tables_for_id(ecx: @e::encode_ctxt,
                              id: ast::node_id) {
     let tcx = ecx.tcx;
 
-    debug!{"Encoding side tables for id %d", id};
+    debug!("Encoding side tables for id %d", id);
 
     do option::iter(tcx.def_map.find(id)) |def| {
         do ebml_w.tag(c::tag_table_def) {
@@ -838,9 +838,9 @@ fn decode_side_tables(xcx: extended_decode_ctxt,
         let id0 = entry_doc[c::tag_table_id as uint].as_int();
         let id = xcx.tr_id(id0);
 
-        debug!{">> Side table document with tag 0x%x \
+        debug!(">> Side table document with tag 0x%x \
                 found for id %d (orig %d)",
-               tag, id, id0};
+               tag, id, id0);
 
         if tag == (c::tag_table_mutbl as uint) {
             dcx.maps.mutbl_map.insert(id, ());
@@ -889,11 +889,11 @@ fn decode_side_tables(xcx: extended_decode_ctxt,
                 dcx.tcx.borrowings.insert(id, borrow);
             } else {
                 xcx.dcx.tcx.sess.bug(
-                    fmt!{"unknown tag found in side tables: %x", tag});
+                    fmt!("unknown tag found in side tables: %x", tag));
             }
         }
 
-        debug!{">< Side table doc loaded"};
+        debug!(">< Side table doc loaded");
     }
 }
 
@@ -947,8 +947,8 @@ fn roundtrip(in_item: @ast::item) {
     let out_str =
         io::with_str_writer(|w| ast::serialize_item(w, *out_item) );
 
-    debug!{"expected string: %s", exp_str};
-    debug!{"actual string  : %s", out_str};
+    debug!("expected string: %s", exp_str);
+    debug!("actual string  : %s", out_str);
 
     assert exp_str == out_str;
 }
index 83b8666f7c42739f6d4af694725751734d8ea244..6de28f3e31663b5c1ee9c46f16b59c9bc0c9945c 100644 (file)
@@ -255,16 +255,16 @@ fn check_crate(tcx: ty::ctxt,
 
     if tcx.sess.borrowck_stats() {
         io::println(~"--- borrowck stats ---");
-        io::println(fmt!{"paths requiring guarantees: %u",
-                        bccx.guaranteed_paths});
-        io::println(fmt!{"paths requiring loans     : %s",
-                         make_stat(bccx, bccx.loaned_paths_same)});
-        io::println(fmt!{"paths requiring imm loans : %s",
-                         make_stat(bccx, bccx.loaned_paths_imm)});
-        io::println(fmt!{"stable paths              : %s",
-                         make_stat(bccx, bccx.stable_paths)});
-        io::println(fmt!{"paths requiring purity    : %s",
-                         make_stat(bccx, bccx.req_pure_paths)});
+        io::println(fmt!("paths requiring guarantees: %u",
+                        bccx.guaranteed_paths));
+        io::println(fmt!("paths requiring loans     : %s",
+                         make_stat(bccx, bccx.loaned_paths_same)));
+        io::println(fmt!("paths requiring imm loans : %s",
+                         make_stat(bccx, bccx.loaned_paths_imm)));
+        io::println(fmt!("stable paths              : %s",
+                         make_stat(bccx, bccx.stable_paths)));
+        io::println(fmt!("paths requiring purity    : %s",
+                         make_stat(bccx, bccx.req_pure_paths)));
     }
 
     return (bccx.root_map, bccx.mutbl_map);
@@ -272,7 +272,7 @@ fn check_crate(tcx: ty::ctxt,
     fn make_stat(bccx: borrowck_ctxt, stat: uint) -> ~str {
         let stat_f = stat as float;
         let total = bccx.guaranteed_paths as float;
-        fmt!{"%u (%.0f%%)", stat  , stat_f * 100f / total}
+        fmt!("%u (%.0f%%)", stat  , stat_f * 100f / total)
     }
 }
 
@@ -412,8 +412,8 @@ fn report_if_err(bres: bckres<()>) {
     fn report(err: bckerr) {
         self.span_err(
             err.cmt.span,
-            fmt!{"illegal borrow: %s",
-                 self.bckerr_code_to_str(err.code)});
+            fmt!("illegal borrow: %s",
+                 self.bckerr_code_to_str(err.code)));
     }
 
     fn span_err(s: span, m: ~str) {
@@ -439,8 +439,8 @@ fn add_to_mutbl_map(cmt: cmt) {
     fn bckerr_code_to_str(code: bckerr_code) -> ~str {
         match code {
           err_mutbl(req, act) => {
-            fmt!{"creating %s alias to aliasable, %s memory",
-                 self.mut_to_str(req), self.mut_to_str(act)}
+            fmt!("creating %s alias to aliasable, %s memory",
+                 self.mut_to_str(req), self.mut_to_str(act))
           }
           err_mut_uniq => {
             ~"unique value in aliasable, mutable location"
@@ -455,16 +455,16 @@ fn bckerr_code_to_str(code: bckerr_code) -> ~str {
             ~"rooting is not permitted"
           }
           err_out_of_root_scope(super_scope, sub_scope) => {
-            fmt!{"managed value would have to be rooted for %s, \
+            fmt!("managed value would have to be rooted for %s, \
                   but can only be rooted for %s",
                   explain_region(self.tcx, sub_scope),
-                  explain_region(self.tcx, super_scope)}
+                  explain_region(self.tcx, super_scope))
           }
           err_out_of_scope(super_scope, sub_scope) => {
-            fmt!{"borrowed pointer must be valid for %s, \
+            fmt!("borrowed pointer must be valid for %s, \
                   but the borrowed value is only valid for %s",
                   explain_region(self.tcx, sub_scope),
-                  explain_region(self.tcx, super_scope)}
+                  explain_region(self.tcx, super_scope))
           }
         }
     }
index de6d0621b35df96f737c89acf10c9348cbde817b..885d8a65046e1a432832fc1eae09efd818095767 100644 (file)
@@ -156,12 +156,12 @@ fn check_pure_callee_or_arg(pc: purity_cause,
                                 callee_span: span) {
         let tcx = self.tcx();
 
-        debug!{"check_pure_callee_or_arg(pc=%?, expr=%?, \
+        debug!("check_pure_callee_or_arg(pc=%?, expr=%?, \
                 callee_id=%d, ty=%s)",
                pc,
                opt_expr.map(|e| pprust::expr_to_str(e, tcx.sess.intr()) ),
                callee_id,
-               ty_to_str(self.tcx(), ty::node_id_to_type(tcx, callee_id))};
+               ty_to_str(self.tcx(), ty::node_id_to_type(tcx, callee_id)));
 
         // Purity rules: an expr B is a legal callee or argument to a
         // call within a pure function A if at least one of the
@@ -204,8 +204,8 @@ fn check_pure_callee_or_arg(pc: purity_cause,
               ast::impure_fn | ast::unsafe_fn | ast::extern_fn => {
                 self.report_purity_error(
                     pc, callee_span,
-                    fmt!{"access to %s function",
-                         pprust::purity_to_str(fn_ty.purity)});
+                    fmt!("access to %s function",
+                         pprust::purity_to_str(fn_ty.purity)));
               }
             }
           }
@@ -256,14 +256,14 @@ fn check_for_conflicting_loans(scope_id: ast::node_id) {
                       (m_mutbl, m_imm) | (m_imm, m_mutbl) => {
                         self.bccx.span_err(
                             new_loan.cmt.span,
-                            fmt!{"loan of %s as %s \
+                            fmt!("loan of %s as %s \
                                   conflicts with prior loan",
                                  self.bccx.cmt_to_str(new_loan.cmt),
-                                 self.bccx.mut_to_str(new_loan.mutbl)});
+                                 self.bccx.mut_to_str(new_loan.mutbl)));
                         self.bccx.span_note(
                             old_loan.cmt.span,
-                            fmt!{"prior loan as %s granted here",
-                                 self.bccx.mut_to_str(old_loan.mutbl)});
+                            fmt!("prior loan as %s granted here",
+                                 self.bccx.mut_to_str(old_loan.mutbl)));
                       }
                     }
                 }
@@ -293,8 +293,8 @@ fn is_self_field(cmt: cmt) -> bool {
     fn check_assignment(at: assignment_type, ex: @ast::expr) {
         let cmt = self.bccx.cat_expr(ex);
 
-        debug!{"check_assignment(cmt=%s)",
-               self.bccx.cmt_to_repr(cmt)};
+        debug!("check_assignment(cmt=%s)",
+               self.bccx.cmt_to_repr(cmt));
 
         if self.in_ctor && self.is_self_field(cmt)
             && at.checked_by_liveness() {
@@ -375,12 +375,12 @@ fn check_for_loan_conflicting_with_assignment(
               m_imm => {
                 self.bccx.span_err(
                     ex.span,
-                    fmt!{"%s prohibited due to outstanding loan",
-                         at.ing_form(self.bccx.cmt_to_str(cmt))});
+                    fmt!("%s prohibited due to outstanding loan",
+                         at.ing_form(self.bccx.cmt_to_str(cmt))));
                 self.bccx.span_note(
                     loan.cmt.span,
-                    fmt!{"loan of %s granted here",
-                         self.bccx.cmt_to_str(loan.cmt)});
+                    fmt!("loan of %s granted here",
+                         self.bccx.cmt_to_str(loan.cmt)));
                 return;
               }
             }
@@ -407,17 +407,17 @@ fn report_purity_error(pc: purity_cause, sp: span, msg: ~str) {
           pc_pure_fn => {
             self.tcx().sess.span_err(
                 sp,
-                fmt!{"%s prohibited in pure context", msg});
+                fmt!("%s prohibited in pure context", msg));
           }
           pc_cmt(e) => {
             if self.reported.insert(e.cmt.id, ()) {
                 self.tcx().sess.span_err(
                     e.cmt.span,
-                    fmt!{"illegal borrow unless pure: %s",
-                         self.bccx.bckerr_code_to_str(e.code)});
+                    fmt!("illegal borrow unless pure: %s",
+                         self.bccx.bckerr_code_to_str(e.code)));
                 self.tcx().sess.span_note(
                     sp,
-                    fmt!{"impure due to %s", msg});
+                    fmt!("impure due to %s", msg));
             }
           }
         }
@@ -429,8 +429,8 @@ fn check_move_out(ex: @ast::expr) {
     }
 
     fn check_move_out_from_cmt(cmt: cmt) {
-        debug!{"check_move_out_from_cmt(cmt=%s)",
-               self.bccx.cmt_to_repr(cmt)};
+        debug!("check_move_out_from_cmt(cmt=%s)",
+               self.bccx.cmt_to_repr(cmt));
 
         match cmt.cat {
           // Rvalues, locals, and arguments can be moved:
@@ -447,7 +447,7 @@ fn check_move_out_from_cmt(cmt: cmt) {
           _ => {
             self.bccx.span_err(
                 cmt.span,
-                fmt!{"moving out of %s", self.bccx.cmt_to_str(cmt)});
+                fmt!("moving out of %s", self.bccx.cmt_to_str(cmt)));
             return;
           }
         }
@@ -462,12 +462,12 @@ fn check_move_out_from_cmt(cmt: cmt) {
         for self.walk_loans_of(cmt.id, lp) |loan| {
             self.bccx.span_err(
                 cmt.span,
-                fmt!{"moving out of %s prohibited due to outstanding loan",
-                     self.bccx.cmt_to_str(cmt)});
+                fmt!("moving out of %s prohibited due to outstanding loan",
+                     self.bccx.cmt_to_str(cmt)));
             self.bccx.span_note(
                 loan.cmt.span,
-                fmt!{"loan of %s granted here",
-                     self.bccx.cmt_to_str(loan.cmt)});
+                fmt!("loan of %s granted here",
+                     self.bccx.cmt_to_str(loan.cmt)));
             return;
         }
     }
@@ -482,8 +482,8 @@ fn check_last_use(expr: @ast::expr) {
           some(lp) => lp
         };
         for self.walk_loans_of(cmt.id, lp) |_loan| {
-            debug!{"Removing last use entry %? due to outstanding loan",
-                   expr.id};
+            debug!("Removing last use entry %? due to outstanding loan",
+                   expr.id);
             self.bccx.last_use_map.remove(expr.id);
             return;
         }
@@ -527,7 +527,7 @@ fn check_loans_in_fn(fk: visit::fn_kind, decl: ast::fn_decl, body: ast::blk,
                      sp: span, id: ast::node_id, &&self: check_loan_ctxt,
                      visitor: visit::vt<check_loan_ctxt>) {
 
-    debug!{"purity on entry=%?", copy self.declared_purity};
+    debug!("purity on entry=%?", copy self.declared_purity);
     do save_and_restore(self.in_ctor) {
         do save_and_restore(self.declared_purity) {
             do save_and_restore(self.fn_args) {
@@ -563,7 +563,7 @@ fn check_loans_in_fn(fk: visit::fn_kind, decl: ast::fn_decl, body: ast::blk,
             }
         }
     }
-    debug!{"purity on exit=%?", copy self.declared_purity};
+    debug!("purity on exit=%?", copy self.declared_purity);
 }
 
 fn check_loans_in_local(local: @ast::local,
index 31ef79aa616ea4717472a74b4f719d8d07e34aca..648d7f1e9b59ac8777076cf20fd1fa8347035d70 100644 (file)
@@ -90,8 +90,8 @@ fn req_loans_in_expr(ex: @ast::expr,
     let tcx = bccx.tcx;
     let old_root_ub = self.root_ub;
 
-    debug!{"req_loans_in_expr(ex=%s)",
-           pprust::expr_to_str(ex, tcx.sess.intr())};
+    debug!("req_loans_in_expr(ex=%s)",
+           pprust::expr_to_str(ex, tcx.sess.intr()));
 
     // If this expression is borrowed, have to ensure it remains valid:
     for tcx.borrowings.find(ex.id).each |borrow| {
@@ -257,10 +257,10 @@ fn guarantee_valid(cmt: cmt,
 
         self.bccx.guaranteed_paths += 1;
 
-        debug!{"guarantee_valid(cmt=%s, req_mutbl=%s, scope_r=%s)",
+        debug!("guarantee_valid(cmt=%s, req_mutbl=%s, scope_r=%s)",
                self.bccx.cmt_to_repr(cmt),
                self.bccx.mut_to_str(req_mutbl),
-               region_to_str(self.tcx(), scope_r)};
+               region_to_str(self.tcx(), scope_r));
         let _i = indenter();
 
         match cmt.lp {
@@ -289,7 +289,7 @@ fn guarantee_valid(cmt: cmt,
                         if self.tcx().sess.borrowck_note_loan() {
                             self.bccx.span_note(
                                 cmt.span,
-                                fmt!{"immutable loan required"});
+                                fmt!("immutable loan required"));
                         }
                     } else {
                         self.bccx.loaned_paths_same += 1;
@@ -343,7 +343,7 @@ fn guarantee_valid(cmt: cmt,
                     if self.tcx().sess.borrowck_note_pure() {
                         self.bccx.span_note(
                             cmt.span,
-                            fmt!{"purity required"});
+                            fmt!("purity required"));
                     }
                   }
                   _ => {
index 66b786ca791c01b575dccdb3be99c4088b756e25..07d1a00d61d31a2edda0b47dd25347ecc2af331e 100644 (file)
@@ -57,9 +57,9 @@ fn ok_with_loan_of(cmt: cmt,
     }
 
     fn loan(cmt: cmt, req_mutbl: ast::mutability) -> bckres<()> {
-        debug!{"loan(%s, %s)",
+        debug!("loan(%s, %s)",
                self.bccx.cmt_to_repr(cmt),
-               self.bccx.mut_to_str(req_mutbl)};
+               self.bccx.mut_to_str(req_mutbl));
         let _i = indenter();
 
         // see stable() above; should only be called when `cmt` is lendable
index 7b3b20db26978cf75602688d018bc027cee0b0e7..4aca2856f691639a181c5a34ae90af0a38765800 100644 (file)
@@ -58,9 +58,9 @@ enum preserve_ctxt = {
     fn tcx() -> ty::ctxt { self.bccx.tcx }
 
     fn preserve(cmt: cmt) -> bckres<preserve_condition> {
-        debug!{"preserve(cmt=%s, root_ub=%?, root_managed_data=%b)",
+        debug!("preserve(cmt=%s, root_ub=%?, root_managed_data=%b)",
                self.bccx.cmt_to_repr(cmt), self.root_ub,
-               self.root_managed_data};
+               self.root_managed_data);
         let _i = indenter();
 
         match cmt.cat {
@@ -155,7 +155,7 @@ fn preserve(cmt: cmt) -> bckres<preserve_condition> {
             // otherwise we have no guarantee the pointer will stay
             // live, so we must root the pointer (i.e., inc the ref
             // count) for the duration of the loan.
-            debug!{"base.mutbl = %?", self.bccx.mut_to_str(base.mutbl)};
+            debug!("base.mutbl = %?", self.bccx.mut_to_str(base.mutbl));
             if base.mutbl == m_imm {
                 let non_rooting_ctxt =
                     preserve_ctxt({root_managed_data: false with **self});
@@ -164,12 +164,12 @@ fn preserve(cmt: cmt) -> bckres<preserve_condition> {
                     ok(pc_ok)
                   }
                   ok(pc_if_pure(_)) => {
-                    debug!{"must root @T, otherwise purity req'd"};
+                    debug!("must root @T, otherwise purity req'd");
                     self.attempt_root(cmt, base, derefs)
                   }
                   err(e) => {
-                    debug!{"must root @T, err: %s",
-                           self.bccx.bckerr_code_to_str(e.code)};
+                    debug!("must root @T, err: %s",
+                           self.bccx.bckerr_code_to_str(e.code));
                     self.attempt_root(cmt, base, derefs)
                   }
                 }
index 73c2a46f1fd4f5413a27740f1ad0283b43310126..9bc5955a6d966ee08cefa01cfb706b77a08ff034 100644 (file)
@@ -43,16 +43,16 @@ fn check_capture_clause(tcx: ty::ctxt,
         if !vec::any(*freevars, |fv| fv.def == cap_def ) {
             tcx.sess.span_warn(
                 cap_item.span,
-                fmt!{"captured variable `%s` not used in closure",
-                     tcx.sess.str_of(cap_item.name)});
+                fmt!("captured variable `%s` not used in closure",
+                     tcx.sess.str_of(cap_item.name)));
         }
 
         let cap_def_id = ast_util::def_id_of_def(cap_def).node;
         if !seen_defs.insert(cap_def_id, ()) {
             tcx.sess.span_err(
                 cap_item.span,
-                fmt!{"variable `%s` captured more than once",
-                     tcx.sess.str_of(cap_item.name)});
+                fmt!("variable `%s` captured more than once",
+                     tcx.sess.str_of(cap_item.name)));
         }
     }
 }
@@ -67,8 +67,8 @@ fn compute_capture_vars(tcx: ty::ctxt,
     // first add entries for anything explicitly named in the cap clause
 
     for (*cap_clause).each |cap_item| {
-        debug!{"Doing capture var: %s (%?)",
-               tcx.sess.str_of(cap_item.name), cap_item.id};
+        debug!("Doing capture var: %s (%?)",
+               tcx.sess.str_of(cap_item.name), cap_item.id);
 
         let cap_def = tcx.def_map.get(cap_item.id);
         let cap_def_id = ast_util::def_id_of_def(cap_def).node;
index 8d2f87734bf81ff1b14c4491079056b8f9d63759..35e0ae24065f9d54d4d1e3dc8a194130890a16e8 100644 (file)
@@ -214,7 +214,7 @@ fn check_block(b: blk, cx: ctx, v: visit::vt<ctx>) {
 }
 
 fn check_expr(e: @expr, cx: ctx, v: visit::vt<ctx>) {
-    debug!{"kind::check_expr(%s)", expr_to_str(e, cx.tcx.sess.intr())};
+    debug!("kind::check_expr(%s)", expr_to_str(e, cx.tcx.sess.intr()));
 
     // Handle any kind bounds on type parameters
     do option::iter(cx.tcx.node_type_substs.find(e.id)) |ts| {
@@ -433,7 +433,7 @@ fn check_imm_free_var(cx: ctx, def: def, sp: span) {
       _ => {
         cx.tcx.sess.span_bug(
             sp,
-            fmt!{"unknown def for free variable: %?", def});
+            fmt!("unknown def for free variable: %?", def));
       }
     }
 }
@@ -524,7 +524,7 @@ fn check_cast_for_escaping_regions(
       some(ty::re_bound(*)) | some(ty::re_var(*)) => {
         cx.tcx.sess.span_bug(
             source.span,
-            fmt!{"bad region found in kind: %?", target_substs.self_r});
+            fmt!("bad region found in kind: %?", target_substs.self_r));
       }
     }
 
index 26360b5b82c9a2c7d27237e930a6f70f056d9b4d..f85dc4c73245531f9e309175cc6d30cd2ac81c6c 100644 (file)
@@ -126,8 +126,8 @@ fn match_and_collect_item(item_def_id: def_id, key: ~str, value: ~str) {
                     some(original_def_id)
                             if original_def_id != item_def_id => {
 
-                        self.session.err(fmt!{"duplicate entry for `%s`",
-                                              value});
+                        self.session.err(fmt!("duplicate entry for `%s`",
+                                              value));
                     }
                     some(_) | none => {
                         // OK.
@@ -185,7 +185,7 @@ fn check_completeness() {
         for self.item_refs.each |key, item_ref| {
             match copy *item_ref {
                 none => {
-                    self.session.err(fmt!{"no item found for `%s`", key});
+                    self.session.err(fmt!("no item found for `%s`", key));
                 }
                 some(did) => {
                     // OK.
index d2d103952f0fadacb5828fcb83e742a1c117db52..1137ec47cdde0fd36b03276eb6e75afa45b725ea 100644 (file)
@@ -251,8 +251,8 @@ fn with_lint_attrs(attrs: ~[ast::attribute], f: fn(ctxt)) {
                 self.span_lint(
                     new_ctxt.get_level(unrecognized_lint),
                     meta.span,
-                    fmt!{"unknown `%s` attribute: `%s`",
-                         level_to_str(level), lintname});
+                    fmt!("unknown `%s` attribute: `%s`",
+                         level_to_str(level), lintname));
               }
               some(lint) => {
 
@@ -261,9 +261,9 @@ fn with_lint_attrs(attrs: ~[ast::attribute], f: fn(ctxt)) {
                     self.span_lint(
                         forbid,
                         meta.span,
-                        fmt!{"%s(%s) overruled by outer forbid(%s)",
+                        fmt!("%s(%s) overruled by outer forbid(%s)",
                              level_to_str(level),
-                             lintname, lintname});
+                             lintname, lintname));
                 }
 
                 // we do multiple unneeded copies of the
@@ -486,7 +486,7 @@ fn check_case(cx: ty::ctxt, ident: ast::ident,
 }
 
 fn check_pat(tcx: ty::ctxt, pat: @ast::pat) {
-    debug!{"lint check_pat pat=%s", pat_to_str(pat, tcx.sess.intr())};
+    debug!("lint check_pat pat=%s", pat_to_str(pat, tcx.sess.intr()));
 
     do pat_bindings(tcx.def_map, pat) |binding_mode, id, span, path| {
         match binding_mode {
@@ -498,8 +498,8 @@ fn check_pat(tcx: ty::ctxt, pat: @ast::pat) {
                 tcx.sess.span_lint(
                     deprecated_pattern, id, id,
                     span,
-                    fmt!{"binding `%s` should use ref or copy mode",
-                         tcx.sess.str_of(path_to_ident(path))});
+                    fmt!("binding `%s` should use ref or copy mode",
+                         tcx.sess.str_of(path_to_ident(path))));
             }
           }
         }
@@ -508,7 +508,7 @@ fn check_pat(tcx: ty::ctxt, pat: @ast::pat) {
 
 fn check_fn(tcx: ty::ctxt, fk: visit::fn_kind, decl: ast::fn_decl,
             _body: ast::blk, span: span, id: ast::node_id) {
-    debug!{"lint check_fn fk=%? id=%?", fk, id};
+    debug!("lint check_fn fk=%? id=%?", fk, id);
 
     // don't complain about blocks, since they tend to get their modes
     // specified from the outside
@@ -523,10 +523,10 @@ fn check_fn(tcx: ty::ctxt, fk: visit::fn_kind, decl: ast::fn_decl,
         let mut counter = 0;
         do vec::iter2(fn_ty.inputs, decl.inputs) |arg_ty, arg_ast| {
             counter += 1;
-            debug!{"arg %d, ty=%s, mode=%s",
+            debug!("arg %d, ty=%s, mode=%s",
                    counter,
                    ty_to_str(tcx, arg_ty.ty),
-                   mode_to_str(arg_ast.mode)};
+                   mode_to_str(arg_ast.mode));
             match arg_ast.mode {
               ast::expl(ast::by_copy) => {
                 /* always allow by-copy */
@@ -536,7 +536,7 @@ fn check_fn(tcx: ty::ctxt, fk: visit::fn_kind, decl: ast::fn_decl,
                 tcx.sess.span_lint(
                     deprecated_mode, id, id,
                     span,
-                    fmt!{"argument %d uses an explicit mode", counter});
+                    fmt!("argument %d uses an explicit mode", counter));
               }
 
               ast::infer(_) => {
@@ -545,9 +545,9 @@ fn check_fn(tcx: ty::ctxt, fk: visit::fn_kind, decl: ast::fn_decl,
                     tcx.sess.span_lint(
                         deprecated_mode, id, id,
                         span,
-                        fmt!{"argument %d uses the default mode \
+                        fmt!("argument %d uses the default mode \
                               but shouldn't",
-                             counter});
+                             counter));
                 }
               }
             }
index 67e2d4a3cefefc49ea1b59c7b3e8052f65d0fa13..2a0e6799574cbcd9ef7446890d97bc3043a39b15 100644 (file)
@@ -153,11 +153,11 @@ fn check_crate(tcx: ty::ctxt,
 }
 
 impl live_node: to_str::ToStr {
-    fn to_str() -> ~str { fmt!{"ln(%u)", *self} }
+    fn to_str() -> ~str { fmt!("ln(%u)", *self) }
 }
 
 impl variable: to_str::ToStr {
-    fn to_str() -> ~str { fmt!{"v(%u)", *self} }
+    fn to_str() -> ~str { fmt!("v(%u)", *self) }
 }
 
 // ______________________________________________________________________
@@ -243,7 +243,7 @@ fn add_live_node(lnk: live_node_kind) -> live_node {
         vec::push(self.lnks, lnk);
         self.num_live_nodes += 1u;
 
-        debug!{"%s is of kind %?", ln.to_str(), lnk};
+        debug!("%s is of kind %?", ln.to_str(), lnk);
 
         ln
     }
@@ -252,7 +252,7 @@ fn add_live_node_for_node(node_id: node_id, lnk: live_node_kind) {
         let ln = self.add_live_node(lnk);
         self.live_node_map.insert(node_id, ln);
 
-        debug!{"%s is node %d", ln.to_str(), node_id};
+        debug!("%s is node %d", ln.to_str(), node_id);
     }
 
     fn add_variable(vk: var_kind) -> variable {
@@ -271,7 +271,7 @@ fn add_variable(vk: var_kind) -> variable {
           }
         }
 
-        debug!{"%s is %?", v.to_str(), vk};
+        debug!("%s is %?", v.to_str(), vk);
 
         v
     }
@@ -281,7 +281,7 @@ fn variable(node_id: node_id, span: span) -> variable {
           some(var) => var,
           none => {
             self.tcx.sess.span_bug(
-                span, fmt!{"No variable registered for id %d", node_id});
+                span, fmt!("No variable registered for id %d", node_id));
           }
         }
     }
@@ -314,7 +314,7 @@ fn lnk(ln: live_node) -> live_node_kind {
 
     fn add_last_use(expr_id: node_id, var: variable) {
         let vk = self.var_kinds[*var];
-        debug!{"Node %d is a last use of variable %?", expr_id, vk};
+        debug!("Node %d is a last use of variable %?", expr_id, vk);
         match vk {
           vk_arg(id, name, by_move) |
           vk_arg(id, name, by_copy) |
@@ -332,7 +332,7 @@ fn add_last_use(expr_id: node_id, var: variable) {
           }
           vk_arg(_, _, by_ref) | vk_arg(_, _, by_mutbl_ref) |
           vk_arg(_, _, by_val) | vk_self | vk_field(_) | vk_implicit_ret => {
-            debug!{"--but it is not owned"};
+            debug!("--but it is not owned");
           }
         }
     }
@@ -340,17 +340,17 @@ fn add_last_use(expr_id: node_id, var: variable) {
 
 fn visit_fn(fk: visit::fn_kind, decl: fn_decl, body: blk,
             sp: span, id: node_id, &&self: @ir_maps, v: vt<@ir_maps>) {
-    debug!{"visit_fn: id=%d", id};
+    debug!("visit_fn: id=%d", id);
     let _i = util::common::indenter();
 
     // swap in a new set of IR maps for this function body:
     let fn_maps = @ir_maps(self.tcx, self.method_map,
                            self.last_use_map);
 
-    debug!{"creating fn_maps: %x", ptr::addr_of(*fn_maps) as uint};
+    debug!("creating fn_maps: %x", ptr::addr_of(*fn_maps) as uint);
 
     for decl.inputs.each |arg| {
-        debug!{"adding argument %d", arg.id};
+        debug!("adding argument %d", arg.id);
         let mode = ty::resolved_mode(self.tcx, arg.mode);
         (*fn_maps).add_variable(vk_arg(arg.id, arg.ident, mode));
     };
@@ -405,7 +405,7 @@ fn add_class_fields(self: @ir_maps, did: def_id) {
 fn visit_local(local: @local, &&self: @ir_maps, vt: vt<@ir_maps>) {
     let def_map = self.tcx.def_map;
     do pat_util::pat_bindings(def_map, local.node.pat) |_bm, p_id, sp, path| {
-        debug!{"adding local variable %d", p_id};
+        debug!("adding local variable %d", p_id);
         let name = ast_util::path_to_ident(path);
         (*self).add_live_node_for_node(p_id, lnk_vdef(sp));
         (*self).add_variable(vk_local(p_id, name));
@@ -418,7 +418,7 @@ fn visit_expr(expr: @expr, &&self: @ir_maps, vt: vt<@ir_maps>) {
       // live nodes required for uses or definitions of variables:
       expr_path(_) => {
         let def = self.tcx.def_map.get(expr.id);
-        debug!{"expr %d: path that leads to %?", expr.id, def};
+        debug!("expr %d: path that leads to %?", expr.id, def);
         if relevant_def(def).is_some() {
             (*self).add_live_node_for_node(expr.id, lnk_expr(expr.span));
         }
@@ -541,8 +541,8 @@ fn live_node(node_id: node_id, span: span) -> live_node {
             // code have to agree about which AST nodes are worth
             // creating liveness nodes for.
             self.tcx.sess.span_bug(
-                span, fmt!{"No live node registered for node %d",
-                           node_id});
+                span, fmt!("No live node registered for node %d",
+                           node_id));
           }
         }
     }
@@ -665,7 +665,7 @@ fn ln_str(ln: live_node) -> ~str {
             wr.write_str(~"[ln(");
             wr.write_uint(*ln);
             wr.write_str(~") of kind ");
-            wr.write_str(fmt!{"%?", copy self.ir.lnks[*ln]});
+            wr.write_str(fmt!("%?", copy self.ir.lnks[*ln]));
             wr.write_str(~" reads");
             self.write_vars(wr, ln, |idx| self.users[idx].reader );
             wr.write_str(~"  writes");
@@ -696,8 +696,8 @@ fn init_from_succ(ln: live_node, succ_ln: live_node) {
         self.indices2(ln, succ_ln, |idx, succ_idx| {
             self.users[idx] = self.users[succ_idx]
         });
-        debug!{"init_from_succ(ln=%s, succ=%s)",
-               self.ln_str(ln), self.ln_str(succ_ln)};
+        debug!("init_from_succ(ln=%s, succ=%s)",
+               self.ln_str(ln), self.ln_str(succ_ln));
     }
 
     fn merge_from_succ(ln: live_node, succ_ln: live_node,
@@ -716,8 +716,8 @@ fn merge_from_succ(ln: live_node, succ_ln: live_node,
             }
         }
 
-        debug!{"merge_from_succ(ln=%s, succ=%s, first_merge=%b, changed=%b)",
-               ln.to_str(), self.ln_str(succ_ln), first_merge, changed};
+        debug!("merge_from_succ(ln=%s, succ=%s, first_merge=%b, changed=%b)",
+               ln.to_str(), self.ln_str(succ_ln), first_merge, changed);
         return changed;
 
         fn copy_if_invalid(src: live_node, &dst: live_node) -> bool {
@@ -739,8 +739,8 @@ fn define(writer: live_node, var: variable) {
         self.users[idx].reader = invalid_node();
         self.users[idx].writer = invalid_node();
 
-        debug!{"%s defines %s (idx=%u): %s", writer.to_str(), var.to_str(),
-               idx, self.ln_str(writer)};
+        debug!("%s defines %s (idx=%u): %s", writer.to_str(), var.to_str(),
+               idx, self.ln_str(writer));
     }
 
     // Either read, write, or both depending on the acc bitset
@@ -763,8 +763,8 @@ fn acc(ln: live_node, var: variable, acc: uint) {
             self.users[idx].used = true;
         }
 
-        debug!{"%s accesses[%x] %s: %s",
-               ln.to_str(), acc, var.to_str(), self.ln_str(ln)};
+        debug!("%s accesses[%x] %s: %s",
+               ln.to_str(), acc, var.to_str(), self.ln_str(ln));
     }
 
     // _______________________________________________________________________
@@ -779,14 +779,14 @@ fn compute(decl: fn_decl, body: blk) -> live_node {
             });
 
         // hack to skip the loop unless #debug is enabled:
-        debug!{"^^ liveness computation results for body %d (entry=%s)",
+        debug!("^^ liveness computation results for body %d (entry=%s)",
                {
                    for uint::range(0u, self.ir.num_live_nodes) |ln_idx| {
                        #debug["%s", self.ln_str(live_node(ln_idx))];
                    }
                    body.node.id
                },
-               entry_ln.to_str()};
+               entry_ln.to_str());
 
         entry_ln
     }
@@ -1372,7 +1372,7 @@ fn check_local(local: @local, &&self: @liveness, vt: vt<@liveness>) {
         // No initializer: the variable might be unused; if not, it
         // should not be live at this point.
 
-        debug!{"check_local() with no initializer"};
+        debug!("check_local() with no initializer");
         do (*self).pat_bindings(local.node.pat) |ln, var, sp| {
             if !self.warn_about_unused(sp, ln, var) {
                 match (*self).live_on_exit(ln, var) {
@@ -1492,8 +1492,8 @@ fn check_fields(sp: span, entry_ln: live_node) {
               none => { /* ok */ }
               some(lnk_exit) => {
                 self.tcx.sess.span_err(
-                    sp, fmt!{"field `self.%s` is never initialized",
-                             self.tcx.sess.str_of(nm)});
+                    sp, fmt!("field `self.%s` is never initialized",
+                             self.tcx.sess.str_of(nm)));
               }
               some(lnk) => {
                 self.report_illegal_read(
@@ -1531,8 +1531,8 @@ fn check_ret(id: node_id, sp: span, fk: visit::fn_kind,
     }
 
     fn check_move_from_var(span: span, ln: live_node, var: variable) {
-        debug!{"check_move_from_var(%s, %s)",
-               ln.to_str(), var.to_str()};
+        debug!("check_move_from_var(%s, %s)",
+               ln.to_str(), var.to_str());
 
         match (*self).live_on_exit(ln, var) {
           none => {}
@@ -1548,8 +1548,8 @@ fn consider_last_use(expr: @expr, ln: live_node, var: variable) {
     }
 
     fn check_move_from_expr(expr: @expr, vt: vt<@liveness>) {
-        debug!{"check_move_from_expr(node %d: %s)",
-               expr.id, expr_to_str(expr, self.tcx.sess.intr())};
+        debug!("check_move_from_expr(node %d: %s)",
+               expr.id, expr_to_str(expr, self.tcx.sess.intr()));
 
         if self.ir.method_map.contains_key(expr.id) {
             // actually an rvalue, since this calls a method
@@ -1645,7 +1645,7 @@ fn check_for_reassignment(ln: live_node, var: variable,
           some(lnk) => {
             self.tcx.sess.span_bug(
                 orig_span,
-                fmt!{"illegal writer: %?", lnk});
+                fmt!("illegal writer: %?", lnk));
           }
           none => {}
         }
@@ -1664,15 +1664,15 @@ fn report_illegal_move(move_span: span,
               vk_arg(_, name, _) => {
                 self.tcx.sess.span_err(
                     move_span,
-                    fmt!{"illegal move from argument `%s`, which is not \
-                          copy or move mode", self.tcx.sess.str_of(name)});
+                    fmt!("illegal move from argument `%s`, which is not \
+                          copy or move mode", self.tcx.sess.str_of(name)));
                 return;
               }
               vk_field(name) => {
                 self.tcx.sess.span_err(
                     move_span,
-                    fmt!{"illegal move from field `%s`",
-                         self.tcx.sess.str_of(name)});
+                    fmt!("illegal move from field `%s`",
+                         self.tcx.sess.str_of(name)));
                 return;
               }
               vk_self => {
@@ -1685,8 +1685,8 @@ fn report_illegal_move(move_span: span,
               vk_local(*) | vk_implicit_ret => {
                 self.tcx.sess.span_bug(
                     move_span,
-                    fmt!{"illegal reader (%?) for `%?`",
-                         lnk, vk});
+                    fmt!("illegal reader (%?) for `%?`",
+                         lnk, vk));
               }
             }
         }
@@ -1713,18 +1713,18 @@ fn report_illegal_read(chk_span: span,
           lnk_freevar(span) => {
             self.tcx.sess.span_err(
                 span,
-                fmt!{"capture of %s: `%s`", msg, name});
+                fmt!("capture of %s: `%s`", msg, name));
           }
           lnk_expr(span) => {
             self.tcx.sess.span_err(
                 span,
-                fmt!{"use of %s: `%s`", msg, name});
+                fmt!("use of %s: `%s`", msg, name));
           }
           lnk_exit |
           lnk_vdef(_) => {
             self.tcx.sess.span_bug(
                 chk_span,
-                fmt!{"illegal reader: %?", lnk});
+                fmt!("illegal reader: %?", lnk));
           }
         }
     }
@@ -1781,11 +1781,11 @@ fn warn_about_unused(sp: span, ln: live_node, var: variable) -> bool {
 
                 if is_assigned {
                     self.tcx.sess.span_warn(
-                        sp, fmt!{"variable `%s` is assigned to, \
-                                  but never used", name});
+                        sp, fmt!("variable `%s` is assigned to, \
+                                  but never used", name));
                 } else {
                     self.tcx.sess.span_warn(
-                        sp, fmt!{"unused variable: `%s`", name});
+                        sp, fmt!("unused variable: `%s`", name));
                 }
             }
             return true;
@@ -1798,7 +1798,7 @@ fn warn_about_dead_assign(sp: span, ln: live_node, var: variable) {
             for self.should_warn(var).each |name| {
                 self.tcx.sess.span_warn(
                     sp,
-                    fmt!{"value assigned to `%s` is never read", name});
+                    fmt!("value assigned to `%s` is never read", name));
             }
         }
     }
index 7a14e9afe07874338e833d88fc1a84209a7913d8..7aa4f186d6802f7e275dc1c5d435f11338c5a442 100644 (file)
@@ -149,8 +149,8 @@ fn deref_kind(tcx: ty::ctxt, t: ty::t) -> deref_kind {
       some(k) => k,
       none => {
         tcx.sess.bug(
-            fmt!{"deref_cat() invoked on non-derefable type %s",
-                 ty_to_str(tcx, t)});
+            fmt!("deref_cat() invoked on non-derefable type %s",
+                 ty_to_str(tcx, t)));
       }
     }
 }
@@ -262,8 +262,8 @@ fn cat_borrow_of_expr(expr: @ast::expr) -> cmt {
     }
 
     fn cat_expr(expr: @ast::expr) -> cmt {
-        debug!{"cat_expr: id=%d expr=%s",
-               expr.id, pprust::expr_to_str(expr, self.tcx.sess.intr())};
+        debug!("cat_expr: id=%d expr=%s",
+               expr.id, pprust::expr_to_str(expr, self.tcx.sess.intr()));
 
         let tcx = self.tcx;
         let expr_ty = tcx.ty(expr);
@@ -279,8 +279,8 @@ fn cat_expr(expr: @ast::expr) -> cmt {
               none => {
                 tcx.sess.span_bug(
                     e_base.span,
-                    fmt!{"Explicit deref of non-derefable type `%s`",
-                         ty_to_str(tcx, tcx.ty(e_base))});
+                    fmt!("Explicit deref of non-derefable type `%s`",
+                         ty_to_str(tcx, tcx.ty(e_base))));
               }
             }
           }
@@ -468,9 +468,9 @@ fn cat_field<N:ast_node>(node: N, base_cmt: cmt,
           none => {
             self.tcx.sess.span_bug(
                 node.span(),
-                fmt!{"Cannot find field `%s` in type `%s`",
+                fmt!("Cannot find field `%s` in type `%s`",
                      self.tcx.sess.str_of(f_name),
-                     ty_to_str(self.tcx, base_cmt.ty)});
+                     ty_to_str(self.tcx, base_cmt.ty)));
           }
         };
         let m = self.inherited_mutability(base_cmt.mutbl, f_mutbl);
@@ -533,8 +533,8 @@ fn cat_index(expr: @ast::expr, base: @ast::expr) -> cmt {
           none => {
             self.tcx.sess.span_bug(
                 expr.span,
-                fmt!{"Explicit index of non-index type `%s`",
-                     ty_to_str(self.tcx, base_cmt.ty)});
+                fmt!("Explicit index of non-index type `%s`",
+                     ty_to_str(self.tcx, base_cmt.ty)));
           }
         };
 
@@ -655,9 +655,9 @@ fn cat_pattern(cmt: cmt, pat: @ast::pat, op: fn(cmt, @ast::pat)) {
 
         let _i = indenter();
         let tcx = self.tcx;
-        debug!{"cat_pattern: id=%d pat=%s cmt=%s",
+        debug!("cat_pattern: id=%d pat=%s cmt=%s",
                pat.id, pprust::pat_to_str(pat, tcx.sess.intr()),
-               self.cmt_to_repr(cmt)};
+               self.cmt_to_repr(cmt));
 
         match pat.node {
           ast::pat_wild => {
@@ -672,7 +672,7 @@ fn cat_pattern(cmt: cmt, pat: @ast::pat, op: fn(cmt, @ast::pat)) {
             let enum_did = match self.tcx.def_map.find(pat.id) {
               some(ast::def_variant(enum_did, _)) => enum_did,
               e => tcx.sess.span_bug(pat.span,
-                                     fmt!{"resolved to %?, not variant", e})
+                                     fmt!("resolved to %?, not variant", e))
             };
 
             for subpats.each |subpat| {
@@ -737,15 +737,15 @@ fn cat_to_repr(cat: categorization) -> ~str {
           cat_special(sk_heap_upvar) => ~"heap-upvar",
           cat_stack_upvar(_) => ~"stack-upvar",
           cat_rvalue => ~"rvalue",
-          cat_local(node_id) => fmt!{"local(%d)", node_id},
-          cat_binding(node_id) => fmt!{"binding(%d)", node_id},
-          cat_arg(node_id) => fmt!{"arg(%d)", node_id},
+          cat_local(node_id) => fmt!("local(%d)", node_id),
+          cat_binding(node_id) => fmt!("binding(%d)", node_id),
+          cat_arg(node_id) => fmt!("arg(%d)", node_id),
           cat_deref(cmt, derefs, ptr) => {
-            fmt!{"%s->(%s, %u)", self.cat_to_repr(cmt.cat),
-                 self.ptr_sigil(ptr), derefs}
+            fmt!("%s->(%s, %u)", self.cat_to_repr(cmt.cat),
+                 self.ptr_sigil(ptr), derefs)
           }
           cat_comp(cmt, comp) => {
-            fmt!{"%s.%s", self.cat_to_repr(cmt.cat), self.comp_to_repr(comp)}
+            fmt!("%s.%s", self.cat_to_repr(cmt.cat), self.comp_to_repr(comp))
           }
           cat_discr(cmt, _) => self.cat_to_repr(cmt.cat)
         }
@@ -780,29 +780,29 @@ fn comp_to_repr(comp: comp_kind) -> ~str {
     fn lp_to_str(lp: @loan_path) -> ~str {
         match *lp {
           lp_local(node_id) => {
-            fmt!{"local(%d)", node_id}
+            fmt!("local(%d)", node_id)
           }
           lp_arg(node_id) => {
-            fmt!{"arg(%d)", node_id}
+            fmt!("arg(%d)", node_id)
           }
           lp_deref(lp, ptr) => {
-            fmt!{"%s->(%s)", self.lp_to_str(lp),
-                 self.ptr_sigil(ptr)}
+            fmt!("%s->(%s)", self.lp_to_str(lp),
+                 self.ptr_sigil(ptr))
           }
           lp_comp(lp, comp) => {
-            fmt!{"%s.%s", self.lp_to_str(lp),
-                 self.comp_to_repr(comp)}
+            fmt!("%s.%s", self.lp_to_str(lp),
+                 self.comp_to_repr(comp))
           }
         }
     }
 
     fn cmt_to_repr(cmt: cmt) -> ~str {
-        fmt!{"{%s id:%d m:%s lp:%s ty:%s}",
+        fmt!("{%s id:%d m:%s lp:%s ty:%s}",
              self.cat_to_repr(cmt.cat),
              cmt.id,
              self.mut_to_str(cmt.mutbl),
              cmt.lp.map_default(~"none", |p| self.lp_to_str(p) ),
-             ty_to_str(self.tcx, cmt.ty)}
+             ty_to_str(self.tcx, cmt.ty))
     }
 
     fn cmt_to_str(cmt: cmt) -> ~str {
@@ -818,8 +818,8 @@ fn cmt_to_str(cmt: cmt) -> ~str {
           cat_local(_) => mut_str + ~" local variable",
           cat_binding(_) => ~"pattern binding",
           cat_arg(_) => ~"argument",
-          cat_deref(_, _, pk) => fmt!{"dereference of %s %s pointer",
-                                      mut_str, self.ptr_sigil(pk)},
+          cat_deref(_, _, pk) => fmt!("dereference of %s %s pointer",
+                                      mut_str, self.ptr_sigil(pk)),
           cat_stack_upvar(_) => {
             ~"captured outer " + mut_str + ~" variable in a stack closure"
           }
index aa2dc699940c0a52593712529109a2ac3b2677f5..01215eb5396da9c3551cb872ddfb13983908cbb2 100644 (file)
@@ -196,7 +196,7 @@ fn parent_id(cx: ctxt, span: span) -> ast::node_id {
 /// Records the current parent (if any) as the parent of `child_id`.
 fn record_parent(cx: ctxt, child_id: ast::node_id) {
     for cx.parent.each |parent_id| {
-        debug!{"parent of node %d is node %d", child_id, parent_id};
+        debug!("parent of node %d is node %d", child_id, parent_id);
         cx.region_map.insert(child_id, parent_id);
     }
 }
@@ -255,13 +255,13 @@ fn resolve_expr(expr: @ast::expr, cx: ctxt, visitor: visit::vt<ctxt>) {
     let mut new_cx = cx;
     match expr.node {
       ast::expr_call(*) => {
-        debug!{"node %d: %s", expr.id, pprust::expr_to_str(expr,
-                                                           cx.sess.intr())};
+        debug!("node %d: %s", expr.id, pprust::expr_to_str(expr,
+                                                           cx.sess.intr()));
         new_cx.parent = some(expr.id);
       }
       ast::expr_match(subexpr, _, _) => {
-        debug!{"node %d: %s", expr.id, pprust::expr_to_str(expr,
-                                                           cx.sess.intr())};
+        debug!("node %d: %s", expr.id, pprust::expr_to_str(expr,
+                                                           cx.sess.intr()));
         new_cx.parent = some(expr.id);
       }
       ast::expr_fn(_, _, _, cap_clause) |
@@ -314,9 +314,9 @@ fn resolve_fn(fk: visit::fn_kind, decl: ast::fn_decl, body: ast::blk,
       }
     };
 
-    debug!{"visiting fn with body %d. cx.parent: %? \
+    debug!("visiting fn with body %d. cx.parent: %? \
             fn_cx.parent: %?",
-           body.node.id, cx.parent, fn_cx.parent};
+           body.node.id, cx.parent, fn_cx.parent);
 
     for decl.inputs.each |input| {
         cx.region_map.insert(input.id, body.node.id);
@@ -441,10 +441,10 @@ fn add_rp(id: ast::node_id, variance: region_variance) {
           some(v) => join_variance(v, variance)
         };
 
-        debug!["add_rp() variance for %s: %? == %? ^ %?",
+        debug!("add_rp() variance for %s: %? == %? ^ %?",
                ast_map::node_id_to_str(self.ast_map, id,
                                        self.sess.parse_sess.interner),
-               joined_variance, old_variance, variance];
+               joined_variance, old_variance, variance);
 
         if some(joined_variance) != old_variance {
             self.region_paramd_items.insert(id, joined_variance);
@@ -458,13 +458,13 @@ fn add_rp(id: ast::node_id, variance: region_variance) {
     /// contains a value of type `from`, so if `from` is
     /// region-parameterized, so is the current item.
     fn add_dep(from: ast::node_id) {
-        debug!["add dependency from %d -> %d (%s -> %s) with variance %?",
+        debug!("add dependency from %d -> %d (%s -> %s) with variance %?",
                from, self.item_id,
                ast_map::node_id_to_str(self.ast_map, from,
                                        self.sess.parse_sess.interner),
                ast_map::node_id_to_str(self.ast_map, self.item_id,
                                        self.sess.parse_sess.interner),
-               copy self.ambient_variance];
+               copy self.ambient_variance);
         let vec = match self.dep_map.find(from) {
             some(vec) => vec,
             none => {
@@ -525,7 +525,7 @@ fn with(item_id: ast::node_id,
         let old_anon_implies_rp = self.anon_implies_rp;
         self.item_id = item_id;
         self.anon_implies_rp = anon_implies_rp;
-        debug!{"with_item_id(%d, %b)", item_id, anon_implies_rp};
+        debug!("with_item_id(%d, %b)", item_id, anon_implies_rp);
         let _i = util::common::indenter();
         f();
         self.item_id = old_item_id;
@@ -590,8 +590,8 @@ fn determine_rp_in_ty(ty: @ast::ty,
     // locations)
     match ty.node {
       ast::ty_rptr(r, _) => {
-        debug!["referenced rptr type %s",
-               pprust::ty_to_str(ty, cx.sess.intr())];
+        debug!("referenced rptr type %s",
+               pprust::ty_to_str(ty, cx.sess.intr()));
 
         if cx.region_is_relevant(r) {
             cx.add_rp(cx.item_id, cx.add_variance(rv_contravariant))
@@ -623,8 +623,8 @@ fn determine_rp_in_ty(ty: @ast::ty,
                 match csearch::get_region_param(cstore, did) {
                   none => {}
                   some(variance) => {
-                    debug!["reference to external, rp'd type %s",
-                           pprust::ty_to_str(ty, cx.sess.intr())];
+                    debug!("reference to external, rp'd type %s",
+                           pprust::ty_to_str(ty, cx.sess.intr()));
                     cx.add_rp(cx.item_id, cx.add_variance(variance))
                   }
                 }
@@ -743,7 +743,7 @@ fn determine_rp_in_crate(sess: session,
     while cx.worklist.len() != 0 {
         let c_id = cx.worklist.pop();
         let c_variance = cx.region_paramd_items.get(c_id);
-        debug!["popped %d from worklist", c_id];
+        debug!("popped %d from worklist", c_id);
         match cx.dep_map.find(c_id) {
           none => {}
           some(deps) => {
index d6b057deed5bd966dddd5b85be8f0755529a0f41..68d2b1458291d7feda4bb1883b573c87a8dc1277 100644 (file)
@@ -1243,9 +1243,9 @@ fn build_reduced_graph_for_block(block: blk,
         if self.block_needs_anonymous_module(block) {
             let block_id = block.node.id;
 
-            debug!{"(building reduced graph for block) creating a new \
+            debug!("(building reduced graph for block) creating a new \
                     anonymous module for block %d",
-                   block_id};
+                   block_id);
 
             let parent_module = self.get_module_from_parent(parent);
             let new_module = @Module(BlockParentLink(parent_module, block_id),
@@ -1414,8 +1414,8 @@ fn build_reduced_graph_for_external_crate(root: @Module) {
                 // Define or reuse the module node.
                 match child_name_bindings.module_def {
                     NoModuleDef => {
-                        debug!{"(building reduced graph for external crate) \
-                                autovivifying %s", ident_str};
+                        debug!("(building reduced graph for external crate) \
+                                autovivifying %s", ident_str);
                         let parent_link = self.get_parent_link(new_parent,
                                                                ident);
                         (*child_name_bindings).define_module(parent_link,
@@ -1445,12 +1445,12 @@ fn build_reduced_graph_for_external_crate(root: @Module) {
                     // written, we can't process this impl now. We'll get it
                     // later.
 
-                    debug!{"(building reduced graph for external crate) \
-                            ignoring impl %s", final_ident_str};
+                    debug!("(building reduced graph for external crate) \
+                            ignoring impl %s", final_ident_str);
                 }
                 dl_field => {
-                    debug!{"(building reduced graph for external crate) \
-                            ignoring field %s", final_ident_str};
+                    debug!("(building reduced graph for external crate) \
+                            ignoring field %s", final_ident_str);
                 }
             }
         }
@@ -1508,14 +1508,14 @@ fn resolve_imports() {
         let mut i = 0u;
         let mut prev_unresolved_imports = 0u;
         loop {
-            debug!{"(resolving imports) iteration %u, %u imports left",
-                   i, self.unresolved_imports};
+            debug!("(resolving imports) iteration %u, %u imports left",
+                   i, self.unresolved_imports);
 
             let module_root = (*self.graph_root).get_module();
             self.resolve_imports_for_module_subtree(module_root);
 
             if self.unresolved_imports == 0u {
-                debug!{"(resolving imports) success"};
+                debug!("(resolving imports) success");
                 break;
             }
 
@@ -1535,8 +1535,8 @@ fn resolve_imports() {
      * submodules.
      */
     fn resolve_imports_for_module_subtree(module_: @Module) {
-        debug!{"(resolving imports for module subtree) resolving %s",
-               self.module_to_str(module_)};
+        debug!("(resolving imports for module subtree) resolving %s",
+               self.module_to_str(module_));
         self.resolve_imports_for_module(module_);
 
         for module_.children.each |_name, child_node| {
@@ -1558,9 +1558,9 @@ fn resolve_imports_for_module_subtree(module_: @Module) {
     /// Attempts to resolve imports for the given module only.
     fn resolve_imports_for_module(module_: @Module) {
         if (*module_).all_imports_resolved() {
-            debug!{"(resolving imports for module) all imports resolved for \
+            debug!("(resolving imports for module) all imports resolved for \
                    %s",
-                   self.module_to_str(module_)};
+                   self.module_to_str(module_));
             return;
         }
 
@@ -1616,10 +1616,10 @@ fn resolve_import_for_module(module_: @Module,
         let mut resolution_result;
         let module_path = import_directive.module_path;
 
-        debug!{"(resolving import for module) resolving import `%s::...` in \
+        debug!("(resolving import for module) resolving import `%s::...` in \
                 `%s`",
                self.atoms_to_str((*module_path).get()),
-               self.module_to_str(module_)};
+               self.module_to_str(module_));
 
         // One-level renaming imports of the form `import foo = bar;` are
         // handled specially.
@@ -1700,16 +1700,16 @@ fn resolve_single_import(module_: @Module, containing_module: @Module,
                              target: Atom, source: Atom)
                           -> ResolveResult<()> {
 
-        debug!{"(resolving single import) resolving `%s` = `%s::%s` from \
+        debug!("(resolving single import) resolving `%s` = `%s::%s` from \
                 `%s`",
                self.session.str_of(target),
                self.module_to_str(containing_module),
                self.session.str_of(source),
-               self.module_to_str(module_)};
+               self.module_to_str(module_));
 
         if !self.name_is_exported(containing_module, source) {
-            debug!{"(resolving single import) name `%s` is unexported",
-                   self.session.str_of(source)};
+            debug!("(resolving single import) name `%s` is unexported",
+                   self.session.str_of(source));
             return Failed;
         }
 
@@ -1756,8 +1756,8 @@ fn resolve_single_import(module_: @Module, containing_module: @Module,
                 // able to resolve this import.
 
                 if containing_module.glob_count > 0u {
-                    debug!{"(resolving single import) unresolved glob; \
-                            bailing out"};
+                    debug!("(resolving single import) unresolved glob; \
+                            bailing out");
                     return Indeterminate;
                 }
 
@@ -1820,8 +1820,8 @@ fn get_binding(import_resolution: @ImportResolution,
                     }
                     some(_) => {
                         // The import is unresolved. Bail out.
-                        debug!{"(resolving single import) unresolved import; \
-                                bailing out"};
+                        debug!("(resolving single import) unresolved import; \
+                                bailing out");
                         return Indeterminate;
                     }
                 }
@@ -1834,13 +1834,13 @@ fn get_binding(import_resolution: @ImportResolution,
 
         match module_result {
             BoundResult(target_module, name_bindings) => {
-                debug!{"(resolving single import) found module binding"};
+                debug!("(resolving single import) found module binding");
                 import_resolution.module_target =
                     some(Target(target_module, name_bindings));
             }
             UnboundResult => {
-                debug!{"(resolving single import) didn't find module \
-                        binding"};
+                debug!("(resolving single import) didn't find module \
+                        binding");
             }
             UnknownResult => {
                 fail ~"module result should be known at this point";
@@ -1880,7 +1880,7 @@ fn get_binding(import_resolution: @ImportResolution,
         assert import_resolution.outstanding_references >= 1u;
         import_resolution.outstanding_references -= 1u;
 
-        debug!{"(resolving single import) successfully resolved import"};
+        debug!("(resolving single import) successfully resolved import");
         return Success(());
     }
 
@@ -1902,8 +1902,8 @@ fn resolve_glob_import(module_: @Module,
         // (including globs).
 
         if !(*containing_module).all_imports_resolved() {
-            debug!{"(resolving glob import) target module has unresolved \
-                    imports; bailing out"};
+            debug!("(resolving glob import) target module has unresolved \
+                    imports; bailing out");
             return Indeterminate;
         }
 
@@ -1914,15 +1914,15 @@ fn resolve_glob_import(module_: @Module,
                 |atom, target_import_resolution| {
 
             if !self.name_is_exported(containing_module, atom) {
-                debug!{"(resolving glob import) name `%s` is unexported",
-                       self.session.str_of(atom)};
+                debug!("(resolving glob import) name `%s` is unexported",
+                       self.session.str_of(atom));
                 again;
             }
 
-            debug!{"(resolving glob import) writing module resolution \
+            debug!("(resolving glob import) writing module resolution \
                     %? into `%s`",
                    is_none(target_import_resolution.module_target),
-                   self.module_to_str(module_)};
+                   self.module_to_str(module_));
 
             // Here we merge two import resolutions.
             match module_.import_resolutions.find(atom) {
@@ -1978,8 +1978,8 @@ fn resolve_glob_import(module_: @Module,
         // Add all children from the containing module.
         for containing_module.children.each |atom, name_bindings| {
             if !self.name_is_exported(containing_module, atom) {
-                debug!{"(resolving glob import) name `%s` is unexported",
-                       self.session.str_of(atom)};
+                debug!("(resolving glob import) name `%s` is unexported",
+                       self.session.str_of(atom));
                 again;
             }
 
@@ -1997,31 +1997,31 @@ fn resolve_glob_import(module_: @Module,
             }
 
 
-            debug!{"(resolving glob import) writing resolution `%s` in `%s` \
+            debug!("(resolving glob import) writing resolution `%s` in `%s` \
                     to `%s`",
                    self.session.str_of(atom),
                    self.module_to_str(containing_module),
-                   self.module_to_str(module_)};
+                   self.module_to_str(module_));
 
             // Merge the child item into the import resolution.
             if (*name_bindings).defined_in_namespace(ModuleNS) {
-                debug!{"(resolving glob import) ... for module target"};
+                debug!("(resolving glob import) ... for module target");
                 dest_import_resolution.module_target =
                     some(Target(containing_module, name_bindings));
             }
             if (*name_bindings).defined_in_namespace(ValueNS) {
-                debug!{"(resolving glob import) ... for value target"};
+                debug!("(resolving glob import) ... for value target");
                 dest_import_resolution.value_target =
                     some(Target(containing_module, name_bindings));
             }
             if (*name_bindings).defined_in_namespace(TypeNS) {
-                debug!{"(resolving glob import) ... for type target"};
+                debug!("(resolving glob import) ... for type target");
                 dest_import_resolution.type_target =
                     some(Target(containing_module, name_bindings));
             }
         }
 
-        debug!{"(resolving glob import) successfully resolved import"};
+        debug!("(resolving glob import) successfully resolved import");
         return Success(());
     }
 
@@ -2050,9 +2050,9 @@ fn resolve_module_path_from_root(module_: @Module,
                     return Failed;
                 }
                 Indeterminate => {
-                    debug!{"(resolving module path for import) module \
+                    debug!("(resolving module path for import) module \
                             resolution is indeterminate: %s",
-                            self.session.str_of(name)};
+                            self.session.str_of(name));
                     return Indeterminate;
                 }
                 Success(target) => {
@@ -2060,9 +2060,9 @@ fn resolve_module_path_from_root(module_: @Module,
                         NoModuleDef => {
                             // Not a module.
                             self.session.span_err(span,
-                                                  fmt!{"not a module: %s",
+                                                  fmt!("not a module: %s",
                                                        self.session.
-                                                           str_of(name)});
+                                                           str_of(name)));
                             return Failed;
                         }
                         ModuleDef(module_) => {
@@ -2091,10 +2091,10 @@ fn resolve_module_path_for_import(module_: @Module,
         let module_path_len = (*module_path).len();
         assert module_path_len > 0u;
 
-        debug!{"(resolving module path for import) processing `%s` rooted at \
+        debug!("(resolving module path for import) processing `%s` rooted at \
                `%s`",
                self.atoms_to_str((*module_path).get()),
-               self.module_to_str(module_)};
+               self.module_to_str(module_));
 
         // The first element of the module path must be in the current scope
         // chain.
@@ -2107,8 +2107,8 @@ fn resolve_module_path_for_import(module_: @Module,
                 return Failed;
             }
             Indeterminate => {
-                debug!{"(resolving module path for import) indeterminate; \
-                        bailing"};
+                debug!("(resolving module path for import) indeterminate; \
+                        bailing");
                 return Indeterminate;
             }
             Success(resulting_module) => {
@@ -2128,11 +2128,11 @@ fn resolve_item_in_lexical_scope(module_: @Module,
                                      namespace: Namespace)
                                   -> ResolveResult<Target> {
 
-        debug!{"(resolving item in lexical scope) resolving `%s` in \
+        debug!("(resolving item in lexical scope) resolving `%s` in \
                 namespace %? in `%s`",
                self.session.str_of(name),
                namespace,
-               self.module_to_str(module_)};
+               self.module_to_str(module_));
 
         // The current module node is handled specially. First, check for
         // its immediate children.
@@ -2159,9 +2159,9 @@ fn resolve_item_in_lexical_scope(module_: @Module,
                 match (*import_resolution).target_for_namespace(namespace) {
                     none => {
                         // Not found; continue.
-                        debug!{"(resolving item in lexical scope) found \
+                        debug!("(resolving item in lexical scope) found \
                                 import resolution, but not in namespace %?",
-                               namespace};
+                               namespace);
                     }
                     some(target) => {
                         import_resolution.used = true;
@@ -2178,8 +2178,8 @@ fn resolve_item_in_lexical_scope(module_: @Module,
             match search_module.parent_link {
                 NoParentLink => {
                     // No more parents. This module was unresolved.
-                    debug!{"(resolving item in lexical scope) unresolved \
-                            module"};
+                    debug!("(resolving item in lexical scope) unresolved \
+                            module");
                     return Failed;
                 }
                 ModuleParentLink(parent_module_node, _) |
@@ -2198,8 +2198,8 @@ fn resolve_item_in_lexical_scope(module_: @Module,
                     // We couldn't see through the higher scope because of an
                     // unresolved import higher up. Bail.
 
-                    debug!{"(resolving item in lexical scope) indeterminate \
-                            higher scope; bailing"};
+                    debug!("(resolving item in lexical scope) indeterminate \
+                            higher scope; bailing");
                     return Indeterminate;
                 }
                 Success(target) => {
@@ -2217,8 +2217,8 @@ fn resolve_module_in_lexical_scope(module_: @Module, name: Atom)
             Success(target) => {
                 match target.bindings.module_def {
                     NoModuleDef => {
-                        error!{"!!! (resolving module in lexical scope) module
-                                wasn't actually a module!"};
+                        error!("!!! (resolving module in lexical scope) module
+                                wasn't actually a module!");
                         return Failed;
                     }
                     ModuleDef(module_) => {
@@ -2227,13 +2227,13 @@ fn resolve_module_in_lexical_scope(module_: @Module, name: Atom)
                 }
             }
             Indeterminate => {
-                debug!{"(resolving module in lexical scope) indeterminate; \
-                        bailing"};
+                debug!("(resolving module in lexical scope) indeterminate; \
+                        bailing");
                 return Indeterminate;
             }
             Failed => {
-                debug!{"(resolving module in lexical scope) failed to \
-                        resolve"};
+                debug!("(resolving module in lexical scope) failed to \
+                        resolve");
                 return Failed;
             }
         }
@@ -2255,13 +2255,13 @@ fn resolve_name_in_module(module_: @Module,
                               xray: XrayFlag)
                            -> ResolveResult<Target> {
 
-        debug!{"(resolving name in module) resolving `%s` in `%s`",
+        debug!("(resolving name in module) resolving `%s` in `%s`",
                self.session.str_of(name),
-               self.module_to_str(module_)};
+               self.module_to_str(module_));
 
         if xray == NoXray && !self.name_is_exported(module_, name) {
-            debug!{"(resolving name in module) name `%s` is unexported",
-                   self.session.str_of(name)};
+            debug!("(resolving name in module) name `%s` is unexported",
+                   self.session.str_of(name));
             return Failed;
         }
 
@@ -2270,7 +2270,7 @@ fn resolve_name_in_module(module_: @Module,
             some(name_bindings)
                     if (*name_bindings).defined_in_namespace(namespace) => {
 
-                debug!{"(resolving name in module) found node as child"};
+                debug!("(resolving name in module) found node as child");
                 return Success(Target(module_, name_bindings));
             }
             some(_) | none => {
@@ -2282,7 +2282,7 @@ fn resolve_name_in_module(module_: @Module,
         // we bail out; we don't know its imports yet.
 
         if module_.glob_count > 0u {
-            debug!{"(resolving name in module) module has glob; bailing out"};
+            debug!("(resolving name in module) module has glob; bailing out");
             return Indeterminate;
         }
 
@@ -2290,20 +2290,20 @@ fn resolve_name_in_module(module_: @Module,
         match module_.import_resolutions.find(name) {
             some(import_resolution) => {
                 if import_resolution.outstanding_references != 0u {
-                    debug!{"(resolving name in module) import unresolved; \
-                            bailing out"};
+                    debug!("(resolving name in module) import unresolved; \
+                            bailing out");
                     return Indeterminate;
                 }
 
                 match (*import_resolution).target_for_namespace(namespace) {
                     none => {
-                        debug!{"(resolving name in module) name found, but \
+                        debug!("(resolving name in module) name found, but \
                                 not in namespace %?",
-                               namespace};
+                               namespace);
                     }
                     some(target) => {
-                        debug!{"(resolving name in module) resolved to \
-                                import"};
+                        debug!("(resolving name in module) resolved to \
+                                import");
                         import_resolution.used = true;
                         return Success(copy target);
                     }
@@ -2315,8 +2315,8 @@ fn resolve_name_in_module(module_: @Module,
         }
 
         // We're out of luck.
-        debug!{"(resolving name in module) failed to resolve %s",
-               self.session.str_of(name)};
+        debug!("(resolving name in module) failed to resolve %s",
+               self.session.str_of(name));
         return Failed;
     }
 
@@ -2341,81 +2341,81 @@ fn resolve_one_level_renaming_import(module_: @Module,
             }
         }
 
-        debug!{"(resolving one-level naming result) resolving import `%s` = \
+        debug!("(resolving one-level naming result) resolving import `%s` = \
                 `%s` in `%s`",
                 self.session.str_of(target_name),
                 self.session.str_of(source_name),
-                self.module_to_str(module_)};
+                self.module_to_str(module_));
 
         // Find the matching items in the lexical scope chain for every
         // namespace. If any of them come back indeterminate, this entire
         // import is indeterminate.
 
         let mut module_result;
-        debug!{"(resolving one-level naming result) searching for module"};
+        debug!("(resolving one-level naming result) searching for module");
         match self.resolve_item_in_lexical_scope(module_,
                                                source_name,
                                                ModuleNS) {
 
             Failed => {
-                debug!{"(resolving one-level renaming import) didn't find \
-                        module result"};
+                debug!("(resolving one-level renaming import) didn't find \
+                        module result");
                 module_result = none;
             }
             Indeterminate => {
-                debug!{"(resolving one-level renaming import) module result \
-                        is indeterminate; bailing"};
+                debug!("(resolving one-level renaming import) module result \
+                        is indeterminate; bailing");
                 return Indeterminate;
             }
             Success(name_bindings) => {
-                debug!{"(resolving one-level renaming import) module result \
-                        found"};
+                debug!("(resolving one-level renaming import) module result \
+                        found");
                 module_result = some(copy name_bindings);
             }
         }
 
         let mut value_result;
-        debug!{"(resolving one-level naming result) searching for value"};
+        debug!("(resolving one-level naming result) searching for value");
         match self.resolve_item_in_lexical_scope(module_,
                                                source_name,
                                                ValueNS) {
 
             Failed => {
-                debug!{"(resolving one-level renaming import) didn't find \
-                        value result"};
+                debug!("(resolving one-level renaming import) didn't find \
+                        value result");
                 value_result = none;
             }
             Indeterminate => {
-                debug!{"(resolving one-level renaming import) value result \
-                        is indeterminate; bailing"};
+                debug!("(resolving one-level renaming import) value result \
+                        is indeterminate; bailing");
                 return Indeterminate;
             }
             Success(name_bindings) => {
-                debug!{"(resolving one-level renaming import) value result \
-                        found"};
+                debug!("(resolving one-level renaming import) value result \
+                        found");
                 value_result = some(copy name_bindings);
             }
         }
 
         let mut type_result;
-        debug!{"(resolving one-level naming result) searching for type"};
+        debug!("(resolving one-level naming result) searching for type");
         match self.resolve_item_in_lexical_scope(module_,
                                                source_name,
                                                TypeNS) {
 
             Failed => {
-                debug!{"(resolving one-level renaming import) didn't find \
-                        type result"};
+                debug!("(resolving one-level renaming import) didn't find \
+                        type result");
                 type_result = none;
             }
             Indeterminate => {
-                debug!{"(resolving one-level renaming import) type result is \
-                        indeterminate; bailing"};
+                debug!("(resolving one-level renaming import) type result is \
+                        indeterminate; bailing");
                 return Indeterminate;
             }
             Success(name_bindings) => {
-                debug!{"(resolving one-level renaming import) type result \
-                        found"};
+                debug!("(resolving one-level renaming import) type result \
+                        found");
                 type_result = some(copy name_bindings);
             }
         }
@@ -2455,11 +2455,11 @@ fn resolve_one_level_renaming_import(module_: @Module,
                       import resolution name by now";
             }
             some(import_resolution) => {
-                debug!{"(resolving one-level renaming import) writing module \
+                debug!("(resolving one-level renaming import) writing module \
                         result %? for `%s` into `%s`",
                        is_none(module_result),
                        self.session.str_of(target_name),
-                       self.module_to_str(module_)};
+                       self.module_to_str(module_));
 
                 import_resolution.module_target = module_result;
                 import_resolution.value_target = value_result;
@@ -2470,7 +2470,7 @@ fn resolve_one_level_renaming_import(module_: @Module,
             }
         }
 
-        debug!{"(resolving one-level renaming import) successfully resolved"};
+        debug!("(resolving one-level renaming import) successfully resolved");
         return Success(());
     }
 
@@ -2526,9 +2526,9 @@ fn record_exports_for_module_subtree(module_: @Module) {
             }
             some(_) => {
                 // Bail out.
-                debug!{"(recording exports for module subtree) not recording \
+                debug!("(recording exports for module subtree) not recording \
                         exports for `%s`",
-                       self.module_to_str(module_)};
+                       self.module_to_str(module_));
                 return;
             }
         }
@@ -2638,17 +2638,17 @@ fn with_scope(name: option<Atom>, f: fn()) {
             some(name) => {
                 match orig_module.children.find(name) {
                     none => {
-                        debug!{"!!! (with scope) didn't find `%s` in `%s`",
+                        debug!("!!! (with scope) didn't find `%s` in `%s`",
                                self.session.str_of(name),
-                               self.module_to_str(orig_module)};
+                               self.module_to_str(orig_module));
                     }
                     some(name_bindings) => {
                         match (*name_bindings).get_module_if_available() {
                             none => {
-                                debug!{"!!! (with scope) didn't find module \
+                                debug!("!!! (with scope) didn't find module \
                                         for `%s` in `%s`",
                                        self.session.str_of(name),
-                                       self.module_to_str(orig_module)};
+                                       self.module_to_str(orig_module));
                             }
                             some(module_) => {
                                 self.current_module = module_;
@@ -2794,7 +2794,7 @@ fn search_ribs(ribs: @DVec<@Rib>, name: Atom, span: span,
 
     // XXX: This shouldn't be unsafe!
     fn resolve_crate() unsafe {
-        debug!{"(resolving crate) starting"};
+        debug!("(resolving crate) starting");
 
         // XXX: This is awful!
         let this = ptr::addr_of(self);
@@ -2816,8 +2816,8 @@ fn resolve_crate() unsafe {
     }
 
     fn resolve_item(item: @item, visitor: ResolveVisitor) {
-        debug!{"(resolving item) resolving %s",
-               self.session.str_of(item.ident)};
+        debug!("(resolving item) resolving %s",
+               self.session.str_of(item.ident));
 
         // Items with the !resolve_unexported attribute are X-ray contexts.
         // This is used to allow the test runner to run unexported tests.
@@ -2874,8 +2874,8 @@ fn resolve_item(item: @item, visitor: ResolveVisitor) {
                                 // definition of the trait into the definition
                                 // map.
 
-                                debug!{"(resolving trait) found trait def: \
-                                       %?", def};
+                                debug!("(resolving trait) found trait def: \
+                                       %?", def);
 
                                 self.record_def(trt.ref_id, def);
                             }
@@ -3010,8 +3010,8 @@ fn with_type_parameter_rib(type_parameters: TypeParameters, f: fn()) {
 
                 for (*type_parameters).eachi |index, type_parameter| {
                     let name = type_parameter.ident;
-                    debug!{"with_type_parameter_rib: %d %d", node_id,
-                           type_parameter.id};
+                    debug!("with_type_parameter_rib: %d %d", node_id,
+                           type_parameter.id);
                     let def_like = dl_def(def_ty_param
                         (local_def(type_parameter.id),
                          index + initial_index));
@@ -3126,8 +3126,8 @@ fn resolve_function(rib_kind: RibKind,
 
                         self.resolve_type(argument.ty, visitor);
 
-                        debug!{"(resolving function) recorded argument `%s`",
-                               self.session.str_of(name)};
+                        debug!("(resolving function) recorded argument `%s`",
+                               self.session.str_of(name));
                     }
 
                     self.resolve_type(declaration.output, visitor);
@@ -3137,7 +3137,7 @@ fn resolve_function(rib_kind: RibKind,
             // Resolve the function body.
             self.resolve_block(block, visitor);
 
-            debug!{"(resolving function) leaving function"};
+            debug!("(resolving function) leaving function");
         }
 
         (*self.label_ribs).pop();
@@ -3193,7 +3193,7 @@ fn resolve_class(id: node_id,
                         // definition of the trait into the definition
                         // map.
 
-                        debug!{"(resolving class) found trait def: %?", def};
+                        debug!("(resolving class) found trait def: %?", def);
 
                         self.record_def(trt.ref_id, def);
 
@@ -3359,7 +3359,7 @@ fn resolve_module(module_: _mod, span: span, _name: ident, id: node_id,
                       visitor: ResolveVisitor) {
 
         // Write the implementations in scope into the module metadata.
-        debug!{"(resolving module) resolving module ID %d", id};
+        debug!("(resolving module) resolving module ID %d", id);
         visit_mod(module_, span, id, (), visitor);
     }
 
@@ -3411,17 +3411,17 @@ fn check_consistent_bindings(arm: arm) {
                   none => {
                     self.session.span_err(
                         p.span,
-                        fmt!{"variable `%s` from pattern #1 is \
+                        fmt!("variable `%s` from pattern #1 is \
                                   not bound in pattern #%u",
-                             self.session.str_of(key), i + 1});
+                             self.session.str_of(key), i + 1));
                   }
                   some(binding_i) => {
                     if binding_0.binding_mode != binding_i.binding_mode {
                         self.session.span_err(
                             binding_i.span,
-                            fmt!{"variable `%s` is bound with different \
+                            fmt!("variable `%s` is bound with different \
                                       mode in pattern #%u than in pattern #1",
-                                 self.session.str_of(key), i + 1});
+                                 self.session.str_of(key), i + 1));
                     }
                   }
                 }
@@ -3431,9 +3431,9 @@ fn check_consistent_bindings(arm: arm) {
                 if !map_0.contains_key(key) {
                     self.session.span_err(
                         binding.span,
-                        fmt!{"variable `%s` from pattern #%u is \
+                        fmt!("variable `%s` from pattern #%u is \
                                   not bound in pattern #1",
-                             self.session.str_of(key), i + 1});
+                             self.session.str_of(key), i + 1));
                 }
             }
         }
@@ -3459,7 +3459,7 @@ fn resolve_arm(arm: arm, visitor: ResolveVisitor) {
     }
 
     fn resolve_block(block: blk, visitor: ResolveVisitor) {
-        debug!{"(resolving block) entering block"};
+        debug!("(resolving block) entering block");
         (*self.value_ribs).push(@Rib(NormalRibKind));
 
         // Move down in the graph, if there's an anonymous module rooted here.
@@ -3467,8 +3467,8 @@ fn resolve_block(block: blk, visitor: ResolveVisitor) {
         match self.current_module.anonymous_children.find(block.node.id) {
             none => { /* Nothing to do. */ }
             some(anonymous_module) => {
-                debug!{"(resolving block) found anonymous module, moving \
-                        down"};
+                debug!("(resolving block) found anonymous module, moving \
+                        down");
                 self.current_module = anonymous_module;
             }
         }
@@ -3480,7 +3480,7 @@ fn resolve_block(block: blk, visitor: ResolveVisitor) {
         self.current_module = orig_module;
 
         (*self.value_ribs).pop();
-        debug!{"(resolving block) leaving block"};
+        debug!("(resolving block) leaving block");
     }
 
     fn resolve_type(ty: @ty, visitor: ResolveVisitor) {
@@ -3495,8 +3495,8 @@ fn resolve_type(ty: @ty, visitor: ResolveVisitor) {
                 let mut result_def;
                 match self.resolve_path(path, TypeNS, true, visitor) {
                     some(def) => {
-                        debug!{"(resolving type) resolved `%s` to type",
-                               self.session.str_of(path.idents.last())};
+                        debug!("(resolving type) resolved `%s` to type",
+                               self.session.str_of(path.idents.last()));
                         result_def = some(def);
                     }
                     none => {
@@ -3532,19 +3532,19 @@ fn resolve_type(ty: @ty, visitor: ResolveVisitor) {
                 match copy result_def {
                     some(def) => {
                         // Write the result into the def map.
-                        debug!{"(resolving type) writing resolution for `%s` \
+                        debug!("(resolving type) writing resolution for `%s` \
                                 (id %d)",
                                connect(path.idents.map(
                                    |x| self.session.str_of(x)), ~"::"),
-                               path_id};
+                               path_id);
                         self.record_def(path_id, def);
                     }
                     none => {
                         self.session.span_err
-                            (ty.span, fmt!{"use of undeclared type name `%s`",
+                            (ty.span, fmt!("use of undeclared type name `%s`",
                                            connect(path.idents.map(
                                                |x| self.session.str_of(x)),
-                                                   ~"::")});
+                                                   ~"::")));
                     }
                 }
             }
@@ -3582,19 +3582,19 @@ fn resolve_pattern(pattern: @pat,
 
                     match self.resolve_enum_variant_or_const(atom) {
                         FoundEnumVariant(def) if mode == RefutableMode => {
-                            debug!{"(resolving pattern) resolving `%s` to \
+                            debug!("(resolving pattern) resolving `%s` to \
                                     enum variant",
-                                    self.session.str_of(atom)};
+                                    self.session.str_of(atom));
 
                             self.record_def(pattern.id, def);
                         }
                         FoundEnumVariant(_) => {
                             self.session.span_err(pattern.span,
-                                                  fmt!{"declaration of `%s` \
+                                                  fmt!("declaration of `%s` \
                                                         shadows an enum \
                                                         that's in scope",
                                                         self.session
-                                                        .str_of(atom)});
+                                                        .str_of(atom)));
                         }
                         FoundConst => {
                             self.session.span_err(pattern.span,
@@ -3603,8 +3603,8 @@ enum variant",
                                                    in scope");
                         }
                         EnumVariantOrConstNotFound => {
-                            debug!{"(resolving pattern) binding `%s`",
-                                   self.session.str_of(atom)};
+                            debug!("(resolving pattern) binding `%s`",
+                                   self.session.str_of(atom));
 
                             let is_mutable = mutability == Mutable;
 
@@ -3647,10 +3647,10 @@ enum variant",
                                       // in the same disjunct, which is an
                                       // error
                                      self.session.span_err(pattern.span,
-                                       fmt!{"Identifier %s is bound more \
+                                       fmt!("Identifier %s is bound more \
                                              than once in the same pattern",
                                             path_to_str(path, self.session
-                                                        .intr())});
+                                                        .intr())));
                                   }
                                   // Not bound in the same pattern: do nothing
                                 }
@@ -3678,9 +3678,9 @@ enum variant",
                         some(_) => {
                             self.session.span_err(
                                 path.span,
-                                fmt!{"not an enum variant: %s",
+                                fmt!("not an enum variant: %s",
                                      self.session.str_of(
-                                         path.idents.last())});
+                                         path.idents.last())));
                         }
                         none => {
                             self.session.span_err(path.span,
@@ -3835,9 +3835,9 @@ fn resolve_definition_of_name_in_module(containing_module: @Module,
                                          -> NameDefinition {
 
         if xray == NoXray && !self.name_is_exported(containing_module, name) {
-            debug!{"(resolving definition of name in module) name `%s` is \
+            debug!("(resolving definition of name in module) name `%s` is \
                     unexported",
-                   self.session.str_of(name)};
+                   self.session.str_of(name));
             return NoNameDefinition;
         }
 
@@ -3918,9 +3918,9 @@ fn resolve_module_relative_path(path: @path,
 
             Failed => {
                 self.session.span_err(path.span,
-                                      fmt!{"use of undeclared module `%s`",
+                                      fmt!("use of undeclared module `%s`",
                                            self.atoms_to_str(
-                                               (*module_path_atoms).get())});
+                                               (*module_path_atoms).get())));
                 return none;
             }
 
@@ -3942,9 +3942,9 @@ fn resolve_module_relative_path(path: @path,
                 // We failed to resolve the name. Report an error.
                 self.session.span_err(
                     path.span,
-                    fmt!{"unresolved name: %s::%s",
+                    fmt!("unresolved name: %s::%s",
                          self.atoms_to_str((*module_path_atoms).get()),
-                         self.session.str_of(name)});
+                         self.session.str_of(name)));
                 return none;
             }
             ChildNameDefinition(def) | ImportNameDefinition(def) => {
@@ -3971,9 +3971,9 @@ fn resolve_crate_relative_path(path: @path,
 
             Failed => {
                 self.session.span_err(path.span,
-                                      fmt!{"use of undeclared module `::%s`",
+                                      fmt!("use of undeclared module `::%s`",
                                             self.atoms_to_str
-                                              ((*module_path_atoms).get())});
+                                              ((*module_path_atoms).get())));
                 return none;
             }
 
@@ -3995,9 +3995,9 @@ fn resolve_crate_relative_path(path: @path,
                 // We failed to resolve the name. Report an error.
                 self.session.span_err(
                     path.span,
-                    fmt!{"unresolved name: %s::%s", self.atoms_to_str(
+                    fmt!("unresolved name: %s::%s", self.atoms_to_str(
                         (*module_path_atoms).get()),
-                         self.session.str_of(name)});
+                         self.session.str_of(name)));
                 return none;
             }
             ChildNameDefinition(def) | ImportNameDefinition(def) => {
@@ -4028,10 +4028,10 @@ fn resolve_identifier_in_local_ribs(ident: ident,
 
         match copy search_result {
             some(dl_def(def)) => {
-                debug!{"(resolving path in local ribs) resolved `%s` to \
+                debug!("(resolving path in local ribs) resolved `%s` to \
                         local: %?",
                        self.session.str_of(ident),
-                       def};
+                       def);
                 return some(def);
             }
             some(dl_field) | some(dl_impl(_)) | none => {
@@ -4056,9 +4056,9 @@ fn resolve_item_by_identifier_in_lexical_scope(ident: ident,
                               bindings with no def for that namespace?!";
                     }
                     some(def) => {
-                        debug!{"(resolving item path in lexical scope) \
+                        debug!("(resolving item path in lexical scope) \
                                 resolved `%s` to item",
-                               self.session.str_of(ident)};
+                               self.session.str_of(ident));
                         return some(def.def);
                     }
                 }
@@ -4090,18 +4090,18 @@ fn resolve_expr(expr: @expr, visitor: ResolveVisitor) {
                 match self.resolve_path(path, ValueNS, true, visitor) {
                     some(def) => {
                         // Write the result into the def map.
-                        debug!{"(resolving expr) resolved `%s`",
+                        debug!("(resolving expr) resolved `%s`",
                                connect(path.idents.map(
-                                   |x| self.session.str_of(x)), ~"::")};
+                                   |x| self.session.str_of(x)), ~"::"));
                         self.record_def(expr.id, def);
                     }
                     none => {
                         self.session.span_err(
                             expr.span,
-                            fmt!{"unresolved name: %s",
+                            fmt!("unresolved name: %s",
                                  connect(path.idents.map(
                                      |x| self.session.str_of(x)),
-                                         ~"::")});
+                                         ~"::")));
                     }
                 }
 
@@ -4149,10 +4149,10 @@ fn resolve_expr(expr: @expr, visitor: ResolveVisitor) {
                     _ => {
                         self.session.span_err(
                             path.span,
-                            fmt!{"`%s` does not name a structure",
+                            fmt!("`%s` does not name a structure",
                                  connect(path.idents.map(
                                      |x| self.session.str_of(x)),
-                                         ~"::")});
+                                         ~"::")));
                     }
                 }
 
@@ -4340,11 +4340,11 @@ fn add_trait_info_if_containing_method(found_traits: @DVec<def_id>,
 
         match self.trait_info.find(trait_def_id) {
             some(trait_info) if trait_info.contains_key(name) => {
-                debug!{"(adding trait info if containing method) found trait \
+                debug!("(adding trait info if containing method) found trait \
                         %d:%d for method '%s'",
                        trait_def_id.crate,
                        trait_def_id.node,
-                       self.session.str_of(name)};
+                       self.session.str_of(name));
                 (*found_traits).push(trait_def_id);
             }
             some(_) | none => {
@@ -4360,7 +4360,7 @@ fn add_fixed_trait_for_expr(expr_id: node_id, +trait_id: option<def_id>) {
     }
 
     fn record_def(node_id: node_id, def: def) {
-        debug!{"(recording def) recording %? for %?", def, node_id};
+        debug!("(recording def) recording %? for %?", def, node_id);
         self.def_map.insert(node_id, def);
     }
 
@@ -4393,9 +4393,9 @@ fn check_for_unused_imports_in_module_subtree(module_: @Module) {
             }
             some(_) => {
                 // Bail out.
-                debug!{"(checking for unused imports in module subtree) not \
+                debug!("(checking for unused imports in module subtree) not \
                         checking for unused imports for `%s`",
-                       self.module_to_str(module_)};
+                       self.module_to_str(module_));
                 return;
             }
         }
@@ -4491,14 +4491,14 @@ fn module_to_str(module_: @Module) -> ~str {
     }
 
     fn dump_module(module_: @Module) {
-        debug!{"Dump of module `%s`:", self.module_to_str(module_)};
+        debug!("Dump of module `%s`:", self.module_to_str(module_));
 
-        debug!{"Children:"};
+        debug!("Children:");
         for module_.children.each |name, _child| {
-            debug!{"* %s", self.session.str_of(name)};
+            debug!("* %s", self.session.str_of(name));
         }
 
-        debug!{"Import resolutions:"};
+        debug!("Import resolutions:");
         for module_.import_resolutions.each |name, import_resolution| {
             let mut module_repr;
             match (*import_resolution).target_for_namespace(ModuleNS) {
@@ -4527,9 +4527,9 @@ fn dump_module(module_: @Module) {
                 }
             }
 
-            debug!{"* %s:%s%s%s",
+            debug!("* %s:%s%s%s",
                    self.session.str_of(name),
-                   module_repr, value_repr, type_repr};
+                   module_repr, value_repr, type_repr);
         }
     }
 }
index 7ef772a311215d8f442ea0250b5e4fb0bed02721..60a57540fa9af4b3566348865b613a561375c8af 100644 (file)
@@ -67,8 +67,8 @@ enum dest {
 
 fn dest_str(ccx: @crate_ctxt, d: dest) -> ~str {
     match d {
-      by_val(v) => fmt!{"by_val(%s)", val_str(ccx.tn, *v)},
-      save_in(v) => fmt!{"save_in(%s)", val_str(ccx.tn, v)},
+      by_val(v) => fmt!("by_val(%s)", val_str(ccx.tn, *v)),
+      save_in(v) => fmt!("save_in(%s)", val_str(ccx.tn, v)),
       ignore => ~"ignore"
     }
 }
@@ -100,7 +100,7 @@ trait get_insn_ctxt {
 
 impl @crate_ctxt: get_insn_ctxt {
     fn insn_ctxt(s: &str) -> icx_popper {
-        debug!{"new insn_ctxt: %s", s};
+        debug!("new insn_ctxt: %s", s);
         if self.sess.count_llvm_insns() {
             vec::push(*self.stats.llvm_insn_ctxt, str::from_slice(s));
         }
@@ -504,7 +504,7 @@ fn declare_tydesc(ccx: @crate_ctxt, t: ty::t) -> @tydesc_info {
         mangle_internal_name_by_type_only(ccx, t, ~"tydesc")
     } else { mangle_internal_name_by_seq(ccx, ~"tydesc") };
     note_unique_llvm_symbol(ccx, name);
-    log(debug, fmt!{"+++ declare_tydesc %s %s", ty_to_str(ccx.tcx, t), name});
+    log(debug, fmt!("+++ declare_tydesc %s %s", ty_to_str(ccx.tcx, t), name));
     let gvar = str::as_c_str(name, |buf| {
         llvm::LLVMAddGlobal(ccx.llmod, ccx.tydesc_type, buf)
     });
@@ -1116,52 +1116,52 @@ fn lazily_emit_tydesc_glue(ccx: @crate_ctxt, field: uint,
         match ti.take_glue {
           some(_) => (),
           none => {
-            debug!{"+++ lazily_emit_tydesc_glue TAKE %s",
-                   ppaux::ty_to_str(ccx.tcx, ti.ty)};
+            debug!("+++ lazily_emit_tydesc_glue TAKE %s",
+                   ppaux::ty_to_str(ccx.tcx, ti.ty));
             let glue_fn = declare_generic_glue(ccx, ti.ty, llfnty, ~"take");
             ti.take_glue = some(glue_fn);
             make_generic_glue(ccx, ti.ty, glue_fn, make_take_glue, ~"take");
-            debug!{"--- lazily_emit_tydesc_glue TAKE %s",
-                   ppaux::ty_to_str(ccx.tcx, ti.ty)};
+            debug!("--- lazily_emit_tydesc_glue TAKE %s",
+                   ppaux::ty_to_str(ccx.tcx, ti.ty));
           }
         }
     } else if field == abi::tydesc_field_drop_glue {
         match ti.drop_glue {
           some(_) => (),
           none => {
-            debug!{"+++ lazily_emit_tydesc_glue DROP %s",
-                   ppaux::ty_to_str(ccx.tcx, ti.ty)};
+            debug!("+++ lazily_emit_tydesc_glue DROP %s",
+                   ppaux::ty_to_str(ccx.tcx, ti.ty));
             let glue_fn = declare_generic_glue(ccx, ti.ty, llfnty, ~"drop");
             ti.drop_glue = some(glue_fn);
             make_generic_glue(ccx, ti.ty, glue_fn, make_drop_glue, ~"drop");
-            debug!{"--- lazily_emit_tydesc_glue DROP %s",
-                   ppaux::ty_to_str(ccx.tcx, ti.ty)};
+            debug!("--- lazily_emit_tydesc_glue DROP %s",
+                   ppaux::ty_to_str(ccx.tcx, ti.ty));
           }
         }
     } else if field == abi::tydesc_field_free_glue {
         match ti.free_glue {
           some(_) => (),
           none => {
-            debug!{"+++ lazily_emit_tydesc_glue FREE %s",
-                   ppaux::ty_to_str(ccx.tcx, ti.ty)};
+            debug!("+++ lazily_emit_tydesc_glue FREE %s",
+                   ppaux::ty_to_str(ccx.tcx, ti.ty));
             let glue_fn = declare_generic_glue(ccx, ti.ty, llfnty, ~"free");
             ti.free_glue = some(glue_fn);
             make_generic_glue(ccx, ti.ty, glue_fn, make_free_glue, ~"free");
-            debug!{"--- lazily_emit_tydesc_glue FREE %s",
-                   ppaux::ty_to_str(ccx.tcx, ti.ty)};
+            debug!("--- lazily_emit_tydesc_glue FREE %s",
+                   ppaux::ty_to_str(ccx.tcx, ti.ty));
           }
         }
     } else if field == abi::tydesc_field_visit_glue {
         match ti.visit_glue {
           some(_) => (),
           none => {
-            debug!{"+++ lazily_emit_tydesc_glue VISIT %s",
-                   ppaux::ty_to_str(ccx.tcx, ti.ty)};
+            debug!("+++ lazily_emit_tydesc_glue VISIT %s",
+                   ppaux::ty_to_str(ccx.tcx, ti.ty));
             let glue_fn = declare_generic_glue(ccx, ti.ty, llfnty, ~"visit");
             ti.visit_glue = some(glue_fn);
             make_generic_glue(ccx, ti.ty, glue_fn, make_visit_glue, ~"visit");
-            debug!{"--- lazily_emit_tydesc_glue VISIT %s",
-                   ppaux::ty_to_str(ccx.tcx, ti.ty)};
+            debug!("--- lazily_emit_tydesc_glue VISIT %s",
+                   ppaux::ty_to_str(ccx.tcx, ti.ty));
           }
         }
     }
@@ -1722,7 +1722,7 @@ fn trans_eager_binop(cx: block, span: span, op: ast::binop, lhs: ValueRef,
 
 fn trans_assign_op(bcx: block, ex: @ast::expr, op: ast::binop,
                    dst: @ast::expr, src: @ast::expr) -> block {
-    debug!{"%s", expr_to_str(ex, bcx.tcx().sess.parse_sess.interner)};
+    debug!("%s", expr_to_str(ex, bcx.tcx().sess.parse_sess.interner));
     let _icx = bcx.insn_ctxt("trans_assign_op");
     let t = expr_ty(bcx, src);
     let lhs_res = trans_lval(bcx, dst);
@@ -1732,9 +1732,9 @@ fn trans_assign_op(bcx: block, ex: @ast::expr, op: ast::binop,
     match bcx.ccx().maps.method_map.find(ex.id) {
       some(origin) => {
         let bcx = lhs_res.bcx;
-        debug!{"user-defined method callee_id: %s",
+        debug!("user-defined method callee_id: %s",
                ast_map::node_id_to_str(bcx.tcx().items, ex.callee_id,
-                                       bcx.sess().parse_sess.interner)};
+                                       bcx.sess().parse_sess.interner));
         let fty = node_id_type(bcx, ex.callee_id);
 
         let dty = expr_ty(bcx, dst);
@@ -1770,7 +1770,7 @@ fn root_value(bcx: block, val: ValueRef, ty: ty::t,
     if bcx.sess().trace() {
         trans_trace(
             bcx, none,
-            fmt!{"preserving until end of scope %d", scope_id});
+            fmt!("preserving until end of scope %d", scope_id));
     }
 
     let root_loc = alloca_zeroed(bcx, type_of(bcx.ccx(), ty));
@@ -1789,9 +1789,9 @@ fn autoderef(cx: block, e_id: ast::node_id,
     let ccx = cx.ccx();
     let mut derefs = 0u;
     while derefs < max {
-        debug!{"autoderef(e_id=%d, v1=%s, t1=%s, derefs=%u)",
+        debug!("autoderef(e_id=%d, v1=%s, t1=%s, derefs=%u)",
                e_id, val_str(ccx.tn, v1), ppaux::ty_to_str(ccx.tcx, t1),
-               derefs};
+               derefs);
 
         // root the autoderef'd value, if necessary:
         derefs += 1u;
@@ -2140,8 +2140,8 @@ fn monomorphic_fn(ccx: @crate_ctxt, fn_id: ast::def_id,
 
     match ccx.monomorphized.find(hash_id) {
       some(val) => {
-        debug!{"leaving monomorphic fn %s",
-               ty::item_path_str(ccx.tcx, fn_id)};
+        debug!("leaving monomorphic fn %s",
+               ty::item_path_str(ccx.tcx, fn_id));
         return {val: val, must_cast: must_cast};
       }
       none => ()
@@ -2151,9 +2151,9 @@ fn monomorphic_fn(ccx: @crate_ctxt, fn_id: ast::def_id,
     let mut llitem_ty = tpt.ty;
 
     let map_node = session::expect(ccx.sess, ccx.tcx.items.find(fn_id.node),
-     || fmt!{"While monomorphizing %?, couldn't find it in the item map \
+     || fmt!("While monomorphizing %?, couldn't find it in the item map \
         (may have attempted to monomorphize an item defined in a different \
-        crate?)", fn_id});
+        crate?)", fn_id));
     // Get the path so that we can create a symbol
     let (pt, name, span) = match map_node {
       ast_map::node_item(i, pt) => (pt, i.ident, i.span),
@@ -2287,7 +2287,7 @@ fn monomorphic_fn(ccx: @crate_ctxt, fn_id: ast::def_id,
     };
     ccx.monomorphizing.insert(fn_id, depth);
 
-    debug!{"leaving monomorphic fn %s", ty::item_path_str(ccx.tcx, fn_id)};
+    debug!("leaving monomorphic fn %s", ty::item_path_str(ccx.tcx, fn_id));
     {val: lldecl, must_cast: must_cast}
 }
 
@@ -2297,8 +2297,8 @@ fn maybe_instantiate_inline(ccx: @crate_ctxt, fn_id: ast::def_id)
     match ccx.external.find(fn_id) {
       some(some(node_id)) => {
         // Already inline
-        debug!{"maybe_instantiate_inline(%s): already inline as node id %d",
-               ty::item_path_str(ccx.tcx, fn_id), node_id};
+        debug!("maybe_instantiate_inline(%s): already inline as node id %d",
+               ty::item_path_str(ccx.tcx, fn_id), node_id);
         local_def(node_id)
       }
       some(none) => fn_id, // Not inlinable
@@ -2487,8 +2487,8 @@ fn take_local(table: hashmap<ast::node_id, local_val>,
         return {val: slf, kind: lv_owned};
       }
       _ => {
-        cx.sess().unimpl(fmt!{"unsupported def type in trans_local_var: %?",
-                              def});
+        cx.sess().unimpl(fmt!("unsupported def type in trans_local_var: %?",
+                              def));
       }
     }
 }
@@ -2576,7 +2576,7 @@ fn trans_rec_field_inner(bcx: block, val: ValueRef, ty: ty::t,
 
     let ix = field_idx_strict(bcx.tcx(), sp, field, fields);
 
-    debug!{"val = %s ix = %u", bcx.val_str(val), ix};
+    debug!("val = %s ix = %u", bcx.val_str(val), ix);
 
     /* self is a class with a dtor, which means we
        have to select out the object itself
@@ -2628,8 +2628,8 @@ fn trans_index(cx: block, ex: @ast::expr, base: @ast::expr,
         len = Sub(bcx, len, C_uint(bcx.ccx(), 1u));
     }
 
-    debug!{"trans_index: base %s", val_str(bcx.ccx().tn, base)};
-    debug!{"trans_index: len %s", val_str(bcx.ccx().tn, len)};
+    debug!("trans_index: base %s", val_str(bcx.ccx().tn, base));
+    debug!("trans_index: len %s", val_str(bcx.ccx().tn, len));
 
     let bounds_check = ICmp(bcx, lib::llvm::IntUGE, scaled_ix, len);
     let bcx = do with_cond(bcx, bounds_check) |bcx| {
@@ -2687,8 +2687,8 @@ fn trans_lval(cx: block, e: @ast::expr) -> lval_result {
         let lv = unrooted(cx, e);
 
         if !cx.sess().no_asm_comments() {
-            add_comment(cx, fmt!{"preserving until end of scope %d",
-                                 scope_id});
+            add_comment(cx, fmt!("preserving until end of scope %d",
+                                 scope_id));
         }
 
         let _icx = lv.bcx.insn_ctxt("root_value_lval");
@@ -2749,7 +2749,7 @@ fn unrooted(cx: block, e: @ast::expr) -> lval_result {
  * wrong address space and thus be the wrong type.
  */
 fn non_gc_box_cast(cx: block, val: ValueRef) -> ValueRef {
-    debug!{"non_gc_box_cast"};
+    debug!("non_gc_box_cast");
     add_comment(cx, ~"non_gc_box_cast");
     assert(llvm::LLVMGetPointerAddressSpace(val_ty(val)) as uint == 1u);
     let non_gc_t = T_ptr(llvm::LLVMGetElementType(val_ty(val)));
@@ -2904,7 +2904,7 @@ fn trans_arg_expr(cx: block, arg: ty::arg, lldestty: TypeRef, e: @ast::expr,
     -> result {
     let _icx = cx.insn_ctxt("trans_arg_expr");
     let ccx = cx.ccx();
-    debug!{"+++ trans_arg_expr on %s", expr_to_str(e, ccx.sess.intr())};
+    debug!("+++ trans_arg_expr on %s", expr_to_str(e, ccx.sess.intr()));
     let e_ty = expr_ty(cx, e);
     let is_bot = ty::type_is_bot(e_ty);
 
@@ -2925,7 +2925,7 @@ fn trans_arg_expr(cx: block, arg: ty::arg, lldestty: TypeRef, e: @ast::expr,
 
     // auto-deref value as required (this only applies to method
     // call receivers) of method
-    debug!{"   pre-deref value: %s", val_str(lv.bcx.ccx().tn, lv.val)};
+    debug!("   pre-deref value: %s", val_str(lv.bcx.ccx().tn, lv.val));
     let {lv, e_ty} = if derefs == 0u {
       {lv: lv, e_ty: e_ty}
     } else {
@@ -2937,11 +2937,11 @@ fn trans_arg_expr(cx: block, arg: ty::arg, lldestty: TypeRef, e: @ast::expr,
     };
 
     // borrow value (convert from @T to &T and so forth)
-    debug!{"   pre-adaptation value: %s", val_str(lv.bcx.ccx().tn, lv.val)};
+    debug!("   pre-adaptation value: %s", val_str(lv.bcx.ccx().tn, lv.val));
     let {lv, ty: e_ty} = adapt_borrowed_value(lv, e, e_ty);
     let mut bcx = lv.bcx;
     let mut val = lv.val;
-    debug!{"   adapted value: %s", val_str(bcx.ccx().tn, val)};
+    debug!("   adapted value: %s", val_str(bcx.ccx().tn, val));
 
     // finally, deal with the various modes
     let arg_mode = ty::resolved_mode(ccx.tcx, arg.mode);
@@ -2993,11 +2993,11 @@ fn trans_arg_expr(cx: block, arg: ty::arg, lldestty: TypeRef, e: @ast::expr,
     }
 
     if !is_bot && arg.ty != e_ty || ty::type_has_params(arg.ty) {
-        debug!{"   casting from %s", val_str(bcx.ccx().tn, val)};
+        debug!("   casting from %s", val_str(bcx.ccx().tn, val));
         val = PointerCast(bcx, val, lldestty);
     }
 
-    debug!{"--- trans_arg_expr passing %s", val_str(bcx.ccx().tn, val)};
+    debug!("--- trans_arg_expr passing %s", val_str(bcx.ccx().tn, val));
     return rslt(bcx, val);
 }
 
@@ -3038,9 +3038,9 @@ fn adapt_borrowed_value(lv: lval_result,
         let (base, len) = tvec::get_base_and_len(bcx, val, e_ty);
         let p = alloca(bcx, T_struct(~[T_ptr(llunit_ty), ccx.int_type]));
 
-        debug!{"adapt_borrowed_value: adapting %s to %s",
+        debug!("adapt_borrowed_value: adapting %s to %s",
                val_str(bcx.ccx().tn, val),
-               val_str(bcx.ccx().tn, p)};
+               val_str(bcx.ccx().tn, p));
 
         Store(bcx, base, GEPi(bcx, p, ~[0u, abi::slice_elt_base]));
         Store(bcx, len, GEPi(bcx, p, ~[0u, abi::slice_elt_len]));
@@ -3683,9 +3683,9 @@ fn lval_result_to_result(lv: lval_result, ty: ty::t) -> result {
 fn add_root_cleanup(bcx: block, scope_id: ast::node_id,
                     root_loc: ValueRef, ty: ty::t) {
 
-    debug!{"add_root_cleanup(bcx=%s, scope_id=%d, root_loc=%s, ty=%s)",
+    debug!("add_root_cleanup(bcx=%s, scope_id=%d, root_loc=%s, ty=%s)",
            bcx.to_str(), scope_id, val_str(bcx.ccx().tn, root_loc),
-           ppaux::ty_to_str(bcx.ccx().tcx, ty)};
+           ppaux::ty_to_str(bcx.ccx().tcx, ty));
 
     let bcx_scope = find_bcx_for_scope(bcx, scope_id);
     add_clean_temp_mem(bcx_scope, root_loc, ty);
@@ -3700,7 +3700,7 @@ fn find_bcx_for_scope(bcx: block, scope_id: ast::node_id) -> block {
               _ => {
                 match bcx_sid.parent {
                   none => bcx.tcx().sess.bug(
-                      fmt!{"no enclosing scope with id %d", scope_id}),
+                      fmt!("no enclosing scope with id %d", scope_id)),
                   some(bcx_par) => bcx_par
                 }
               }
@@ -3724,16 +3724,16 @@ fn trans_expr(bcx: block, e: @ast::expr, dest: dest) -> block {
     return match bcx.ccx().maps.root_map.find({id:e.id, derefs:0u}) {
       none => unrooted(bcx, e, dest),
       some(scope_id) => {
-        debug!{"expression %d found in root map with scope %d",
-               e.id, scope_id};
+        debug!("expression %d found in root map with scope %d",
+               e.id, scope_id);
 
         let ty = expr_ty(bcx, e);
         let root_loc = alloca_zeroed(bcx, type_of(bcx.ccx(), ty));
         let bcx = unrooted(bcx, e, save_in(root_loc));
 
         if !bcx.sess().no_asm_comments() {
-            add_comment(bcx, fmt!{"preserving until end of scope %d",
-                                  scope_id});
+            add_comment(bcx, fmt!("preserving until end of scope %d",
+                                  scope_id));
         }
 
         let _icx = bcx.insn_ctxt("root_value_expr");
@@ -3812,9 +3812,9 @@ fn ast_proto_to_proto_simple(ast_proto: ast::proto)
           ast::expr_fn_block(decl, body, cap_clause) => {
             match check ty::get(expr_ty(bcx, e)).struct {
               ty::ty_fn({proto, _}) => {
-                debug!{"translating fn_block %s with type %s",
+                debug!("translating fn_block %s with type %s",
                        expr_to_str(e, tcx.sess.intr()),
-                       ppaux::ty_to_str(tcx, expr_ty(bcx, e))};
+                       ppaux::ty_to_str(tcx, expr_ty(bcx, e)));
                 return closure::trans_expr_fn(bcx, proto, decl, body,
                                            e.id, cap_clause, none, dest);
               }
@@ -3945,8 +3945,8 @@ fn lval_to_dps(bcx: block, e: @ast::expr, dest: dest) -> block {
     let ty = expr_ty(bcx, e);
     let lv = trans_lval(bcx, e);
     let last_use = (lv.kind == lv_owned && last_use_map.contains_key(e.id));
-    debug!{"is last use (%s) = %b, %d", expr_to_str(e, bcx.ccx().sess.intr()),
-           last_use, lv.kind as int};
+    debug!("is last use (%s) = %b, %d", expr_to_str(e, bcx.ccx().sess.intr()),
+           last_use, lv.kind as int);
     lval_result_to_dps(lv, ty, last_use, dest)
 }
 
@@ -4297,7 +4297,7 @@ fn init_local(bcx: block, local: @ast::local) -> block {
 
 fn trans_stmt(cx: block, s: ast::stmt) -> block {
     let _icx = cx.insn_ctxt("trans_stmt");
-    debug!{"trans_stmt(%s)", stmt_to_str(s, cx.tcx().sess.intr())};
+    debug!("trans_stmt(%s)", stmt_to_str(s, cx.tcx().sess.intr()));
 
     if !cx.sess().no_asm_comments() {
         add_span_comment(cx, s.span, stmt_to_str(s, cx.ccx().sess.intr()));
@@ -4434,12 +4434,12 @@ fn cleanup_and_leave(bcx: block, upto: option<BasicBlockRef>,
     let mut cur = bcx, bcx = bcx;
     let is_lpad = leave == none;
     loop {
-        debug!{"cleanup_and_leave: leaving %s", cur.to_str()};
+        debug!("cleanup_and_leave: leaving %s", cur.to_str());
 
         if bcx.sess().trace() {
             trans_trace(
                 bcx, none,
-                fmt!{"cleanup_and_leave(%s)", cur.to_str()});
+                fmt!("cleanup_and_leave(%s)", cur.to_str()));
         }
 
         match cur.kind {
@@ -5133,9 +5133,9 @@ fn register_fn_fuller(ccx: @crate_ctxt, sp: span, path: path,
     let llfn: ValueRef = decl_fn(ccx.llmod, ps, cc, llfty);
     ccx.item_symbols.insert(node_id, ps);
 
-    debug!{"register_fn_fuller created fn %s for item %d with path %s",
+    debug!("register_fn_fuller created fn %s for item %d with path %s",
            val_str(ccx.tn, llfn), node_id,
-           ast_map::path_to_str(path, ccx.sess.parse_sess.interner)};
+           ast_map::path_to_str(path, ccx.sess.parse_sess.interner));
 
     let is_main = is_main_name(path) && !ccx.sess.building_library;
     if is_main { create_main_wrapper(ccx, sp, llfn, node_type); }
@@ -5276,8 +5276,8 @@ fn get_dtor_symbol(ccx: @crate_ctxt, path: path, id: ast::node_id,
                mono_ty)
          }
          none => {
-             ccx.sess.bug(fmt!{"get_dtor_symbol: not monomorphizing and \
-               couldn't find a symbol for dtor %?", path});
+             ccx.sess.bug(fmt!("get_dtor_symbol: not monomorphizing and \
+               couldn't find a symbol for dtor %?", path));
          }
        }
      }
@@ -5285,7 +5285,7 @@ fn get_dtor_symbol(ccx: @crate_ctxt, path: path, id: ast::node_id,
 }
 
 fn get_item_val(ccx: @crate_ctxt, id: ast::node_id) -> ValueRef {
-    debug!{"get_item_val(id=`%?`)", id};
+    debug!("get_item_val(id=`%?`)", id);
     let tcx = ccx.tcx;
     match ccx.item_vals.find(id) {
       some(v) => v,
@@ -5316,7 +5316,7 @@ fn get_item_val(ccx: @crate_ctxt, id: ast::node_id) -> ValueRef {
             }
           }
           ast_map::node_trait_method(trait_method, _, pth) => {
-            debug!{"get_item_val(): processing a node_trait_method"};
+            debug!("get_item_val(): processing a node_trait_method");
             match *trait_method {
               ast::required(_) => {
                 ccx.sess.bug(~"unexpected variant: required trait method in \
@@ -5527,7 +5527,7 @@ fn trap(bcx: block) {
 
 fn push_rtcall(ccx: @crate_ctxt, name: ~str, did: ast::def_id) {
     if ccx.rtcalls.contains_key(name) {
-        fail fmt!{"multiple definitions for runtime call %s", name};
+        fail fmt!("multiple definitions for runtime call %s", name);
     }
     ccx.rtcalls.insert(name, did);
 }
@@ -5597,7 +5597,7 @@ fn gather_rtcalls(ccx: @crate_ctxt, crate: @ast::crate) {
         ~[~"exchange_free", ~"exchange_malloc", ~"fail", ~"free", ~"malloc"];
     for vec::each(expected_rtcalls) |name| {
         if !ccx.rtcalls.contains_key(name) {
-            fail fmt!{"no definition for runtime call %s", name};
+            fail fmt!("no definition for runtime call %s", name);
         }
     }
 }
@@ -5867,25 +5867,25 @@ 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_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));
 
         // FIXME (#2280): this temporary shouldn't be
         // necessary, but seems to be, for borrowing.
         let times = copy *ccx.stats.fn_times;
         for vec::each(times) |timing| {
-            io::println(fmt!{"time: %s took %d ms", timing.ident,
-                             timing.time});
+            io::println(fmt!("time: %s took %d ms", timing.ident,
+                             timing.time));
         }
     }
 
     if ccx.sess.count_llvm_insns() {
         for ccx.stats.llvm_insns.each |k, v| {
-            io::println(fmt!{"%-7u %s", v, k});
+            io::println(fmt!("%-7u %s", v, k));
         }
     }
     return (llmod, link_meta);
index 915be95c6cafb9c295b49118cab013c2a1c2dfe6..3cf23840f3c9e0010894777196ef07a5f24206d5 100644 (file)
@@ -142,10 +142,10 @@ fn Invoke(cx: block, Fn: ValueRef, Args: ~[ValueRef],
     if cx.unreachable { return; }
     assert (!cx.terminated);
     cx.terminated = true;
-    debug!{"Invoke(%s with arguments (%s))",
+    debug!("Invoke(%s with arguments (%s))",
            val_str(cx.ccx().tn, Fn),
            str::connect(vec::map(Args, |a| val_str(cx.ccx().tn, a)),
-                        ~", ")};
+                        ~", "));
     unsafe {
         count_insn(cx, "invoke");
         llvm::LLVMBuildInvoke(B(cx), Fn, vec::unsafe::to_ptr(Args),
@@ -413,9 +413,9 @@ fn Load(cx: block, PointerVal: ValueRef) -> ValueRef {
 
 fn Store(cx: block, Val: ValueRef, Ptr: ValueRef) {
     if cx.unreachable { return; }
-    debug!{"Store %s -> %s",
+    debug!("Store %s -> %s",
            val_str(cx.ccx().tn, Val),
-           val_str(cx.ccx().tn, Ptr)};
+           val_str(cx.ccx().tn, Ptr));
     count_insn(cx, "store");
     llvm::LLVMBuildStore(B(cx), Val, Ptr);
 }
@@ -673,9 +673,9 @@ fn Call(cx: block, Fn: ValueRef, Args: ~[ValueRef]) -> ValueRef {
     unsafe {
         count_insn(cx, "call");
 
-        debug!{"Call(Fn=%s, Args=%?)",
+        debug!("Call(Fn=%s, Args=%?)",
                val_str(cx.ccx().tn, Fn),
-               Args.map(|arg| val_str(cx.ccx().tn, arg))};
+               Args.map(|arg| val_str(cx.ccx().tn, arg)));
 
         return llvm::LLVMBuildCall(B(cx), Fn, vec::unsafe::to_ptr(Args),
                                 Args.len() as c_uint, noname());
index 7b2ba7eee3bfcaf8f24d4b9afedcc98bf010252f..9b3b5d7e12a10bcc757305d623838ae61f9b0462 100644 (file)
@@ -100,12 +100,12 @@ enum environment_value {
 
 fn ev_to_str(ccx: @crate_ctxt, ev: environment_value) -> ~str {
     match ev {
-      env_copy(v, t, lk) => fmt!{"copy(%s,%s)", val_str(ccx.tn, v),
-                                ty_to_str(ccx.tcx, t)},
-      env_move(v, t, lk) => fmt!{"move(%s,%s)", val_str(ccx.tn, v),
-                                ty_to_str(ccx.tcx, t)},
-      env_ref(v, t, lk) => fmt!{"ref(%s,%s)", val_str(ccx.tn, v),
-                                ty_to_str(ccx.tcx, t)}
+      env_copy(v, t, lk) => fmt!("copy(%s,%s)", val_str(ccx.tn, v),
+                                ty_to_str(ccx.tcx, t)),
+      env_move(v, t, lk) => fmt!("move(%s,%s)", val_str(ccx.tn, v),
+                                ty_to_str(ccx.tcx, t)),
+      env_ref(v, t, lk) => fmt!("ref(%s,%s)", val_str(ccx.tn, v),
+                                ty_to_str(ccx.tcx, t))
     }
 }
 
@@ -129,7 +129,7 @@ fn mk_closure_tys(tcx: ty::ctxt,
         });
     }
     let cdata_ty = ty::mk_tup(tcx, bound_tys);
-    debug!{"cdata_ty=%s", ty_to_str(tcx, cdata_ty)};
+    debug!("cdata_ty=%s", ty_to_str(tcx, cdata_ty));
     return cdata_ty;
 }
 
@@ -195,16 +195,16 @@ fn store_environment(bcx: block,
     let cboxptr_ty = ty::mk_ptr(tcx, {ty:cbox_ty, mutbl:ast::m_imm});
 
     let llbox = PointerCast(bcx, llbox, type_of(ccx, cboxptr_ty));
-    debug!{"tuplify_box_ty = %s", ty_to_str(tcx, cbox_ty)};
+    debug!("tuplify_box_ty = %s", ty_to_str(tcx, cbox_ty));
 
     // Copy expr values into boxed bindings.
     let mut bcx = bcx;
     do vec::iteri(bound_values) |i, bv| {
-        debug!{"Copy %s into closure", ev_to_str(ccx, bv)};
+        debug!("Copy %s into closure", ev_to_str(ccx, bv));
 
         if !ccx.sess.no_asm_comments() {
-            add_comment(bcx, fmt!{"Copy %s into closure",
-                                  ev_to_str(ccx, bv)});
+            add_comment(bcx, fmt!("Copy %s into closure",
+                                  ev_to_str(ccx, bv)));
         }
 
         let bound_data = GEPi(bcx, llbox,
@@ -225,9 +225,9 @@ fn store_environment(bcx: block,
             bcx = move_val(bcx, INIT, bound_data, src, ty);
           }
           env_ref(val, ty, lv_owned) => {
-            debug!{"> storing %s into %s",
+            debug!("> storing %s into %s",
                    val_str(bcx.ccx().tn, val),
-                   val_str(bcx.ccx().tn, bound_data)};
+                   val_str(bcx.ccx().tn, bound_data));
             Store(bcx, val, bound_data);
           }
           env_ref(val, ty, lv_owned_imm) => {
@@ -259,13 +259,13 @@ fn build_closure(bcx0: block,
 
     // Package up the captured upvars
     do vec::iter(cap_vars) |cap_var| {
-        debug!{"Building closure: captured variable %?", cap_var};
+        debug!("Building closure: captured variable %?", cap_var);
         let lv = trans_local_var(bcx, cap_var.def);
         let nid = ast_util::def_id_of_def(cap_var.def).node;
-        debug!{"Node id is %s",
+        debug!("Node id is %s",
                syntax::ast_map::node_id_to_str
                    (bcx.ccx().tcx.items, nid,
-                    bcx.ccx().sess.parse_sess.interner)};
+                    bcx.ccx().sess.parse_sess.interner));
         let mut ty = node_id_type(bcx, nid);
         match cap_var.mode {
           capture::cap_ref => {
index 19f591f48855bcd007224d17eabe43f7898b59b7..47b427f387226e3e9d72e4af9833bce6900bb68a 100644 (file)
@@ -256,9 +256,9 @@ fn cleanup_type(cx: ty::ctxt, ty: ty::t) -> cleantype {
 
 fn add_clean(cx: block, val: ValueRef, ty: ty::t) {
     if !ty::type_needs_drop(cx.tcx(), ty) { return; }
-    debug!{"add_clean(%s, %s, %s)",
+    debug!("add_clean(%s, %s, %s)",
            cx.to_str(), val_str(cx.ccx().tn, val),
-           ty_to_str(cx.ccx().tcx, ty)};
+           ty_to_str(cx.ccx().tcx, ty));
     let cleanup_type = cleanup_type(cx.tcx(), ty);
     do in_scope_cx(cx) |info| {
         vec::push(info.cleanups, clean(|a| base::drop_ty(a, val, ty),
@@ -268,9 +268,9 @@ fn add_clean(cx: block, val: ValueRef, ty: ty::t) {
 }
 fn add_clean_temp(cx: block, val: ValueRef, ty: ty::t) {
     if !ty::type_needs_drop(cx.tcx(), ty) { return; }
-    debug!{"add_clean_temp(%s, %s, %s)",
+    debug!("add_clean_temp(%s, %s, %s)",
            cx.to_str(), val_str(cx.ccx().tn, val),
-           ty_to_str(cx.ccx().tcx, ty)};
+           ty_to_str(cx.ccx().tcx, ty));
     let cleanup_type = cleanup_type(cx.tcx(), ty);
     fn do_drop(bcx: block, val: ValueRef, ty: ty::t) ->
        block {
@@ -288,9 +288,9 @@ fn do_drop(bcx: block, val: ValueRef, ty: ty::t) ->
 }
 fn add_clean_temp_mem(cx: block, val: ValueRef, ty: ty::t) {
     if !ty::type_needs_drop(cx.tcx(), ty) { return; }
-    debug!{"add_clean_temp_mem(%s, %s, %s)",
+    debug!("add_clean_temp_mem(%s, %s, %s)",
            cx.to_str(), val_str(cx.ccx().tn, val),
-           ty_to_str(cx.ccx().tcx, ty)};
+           ty_to_str(cx.ccx().tcx, ty));
     let cleanup_type = cleanup_type(cx.tcx(), ty);
     do in_scope_cx(cx) |info| {
         vec::push(info.cleanups,
@@ -475,8 +475,8 @@ fn in_scope_cx(cx: block, f: fn(scope_info)) {
 fn block_parent(cx: block) -> block {
     match cx.parent {
       some(b) => b,
-      none    => cx.sess().bug(fmt!{"block_parent called on root block %?",
-                                   cx})
+      none    => cx.sess().bug(fmt!("block_parent called on root block %?",
+                                   cx))
     }
 }
 
@@ -496,10 +496,10 @@ fn ty_to_str(t: ty::t) -> ~str {
     fn to_str() -> ~str {
         match self.node_info {
           some(node_info) => {
-            fmt!{"[block %d]", node_info.id}
+            fmt!("[block %d]", node_info.id)
           }
           none => {
-            fmt!{"[block %x]", ptr::addr_of(*self) as uint}
+            fmt!("[block %x]", ptr::addr_of(*self) as uint)
           }
         }
     }
@@ -876,7 +876,7 @@ fn C_cstr(cx: @crate_ctxt, s: ~str) -> ValueRef {
         llvm::LLVMConstString(buf, str::len(s) as c_uint, False)
     };
     let g =
-        str::as_c_str(fmt!{"str%u", cx.names(~"str")},
+        str::as_c_str(fmt!("str%u", cx.names(~"str")),
                     |buf| llvm::LLVMAddGlobal(cx.llmod, val_ty(sc), buf));
     llvm::LLVMSetInitializer(g, sc);
     llvm::LLVMSetGlobalConstant(g, True);
@@ -930,7 +930,7 @@ fn C_bytes(bytes: ~[u8]) -> ValueRef unsafe {
 
 fn C_shape(ccx: @crate_ctxt, bytes: ~[u8]) -> ValueRef {
     let llshape = C_bytes(bytes);
-    let llglobal = str::as_c_str(fmt!{"shape%u", ccx.names(~"shape")}, |buf| {
+    let llglobal = str::as_c_str(fmt!("shape%u", ccx.names(~"shape")), |buf| {
         llvm::LLVMAddGlobal(ccx.llmod, val_ty(llshape), buf)
     });
     llvm::LLVMSetInitializer(llglobal, llshape);
@@ -1025,8 +1025,8 @@ fn field_idx_strict(cx: ty::ctxt, sp: span, ident: ast::ident,
     -> uint {
     match ty::field_idx(ident, fields) {
        none => cx.sess.span_bug(
-           sp, fmt!{"base expr doesn't appear to \
-                         have a field named %s", cx.sess.str_of(ident)}),
+           sp, fmt!("base expr doesn't appear to \
+                         have a field named %s", cx.sess.str_of(ident))),
        some(i) => i
     }
 }
index b1b70fe98a88aa4162a5062e90048ee9501661e4..18603f0edebdf71f9fc4faf12a49a4d4a0095229 100644 (file)
@@ -179,7 +179,7 @@ fn create_compile_unit(cx: @crate_ctxt)
                          lli32(DW_LANG_RUST),
                          llstr(crate_name),
                          llstr(work_dir),
-                         llstr(env!{"CFG_VERSION"}),
+                         llstr(env!("CFG_VERSION")),
                          lli1(true), // deprecated: main compile unit
                          lli1(cx.sess.opts.optimize != session::No),
                          llstr(~""), // flags (???)
@@ -712,7 +712,7 @@ fn create_function(fcx: fn_ctxt) -> @metadata<subprogram_md> {
     let cx = fcx.ccx;
     let dbg_cx = option::get(cx.dbg_cx);
 
-    debug!{"~~"};
+    debug!("~~");
     log(debug, fcx.id);
 
     let sp = option::get(fcx.span);
index 3b671b1148385ec4a9f490a5127f858104d72107..d5255bd17137b96418fe7e398c4e1a1d1e0b95ec 100644 (file)
@@ -931,10 +931,10 @@ fn trans_intrinsic(ccx: @crate_ctxt, decl: ValueRef, item: @ast::foreign_item,
               ast_map::node_expr(e) => e.span
             };
             ccx.sess.span_fatal(
-                sp, fmt!{"reinterpret_cast called on types \
+                sp, fmt!("reinterpret_cast called on types \
                           with different size: %s (%u) to %s (%u)",
                          ty_to_str(ccx.tcx, tp_ty), tp_sz,
-                         ty_to_str(ccx.tcx, substs.tys[1]), out_sz});
+                         ty_to_str(ccx.tcx, substs.tys[1]), out_sz));
         }
         if !ty::type_is_nil(substs.tys[1]) {
             let cast = PointerCast(bcx, get_param(decl, first_real_arg),
index 96169c8a22a4aead0b03763fd6c9e5d398c171bd..5ea2d8625e60930489845880f6b05f0edf6a2295 100644 (file)
@@ -174,9 +174,9 @@ fn traverse_expr(e: @expr, cx: ctx, v: visit::vt<ctx>) {
                 some(d) => {
                   traverse_def_id(cx, def_id_of_def(d));
                 }
-                none      => cx.tcx.sess.span_bug(e.span, fmt!{"Unbound node \
+                none      => cx.tcx.sess.span_bug(e.span, fmt!("Unbound node \
                   id %? while traversing %s", e.id,
-                  expr_to_str(e, cx.tcx.sess.intr())})
+                  expr_to_str(e, cx.tcx.sess.intr())))
             }
           }
           expr_field(_, _, _) => {
index 7a21bea30d392e7f7c3947db47c6bcf4718b46f4..3894c43b4e245939b579fdb26f65aa5b360fe5c0 100644 (file)
@@ -63,15 +63,15 @@ fn visit(ty_name: ~str, args: ~[ValueRef]) {
         let get_lval = |bcx| {
             let callee =
                 impl::trans_trait_callee(bcx, v, mth_ty, mth_idx);
-            debug!{"calling mth ty %s, lltype %s",
+            debug!("calling mth ty %s, lltype %s",
                    ty_to_str(bcx.ccx().tcx, mth_ty),
-                   val_str(bcx.ccx().tn, callee.val)};
+                   val_str(bcx.ccx().tn, callee.val));
             callee
         };
-        debug!{"passing %u args:", vec::len(args)};
+        debug!("passing %u args:", vec::len(args));
         let bcx = self.bcx;
         for args.eachi |i, a| {
-            debug!{"arg %u: %s", i, val_str(bcx.ccx().tn, a)};
+            debug!("arg %u: %s", i, val_str(bcx.ccx().tn, a));
         }
         let d = empty_dest_cell();
         let bcx =
@@ -112,8 +112,8 @@ fn leaf(name: ~str) {
     fn visit_ty(t: ty::t) {
 
         let bcx = self.bcx;
-        debug!{"reflect::visit_ty %s",
-               ty_to_str(bcx.ccx().tcx, t)};
+        debug!("reflect::visit_ty %s",
+               ty_to_str(bcx.ccx().tcx, t));
 
         match ty::get(t).struct {
           ty::ty_bot => self.leaf(~"bot"),
index 9633284758810ac95d5f2cfb5b769893866caec6..6ba3ac38dc365a156cd4af1a078496b097395ca9 100644 (file)
@@ -209,9 +209,9 @@ fn trans_evec(bcx: block, elements: evec_elements,
 
     // Store the individual elements.
     let mut i = 0u, temp_cleanups = ~[val];
-    debug!{"trans_evec: v: %s, dataptr: %s",
+    debug!("trans_evec: v: %s, dataptr: %s",
            val_str(ccx.tn, val),
-           val_str(ccx.tn, dataptr)};
+           val_str(ccx.tn, dataptr));
     match elements {
         individual_evec(args) => {
             for vec::each(args) |e| {
@@ -309,7 +309,7 @@ fn get_base_and_len(cx: block, v: ValueRef, e_ty: ty::t)
         (base, len)
       }
       ty::vstore_uniq | ty::vstore_box => {
-        debug!{"get_base_and_len: %s", val_str(ccx.tn, v)};
+        debug!("get_base_and_len: %s", val_str(ccx.tn, v));
         let body = tvec::get_bodyptr(cx, v);
         (tvec::get_dataptr(cx, body), tvec::get_fill(cx, body))
       }
@@ -325,13 +325,13 @@ fn trans_estr(bcx: block, s: @~str, vstore: option<ast::vstore>,
     let c = match vstore {
       some(ast::vstore_fixed(_)) => {
         // "hello"/_  =>  "hello"/5  =>  ~[i8 x 6] in llvm
-        debug!{"trans_estr: fixed: %s", *s};
+        debug!("trans_estr: fixed: %s", *s);
         C_postr(*s)
       }
 
       some(ast::vstore_slice(_)) | none => {
         // "hello"  =>  (*i8, 6u) in llvm
-        debug!{"trans_estr: slice '%s'", *s};
+        debug!("trans_estr: slice '%s'", *s);
         C_estr_slice(ccx, *s)
       }
 
@@ -352,7 +352,7 @@ fn trans_estr(bcx: block, s: @~str, vstore: option<ast::vstore>,
       }
     };
 
-    debug!{"trans_estr: type: %s", val_str(ccx.tn, c)};
+    debug!("trans_estr: type: %s", val_str(ccx.tn, c));
     base::store_in_dest(bcx, c, dest)
 }
 
index f48fa78268397b55dc943cc9468ac809a531eb2f..c5d7b5d74498d35edb2d184347e563b4b1b38a09 100644 (file)
@@ -67,7 +67,7 @@ fn type_of_non_gc_box(cx: @crate_ctxt, t: ty::t) -> TypeRef {
 }
 
 fn type_of(cx: @crate_ctxt, t: ty::t) -> TypeRef {
-    debug!{"type_of %?: %?", t, ty::get(t)};
+    debug!("type_of %?: %?", t, ty::get(t));
 
     // Check the cache.
     if cx.lltypes.contains_key(t) { return cx.lltypes.get(t); }
@@ -203,7 +203,7 @@ fn type_of(cx: @crate_ctxt, t: ty::t) -> TypeRef {
 fn fill_type_of_enum(cx: @crate_ctxt, did: ast::def_id, t: ty::t,
                      llty: TypeRef) {
 
-    debug!{"type_of_enum %?: %?", t, ty::get(t)};
+    debug!("type_of_enum %?: %?", t, ty::get(t));
 
     let lltys = {
         let degen = (*ty::enum_variants(cx.tcx, did)).len() == 1u;
@@ -227,7 +227,7 @@ fn llvm_type_name(cx: @crate_ctxt, t: ty::t) -> ~str {
       ty::ty_enum(did, substs) => (~"enum", did, substs.tps),
       ty::ty_class(did, substs) => (~"class", did, substs.tps)
     };
-    return fmt!{
+    return fmt!(
         "%s %s[#%d]",
         name,
         util::ppaux::parameterized(
@@ -236,7 +236,7 @@ fn llvm_type_name(cx: @crate_ctxt, t: ty::t) -> ~str {
             none,
             tps),
         did.crate
-    };
+    );
 }
 
 fn type_of_dtor(ccx: @crate_ctxt, self_ty: ty::t) -> TypeRef {
index 727bf0d9e086617d32456085c5933b7c1b061e7f..1b084670f94e144ab973303e6f72aa6cacb9773e 100644 (file)
@@ -61,8 +61,8 @@ fn type_uses_for(ccx: @crate_ctxt, fn_id: def_id, n_tps: uint)
     }
     let map_node = match ccx.tcx.items.find(fn_id_loc.node) {
         some(x) => x,
-        none    => ccx.sess.bug(fmt!{"type_uses_for: unbound item ID %?",
-                                     fn_id_loc})
+        none    => ccx.sess.bug(fmt!("type_uses_for: unbound item ID %?",
+                                     fn_id_loc))
     };
     match map_node {
       ast_map::node_item(@{node: item_fn(_, _, body), _}, _) |
index f9b4a76bced04c646a68f8d6b8aa56789b6a1e5a..1d5d5d6f4fa497bad74ae33425739fd3816425dc 100644 (file)
@@ -41,8 +41,8 @@ fn duplicate(bcx: block, v: ValueRef, t: ty::t) -> result {
     let src_box = v;
     let src_body = opaque_box_body(bcx, content_ty, src_box);
     let src_body = load_if_immediate(bcx, src_body, content_ty);
-    debug!{"ST: %?", val_str(bcx.ccx().tn, src_body)};
-    debug!{"DT: %?", val_str(bcx.ccx().tn, dst_body)};
+    debug!("ST: %?", val_str(bcx.ccx().tn, src_body));
+    debug!("DT: %?", val_str(bcx.ccx().tn, dst_body));
     let bcx = copy_val(bcx, INIT, dst_body, src_body, content_ty);
 
     let src_tydesc_ptr = GEPi(bcx, src_box,
diff --git a/src/rustc/middle/tstate/annotate.rs b/src/rustc/middle/tstate/annotate.rs
new file mode 100644 (file)
index 0000000..8dcbe22
--- /dev/null
@@ -0,0 +1,76 @@
+
+import syntax::ast::*;
+import syntax::visit;
+import syntax::codemap::span;
+import syntax::print::pprust::stmt_to_str;
+import aux::{num_constraints, get_fn_info, crate_ctxt, add_node};
+import ann::empty_ann;
+import pat_util::pat_binding_ids;
+
+fn collect_ids_expr(e: @expr, rs: @mut ~[node_id]) { vec::push(*rs, e.id); }
+
+fn collect_ids_block(b: blk, rs: @mut ~[node_id]) {
+    vec::push(*rs, b.node.id);
+}
+
+fn collect_ids_stmt(s: @stmt, rs: @mut ~[node_id]) {
+    match s.node {
+      stmt_decl(_, id) | stmt_expr(_, id) | stmt_semi(_, id) {
+        debug!("node_id %s", int::str(id));
+        debug!("%s", stmt_to_str(*s));
+        vec::push(*rs, id);
+      }
+    }
+}
+
+fn collect_ids_local(tcx: ty::ctxt, l: @local, rs: @mut ~[node_id]) {
+    vec::push_all(*rs, pat_binding_ids(tcx.def_map, l.node.pat));
+}
+
+fn node_ids_in_fn(tcx: ty::ctxt, body: blk, rs: @mut ~[node_id]) {
+    let collect_ids =
+        visit::mk_simple_visitor(@{visit_expr: |a| collect_ids_expr(a, rs),
+                                   visit_block: |a| collect_ids_block(a, rs),
+                                   visit_stmt: |a| collect_ids_stmt(a, rs),
+                                   visit_local: |a|
+                                       collect_ids_local(tcx, a, rs)
+                                   with *visit::default_simple_visitor()});
+    collect_ids.visit_block(body, (), collect_ids);
+}
+
+fn init_vecs(ccx: crate_ctxt, node_ids: ~[node_id], len: uint) {
+    for node_ids.each |i| {
+        log(debug, int::str(i) + ~" |-> " + uint::str(len));
+        add_node(ccx, i, empty_ann(len));
+    }
+}
+
+fn visit_fn(ccx: crate_ctxt, num_constraints: uint, body: blk) {
+    let node_ids: @mut ~[node_id] = @mut ~[];
+    node_ids_in_fn(ccx.tcx, body, node_ids);
+    let node_id_vec = *node_ids;
+    init_vecs(ccx, node_id_vec, num_constraints);
+}
+
+fn annotate_in_fn(ccx: crate_ctxt, _fk: visit::fn_kind, _decl: fn_decl,
+                  body: blk, _sp: span, id: node_id) {
+    let f_info = get_fn_info(ccx, id);
+    visit_fn(ccx, num_constraints(f_info), body);
+}
+
+fn annotate_crate(ccx: crate_ctxt, crate: crate) {
+    let do_ann =
+        visit::mk_simple_visitor(
+            @{visit_fn: |a,b,c,d,e| annotate_in_fn(ccx, a, b, c, d, e)
+              with *visit::default_simple_visitor()});
+    visit::visit_crate(crate, (), do_ann);
+}
+//
+// Local Variables:
+// mode: rust
+// fill-column: 78;
+// indent-tabs-mode: nil
+// c-basic-offset: 4
+// buffer-file-coding-system: utf-8-unix
+// End:
+//
diff --git a/src/rustc/middle/tstate/auxiliary.rs b/src/rustc/middle/tstate/auxiliary.rs
new file mode 100644 (file)
index 0000000..805b13b
--- /dev/null
@@ -0,0 +1,990 @@
+import option::*;
+import pat_util::*;
+import syntax::ast::*;
+import syntax::ast_util::*;
+import syntax::{visit, codemap};
+import codemap::span;
+import std::map::{hashmap, int_hash};
+import syntax::print::pprust::path_to_str;
+import tstate::ann::{pre_and_post, pre_and_post_state, empty_ann, prestate,
+                     poststate, precond, postcond,
+                     set_prestate, set_poststate, set_in_poststate_,
+                     extend_prestate, extend_poststate, set_precondition,
+                     set_postcondition, ts_ann,
+                     clear_in_postcond,
+                     clear_in_poststate_};
+import driver::session::session;
+import dvec::{dvec, extensions};
+import tritv::{trit, tfalse, ttrue, dont_care, t};
+
+import syntax::print::pprust::{constr_args_to_str, lit_to_str};
+
+// Used to communicate which operands should be invalidated
+// to helper functions
+enum oper_type {
+    oper_move,
+    oper_swap,
+    oper_assign,
+    oper_assign_op,
+    oper_pure,
+}
+
+/* logging funs */
+fn def_id_to_str(d: def_id) -> ~str {
+    return int::str(d.crate) + ~"," + int::str(d.node);
+}
+
+fn comma_str(args: ~[@constr_arg_use]) -> ~str {
+    let mut rslt = ~"";
+    let mut comma = false;
+    for args.each |a| {
+        if comma { rslt += ~", "; } else { comma = true; }
+        match a.node {
+          carg_base { rslt += ~"*"; }
+          carg_ident(i) { rslt += *i.ident; }
+          carg_lit(l) { rslt += lit_to_str(l); }
+        }
+    }
+    return rslt;
+}
+
+fn constraint_to_str(tcx: ty::ctxt, c: sp_constr) -> ~str {
+    return fmt!("%s(%s) - arising from %s",
+             path_to_str(c.node.path),
+             comma_str(c.node.args),
+             codemap::span_to_str(c.span, tcx.sess.codemap));
+}
+
+fn tritv_to_str(fcx: fn_ctxt, v: tritv::t) -> ~str {
+    let mut s = ~"";
+    let mut comma = false;
+    for constraints(fcx).each |p| {
+        match v.get(p.bit_num) {
+          dont_care { }
+          tt {
+            s +=
+                if comma { ~", " } else { comma = true; ~"" } +
+                    if tt == tfalse { ~"!" } else { ~"" } +
+                    constraint_to_str(fcx.ccx.tcx, p.c);
+          }
+        }
+    }
+    return s;
+}
+
+fn log_tritv(fcx: fn_ctxt, v: tritv::t) {
+    log(debug, tritv_to_str(fcx, v));
+}
+
+fn first_difference_string(fcx: fn_ctxt, expected: tritv::t, actual: tritv::t)
+   -> ~str {
+    let mut s = ~"";
+    for constraints(fcx).each |c| {
+      if expected.get(c.bit_num) == ttrue &&
+         actual.get(c.bit_num) != ttrue {
+            s = constraint_to_str(fcx.ccx.tcx, c.c);
+            break;
+        }
+    }
+    return s;
+}
+
+fn log_tritv_err(fcx: fn_ctxt, v: tritv::t) {
+    log(error, tritv_to_str(fcx, v));
+}
+
+fn tos(v: ~[uint]) -> ~str {
+    let mut rslt = ~"";
+    for v.each |i| {
+        if i == 0u {
+            rslt += ~"0";
+        } else if i == 1u { rslt += ~"1"; } else { rslt += ~"?"; }
+    }
+    return rslt;
+}
+
+fn log_cond(v: ~[uint]) { log(debug, tos(v)); }
+
+fn log_cond_err(v: ~[uint]) { log(error, tos(v)); }
+
+fn log_pp(pp: pre_and_post) {
+    let p1 = pp.precondition.to_vec();
+    let p2 = pp.postcondition.to_vec();
+    debug!("pre:");
+    log_cond(p1);
+    debug!("post:");
+    log_cond(p2);
+}
+
+fn log_pp_err(pp: pre_and_post) {
+    let p1 = pp.precondition.to_vec();
+    let p2 = pp.postcondition.to_vec();
+    error!("pre:");
+    log_cond_err(p1);
+    error!("post:");
+    log_cond_err(p2);
+}
+
+fn log_states(pp: pre_and_post_state) {
+    let p1 = pp.prestate.to_vec();
+    let p2 = pp.poststate.to_vec();
+    debug!("prestate:");
+    log_cond(p1);
+    debug!("poststate:");
+    log_cond(p2);
+}
+
+fn log_states_err(pp: pre_and_post_state) {
+    let p1 = pp.prestate.to_vec();
+    let p2 = pp.poststate.to_vec();
+    error!("prestate:");
+    log_cond_err(p1);
+    error!("poststate:");
+    log_cond_err(p2);
+}
+
+fn print_ident(i: ident) { log(debug, ~" " + *i + ~" "); }
+
+fn print_idents(&idents: ~[ident]) {
+    if vec::len::<ident>(idents) == 0u { return; }
+    log(debug, ~"an ident: " + *vec::pop::<ident>(idents));
+    print_idents(idents);
+}
+
+
+/* data structures */
+
+/**********************************************************************/
+
+/* Two different data structures represent constraints in different
+ contexts: constraint and norm_constraint.
+
+constraint gets used to record constraints in a table keyed by def_ids.  Each
+constraint has a single operator but a list of possible argument lists, and
+thus represents several constraints at once, one for each possible argument
+list.
+
+norm_constraint, in contrast, gets used when handling an instance of a
+constraint rather than a definition of a constraint. It has only a single
+argument list.
+
+The representation of constraints, where multiple instances of the
+same predicate are collapsed into one entry in the table, makes it
+easier to look up a specific instance.
+
+Both types are in constrast with the constraint type defined in
+syntax::ast, which is for predicate constraints only, and is what
+gets generated by the parser. aux and ast share the same type
+to represent predicate *arguments* however. This type
+(constr_arg_general) is parameterized (see comments in syntax::ast).
+
+Both types store an ident and span, for error-logging purposes.
+*/
+type pred_args_ = {args: ~[@constr_arg_use], bit_num: uint};
+
+type pred_args = spanned<pred_args_>;
+
+// The attached node ID is the *defining* node ID
+// for this local.
+type constr_arg_use = spanned<constr_arg_general_<inst>>;
+
+/* Predicate constraints refer to the truth value of a predicate on variables
+(definitely false, maybe true, or definitely true).  The <path> field (and the
+<def_id> field in the npred constructor) names a user-defined function that
+may be the operator in a "check" expression in the source.  */
+
+type constraint = {
+    path: @path,
+    // FIXME (#2539): really only want it to be mut during
+    // collect_locals.  freeze it after that.
+    descs: @dvec<pred_args>
+};
+
+type tsconstr = {
+    path: @path,
+    def_id: def_id,
+    args: ~[@constr_arg_use]
+};
+
+type sp_constr = spanned<tsconstr>;
+
+type norm_constraint = {bit_num: uint, c: sp_constr};
+
+type constr_map = std::map::hashmap<def_id, constraint>;
+
+/* Contains stuff that has to be computed up front */
+/* For easy access, the fn_info stores two special constraints for each
+function.  So we need context. And so it seems clearer to just have separate
+constraints. */
+type fn_info =
+    /* list, accumulated during pre/postcondition
+    computation, of all local variables that may be
+    used */
+    // Doesn't seem to work without the @ -- bug
+    {constrs: constr_map,
+     num_constraints: uint,
+     cf: ret_style,
+     used_vars: @mut ~[node_id],
+     ignore: bool};
+
+/* mapping from node ID to typestate annotation */
+type node_ann_table = @mut ~[mut ts_ann];
+
+
+/* mapping from function name to fn_info map */
+type fn_info_map = std::map::hashmap<node_id, fn_info>;
+
+type fn_ctxt =
+    {enclosing: fn_info, id: node_id, name: ident, ccx: crate_ctxt};
+
+type crate_ctxt = {tcx: ty::ctxt, node_anns: node_ann_table, fm: fn_info_map};
+
+fn get_fn_info(ccx: crate_ctxt, id: node_id) -> fn_info {
+    assert (ccx.fm.contains_key(id));
+    return ccx.fm.get(id);
+}
+
+fn add_node(ccx: crate_ctxt, i: node_id, a: ts_ann) {
+    let sz = vec::len(*ccx.node_anns);
+    if sz <= i as uint {
+        vec::grow(*ccx.node_anns, (i as uint) - sz + 1u, empty_ann(0u));
+    }
+    ccx.node_anns[i] = a;
+}
+
+fn get_ts_ann(ccx: crate_ctxt, i: node_id) -> option<ts_ann> {
+    if i as uint < vec::len(*ccx.node_anns) {
+        return some::<ts_ann>(ccx.node_anns[i]);
+    } else { return none::<ts_ann>; }
+}
+
+
+/********* utils ********/
+fn node_id_to_ts_ann(ccx: crate_ctxt, id: node_id) -> ts_ann {
+    match get_ts_ann(ccx, id) {
+      none {
+        error!("node_id_to_ts_ann: no ts_ann for node_id %d", id);
+        fail;
+      }
+      some(tt) { return tt; }
+    }
+}
+
+fn node_id_to_poststate(ccx: crate_ctxt, id: node_id) -> poststate {
+    debug!("node_id_to_poststate");
+    return node_id_to_ts_ann(ccx, id).states.poststate;
+}
+
+fn stmt_to_ann(ccx: crate_ctxt, s: stmt) -> ts_ann {
+    debug!("stmt_to_ann");
+    match s.node {
+      stmt_decl(_, id) | stmt_expr(_, id) | stmt_semi(_, id) {
+        return node_id_to_ts_ann(ccx, id);
+      }
+    }
+}
+
+
+/* fails if e has no annotation */
+fn expr_states(ccx: crate_ctxt, e: @expr) -> pre_and_post_state {
+    debug!("expr_states");
+    return node_id_to_ts_ann(ccx, e.id).states;
+}
+
+
+/* fails if e has no annotation */
+fn expr_pp(ccx: crate_ctxt, e: @expr) -> pre_and_post {
+    debug!("expr_pp");
+    return node_id_to_ts_ann(ccx, e.id).conditions;
+}
+
+fn stmt_pp(ccx: crate_ctxt, s: stmt) -> pre_and_post {
+    return stmt_to_ann(ccx, s).conditions;
+}
+
+
+/* fails if b has no annotation */
+fn block_pp(ccx: crate_ctxt, b: blk) -> pre_and_post {
+    debug!("block_pp");
+    return node_id_to_ts_ann(ccx, b.node.id).conditions;
+}
+
+fn clear_pp(pp: pre_and_post) {
+    ann::clear(pp.precondition);
+    ann::clear(pp.postcondition);
+}
+
+fn clear_precond(ccx: crate_ctxt, id: node_id) {
+    let pp = node_id_to_ts_ann(ccx, id);
+    ann::clear(pp.conditions.precondition);
+}
+
+fn block_states(ccx: crate_ctxt, b: blk) -> pre_and_post_state {
+    debug!("block_states");
+    return node_id_to_ts_ann(ccx, b.node.id).states;
+}
+
+fn stmt_states(ccx: crate_ctxt, s: stmt) -> pre_and_post_state {
+    return stmt_to_ann(ccx, s).states;
+}
+
+fn expr_precond(ccx: crate_ctxt, e: @expr) -> precond {
+    return expr_pp(ccx, e).precondition;
+}
+
+fn expr_postcond(ccx: crate_ctxt, e: @expr) -> postcond {
+    return expr_pp(ccx, e).postcondition;
+}
+
+fn expr_prestate(ccx: crate_ctxt, e: @expr) -> prestate {
+    return expr_states(ccx, e).prestate;
+}
+
+fn expr_poststate(ccx: crate_ctxt, e: @expr) -> poststate {
+    return expr_states(ccx, e).poststate;
+}
+
+fn stmt_precond(ccx: crate_ctxt, s: stmt) -> precond {
+    return stmt_pp(ccx, s).precondition;
+}
+
+fn stmt_postcond(ccx: crate_ctxt, s: stmt) -> postcond {
+    return stmt_pp(ccx, s).postcondition;
+}
+
+fn states_to_poststate(ss: pre_and_post_state) -> poststate {
+    return ss.poststate;
+}
+
+fn stmt_prestate(ccx: crate_ctxt, s: stmt) -> prestate {
+    return stmt_states(ccx, s).prestate;
+}
+
+fn stmt_poststate(ccx: crate_ctxt, s: stmt) -> poststate {
+    return stmt_states(ccx, s).poststate;
+}
+
+fn block_precond(ccx: crate_ctxt, b: blk) -> precond {
+    return block_pp(ccx, b).precondition;
+}
+
+fn block_postcond(ccx: crate_ctxt, b: blk) -> postcond {
+    return block_pp(ccx, b).postcondition;
+}
+
+fn block_prestate(ccx: crate_ctxt, b: blk) -> prestate {
+    return block_states(ccx, b).prestate;
+}
+
+fn block_poststate(ccx: crate_ctxt, b: blk) -> poststate {
+    return block_states(ccx, b).poststate;
+}
+
+fn set_prestate_ann(ccx: crate_ctxt, id: node_id, pre: prestate) -> bool {
+    debug!("set_prestate_ann");
+    return set_prestate(node_id_to_ts_ann(ccx, id), pre);
+}
+
+fn extend_prestate_ann(ccx: crate_ctxt, id: node_id, pre: prestate) -> bool {
+    debug!("extend_prestate_ann");
+    return extend_prestate(node_id_to_ts_ann(ccx, id).states.prestate, pre);
+}
+
+fn set_poststate_ann(ccx: crate_ctxt, id: node_id, post: poststate) -> bool {
+    debug!("set_poststate_ann");
+    return set_poststate(node_id_to_ts_ann(ccx, id), post);
+}
+
+fn extend_poststate_ann(ccx: crate_ctxt, id: node_id, post: poststate) ->
+   bool {
+    debug!("extend_poststate_ann");
+    return extend_poststate(
+        node_id_to_ts_ann(ccx, id).states.poststate, post);
+}
+
+fn set_pre_and_post(ccx: crate_ctxt, id: node_id, pre: precond,
+                    post: postcond) {
+    debug!("set_pre_and_post");
+    let tt = node_id_to_ts_ann(ccx, id);
+    set_precondition(tt, pre);
+    set_postcondition(tt, post);
+}
+
+fn copy_pre_post(ccx: crate_ctxt, id: node_id, sub: @expr) {
+    debug!("set_pre_and_post");
+    let p = expr_pp(ccx, sub);
+    copy_pre_post_(ccx, id, p.precondition, p.postcondition);
+}
+
+fn copy_pre_post_(ccx: crate_ctxt, id: node_id, pre: prestate,
+                  post: poststate) {
+    debug!("set_pre_and_post");
+    let tt = node_id_to_ts_ann(ccx, id);
+    set_precondition(tt, pre);
+    set_postcondition(tt, post);
+}
+
+/* sets all bits to *1* */
+fn set_postcond_false(ccx: crate_ctxt, id: node_id) {
+    let p = node_id_to_ts_ann(ccx, id);
+    ann::set(p.conditions.postcondition);
+}
+
+fn pure_exp(ccx: crate_ctxt, id: node_id, p: prestate) -> bool {
+    return set_prestate_ann(ccx, id, p) | set_poststate_ann(ccx, id, p);
+}
+
+fn num_constraints(m: fn_info) -> uint { return m.num_constraints; }
+
+fn new_crate_ctxt(cx: ty::ctxt) -> crate_ctxt {
+    let na: ~[mut ts_ann] = ~[mut];
+    return {tcx: cx, node_anns: @mut na, fm: int_hash::<fn_info>()};
+}
+
+/* Use e's type to determine whether it returns.
+ If it has a function type with a ! annotation,
+the answer is noreturn. */
+fn controlflow_expr(ccx: crate_ctxt, e: @expr) -> ret_style {
+    match ty::get(ty::node_id_to_type(ccx.tcx, e.id)).struct {
+      ty::ty_fn(f) { return f.ret_style; }
+      _ { return return_val; }
+    }
+}
+
+fn constraints_expr(cx: ty::ctxt, e: @expr) -> ~[@ty::constr] {
+    match ty::get(ty::node_id_to_type(cx, e.id)).struct {
+      ty::ty_fn(f) { return f.constraints; }
+      _ { return ~[]; }
+    }
+}
+
+fn node_id_to_def_strict(cx: ty::ctxt, id: node_id) -> def {
+    match cx.def_map.find(id) {
+      none {
+        error!("node_id_to_def: node_id %d has no def", id);
+        fail;
+      }
+      some(d) { return d; }
+    }
+}
+
+fn node_id_to_def(ccx: crate_ctxt, id: node_id) -> option<def> {
+    return ccx.tcx.def_map.find(id);
+}
+
+fn norm_a_constraint(id: def_id, c: constraint) -> ~[norm_constraint] {
+    let mut rslt: ~[norm_constraint] = ~[];
+    for (*c.descs).each |pd| {
+        vec::push(rslt,
+                  {bit_num: pd.node.bit_num,
+                   c: respan(pd.span, {path: c.path,
+                                       def_id: id,
+                                       args: pd.node.args})});
+    }
+    return rslt;
+}
+
+
+// Tried to write this as an iterator, but I got a
+// non-exhaustive match in trans.
+fn constraints(fcx: fn_ctxt) -> ~[norm_constraint] {
+    let mut rslt: ~[norm_constraint] = ~[];
+    for fcx.enclosing.constrs.each |key, val| {
+        vec::push_all(rslt, norm_a_constraint(key, val));
+    };
+    return rslt;
+}
+
+// FIXME (#2539): Would rather take an immutable vec as an argument,
+// should freeze it at some earlier point.
+fn match_args(fcx: fn_ctxt, occs: @dvec<pred_args>,
+              occ: ~[@constr_arg_use]) -> uint {
+    debug!("match_args: looking at %s",
+           constr_args_to_str(fn@(i: inst) -> ~str { *i.ident }, occ));
+    for (*occs).each |pd| {
+        log(debug,
+                 ~"match_args: candidate " + pred_args_to_str(pd));
+        fn eq(p: inst, q: inst) -> bool { return p.node == q.node; }
+        if ty::args_eq(eq, pd.node.args, occ) { return pd.node.bit_num; }
+    }
+    fcx.ccx.tcx.sess.bug(~"match_args: no match for occurring args");
+}
+
+fn def_id_for_constr(tcx: ty::ctxt, t: node_id) -> def_id {
+    match tcx.def_map.find(t) {
+      none {
+        tcx.sess.bug(~"node_id_for_constr: bad node_id " + int::str(t));
+      }
+      some(def_fn(i, _)) { return i; }
+      _ { tcx.sess.bug(~"node_id_for_constr: pred is not a function"); }
+    }
+}
+
+fn expr_to_constr_arg(tcx: ty::ctxt, e: @expr) -> @constr_arg_use {
+    match e.node {
+      expr_path(p) {
+        match tcx.def_map.find(e.id) {
+          some(def_local(nid, _)) | some(def_arg(nid, _)) |
+          some(def_binding(nid, _)) | some(def_upvar(nid, _, _, _)) {
+            return @respan(p.span,
+                        carg_ident({ident: p.idents[0], node: nid}));
+          }
+          some(what) {
+              tcx.sess.span_bug(e.span,
+                 fmt!("exprs_to_constr_args: non-local variable %? \
+                                     as pred arg", what));
+          }
+          none {
+              tcx.sess.span_bug(e.span,
+                 ~"exprs_to_constr_args: unbound id as pred arg");
+
+          }
+        }
+      }
+      expr_lit(l) { return @respan(e.span, carg_lit(l)); }
+      _ {
+        tcx.sess.span_fatal(e.span,
+                            ~"arguments to constrained functions must be " +
+                                ~"literals or local variables");
+      }
+    }
+}
+
+fn exprs_to_constr_args(tcx: ty::ctxt,
+                        args: ~[@expr]) -> ~[@constr_arg_use] {
+    let f = |a| expr_to_constr_arg(tcx, a);
+    let mut rslt: ~[@constr_arg_use] = ~[];
+    for args.each |e| { vec::push(rslt, f(e)); }
+    rslt
+}
+
+fn expr_to_constr(tcx: ty::ctxt, e: @expr) -> sp_constr {
+    match e.node {
+      expr_call(operator, args, _) {
+        match operator.node {
+          expr_path(p) {
+            return respan(e.span,
+                       {path: p,
+                        def_id: def_id_for_constr(tcx, operator.id),
+                        args: exprs_to_constr_args(tcx, args)});
+          }
+          _ {
+            tcx.sess.span_bug(operator.span,
+                              ~"ill-formed operator in predicate");
+          }
+        }
+      }
+      _ {
+        tcx.sess.span_bug(e.span, ~"ill-formed predicate");
+      }
+    }
+}
+
+fn pred_args_to_str(p: pred_args) -> ~str {
+    ~"<" + uint::str(p.node.bit_num) + ~", " +
+        constr_args_to_str(fn@(i: inst) -> ~str {return *i.ident; },
+                           p.node.args)
+        + ~">"
+}
+
+fn substitute_constr_args(cx: ty::ctxt, actuals: ~[@expr], c: @ty::constr) ->
+   tsconstr {
+    let mut rslt: ~[@constr_arg_use] = ~[];
+    for c.node.args.each |a| {
+        vec::push(rslt, substitute_arg(cx, actuals, a));
+    }
+    return {path: c.node.path,
+         def_id: c.node.id,
+         args: rslt};
+}
+
+fn substitute_arg(cx: ty::ctxt, actuals: ~[@expr], a: @constr_arg) ->
+   @constr_arg_use {
+    let num_actuals = vec::len(actuals);
+    match a.node {
+      carg_ident(i) {
+        if i < num_actuals {
+            return expr_to_constr_arg(cx, actuals[i]);
+        } else {
+            cx.sess.span_fatal(a.span, ~"constraint argument out of bounds");
+        }
+      }
+      carg_base { return @respan(a.span, carg_base); }
+      carg_lit(l) { return @respan(a.span, carg_lit(l)); }
+    }
+}
+
+fn pred_args_matches(pattern: ~[constr_arg_general_<inst>],
+                     desc: pred_args) ->
+   bool {
+    let mut i = 0u;
+    for desc.node.args.each |c| {
+        let n = pattern[i];
+        match c.node {
+          carg_ident(p) {
+            match n {
+              carg_ident(q) { if p.node != q.node { return false; } }
+              _ { return false; }
+            }
+          }
+          carg_base { if n != carg_base { return false; } }
+          carg_lit(l) {
+            match n {
+              carg_lit(m) { if !const_eval::lit_eq(l, m) { return false; } }
+              _ { return false; }
+            }
+          }
+        }
+        i += 1u;
+    }
+    return true;
+}
+
+fn find_instance_(pattern: ~[constr_arg_general_<inst>],
+                  descs: ~[pred_args]) ->
+   option<uint> {
+    for descs.each |d| {
+        if pred_args_matches(pattern, d) { return some(d.node.bit_num); }
+    }
+    return none;
+}
+
+type inst = {ident: ident, node: node_id};
+
+enum dest {
+    local_dest(inst), // RHS is assigned to a local variable
+    call                        // RHS is passed to a function
+}
+
+type subst = ~[{from: inst, to: inst}];
+
+fn find_instances(_fcx: fn_ctxt, subst: subst,
+                  c: constraint) -> ~[{from: uint, to: uint}] {
+
+    if vec::len(subst) == 0u { return ~[]; }
+    let mut res = ~[];
+    do (*c.descs).swap |v| {
+        let v <- vec::from_mut(v);
+        for v.each |d| {
+            if args_mention(d.node.args, find_in_subst_bool, subst) {
+                let old_bit_num = d.node.bit_num;
+                let newv = replace(subst, d);
+                match find_instance_(newv, v) {
+                  some(d1) {vec::push(res, {from: old_bit_num, to: d1})}
+                  _ {}
+                }
+            } else {}
+        }
+        vec::to_mut(v)
+    }
+    return res;
+}
+
+fn find_in_subst(id: node_id, s: subst) -> option<inst> {
+    for s.each |p| {
+        if id == p.from.node { return some(p.to); }
+    }
+    return none;
+}
+
+fn find_in_subst_bool(s: subst, id: node_id) -> bool {
+    is_some(find_in_subst(id, s))
+}
+
+fn insts_to_str(stuff: ~[constr_arg_general_<inst>]) -> ~str {
+    let mut rslt = ~"<";
+    for stuff.each |i| {
+        rslt +=
+            ~" " +
+                match i {
+                  carg_ident(p) { *p.ident }
+                  carg_base { ~"*" }
+                  carg_lit(_) { ~"~[lit]" }
+                } + ~" ";
+    }
+    rslt += ~">";
+    rslt
+}
+
+fn replace(subst: subst, d: pred_args) -> ~[constr_arg_general_<inst>] {
+    let mut rslt: ~[constr_arg_general_<inst>] = ~[];
+    for d.node.args.each |c| {
+        match c.node {
+          carg_ident(p) {
+            match find_in_subst(p.node, subst) {
+              some(newv) { vec::push(rslt, carg_ident(newv)); }
+              _ { vec::push(rslt, c.node); }
+            }
+          }
+          _ {
+            vec::push(rslt, c.node);
+          }
+        }
+    }
+
+    return rslt;
+}
+
+enum if_ty { if_check, plain_if, }
+
+fn for_constraints_mentioning(fcx: fn_ctxt, id: node_id,
+                              f: fn(norm_constraint)) {
+    for constraints(fcx).each |c| {
+        if constraint_mentions(fcx, c, id) { f(c); }
+    };
+}
+
+fn local_node_id_to_def_id_strict(fcx: fn_ctxt, sp: span, i: node_id) ->
+   def_id {
+    match local_node_id_to_def(fcx, i) {
+      some(def_local(nid, _)) | some(def_arg(nid, _)) |
+      some(def_upvar(nid, _, _)) {
+        return local_def(nid);
+      }
+      some(_) {
+        fcx.ccx.tcx.sess.span_fatal(sp,
+                                    ~"local_node_id_to_def_id: id \
+               isn't a local");
+      }
+      none {
+        // should really be bug. span_bug()?
+        fcx.ccx.tcx.sess.span_fatal(sp,
+                                    ~"local_node_id_to_def_id: id \
+               is unbound");
+      }
+    }
+}
+
+fn local_node_id_to_def(fcx: fn_ctxt, i: node_id) -> option<def> {
+    fcx.ccx.tcx.def_map.find(i)
+}
+
+fn local_node_id_to_def_id(fcx: fn_ctxt, i: node_id) -> option<def_id> {
+    match local_node_id_to_def(fcx, i) {
+      some(def_local(nid, _)) | some(def_arg(nid, _)) |
+      some(def_binding(nid, _)) | some(def_upvar(nid, _, _)) {
+        some(local_def(nid))
+      }
+      _ { none }
+    }
+}
+
+fn local_node_id_to_local_def_id(fcx: fn_ctxt, i: node_id) ->
+   option<node_id> {
+    match local_node_id_to_def_id(fcx, i) {
+      some(did) { some(did.node) }
+      _ { none }
+    }
+}
+
+fn copy_in_postcond(fcx: fn_ctxt, parent_exp: node_id, dest: inst, src: inst,
+                    ty: oper_type) {
+    let post =
+        node_id_to_ts_ann(fcx.ccx, parent_exp).conditions.postcondition;
+    copy_in_poststate_two(fcx, post, post, dest, src, ty);
+}
+
+fn copy_in_poststate(fcx: fn_ctxt, post: poststate, dest: inst, src: inst,
+                     ty: oper_type) {
+    copy_in_poststate_two(fcx, post, post, dest, src, ty);
+}
+
+// In target_post, set the bits corresponding to copies of any
+// constraints mentioning src that are set in src_post, with
+// dest substituted for src.
+// (This doesn't create any new constraints. If a new, substituted
+// constraint isn't already in the bit vector, it's ignored.)
+fn copy_in_poststate_two(fcx: fn_ctxt, src_post: poststate,
+                         target_post: poststate, dest: inst, src: inst,
+                         ty: oper_type) {
+    let mut subst;
+    match ty {
+      oper_swap { subst = ~[{from: dest, to: src}, {from: src, to: dest}]; }
+      oper_assign_op {
+        return; // Don't do any propagation
+      }
+      _ { subst = ~[{from: src, to: dest}]; }
+    }
+
+
+    for fcx.enclosing.constrs.each_value |val| {
+        // replace any occurrences of the src def_id with the
+        // dest def_id
+        let insts = find_instances(fcx, subst, val);
+        for insts.each |p| {
+            if bitvectors::promises_(p.from, src_post) {
+                set_in_poststate_(p.to, target_post);
+            }
+        }
+    };
+}
+
+fn forget_in_postcond(fcx: fn_ctxt, parent_exp: node_id, dead_v: node_id) {
+    // In the postcondition given by parent_exp, clear the bits
+    // for any constraints mentioning dead_v
+    let d = local_node_id_to_local_def_id(fcx, dead_v);
+    do option::iter(d) |d_id| {
+        do for_constraints_mentioning(fcx, d_id) |c| {
+                debug!("clearing constraint %u %s",
+                       c.bit_num,
+                       constraint_to_str(fcx.ccx.tcx, c.c));
+                clear_in_postcond(c.bit_num,
+                                  node_id_to_ts_ann(fcx.ccx,
+                                                    parent_exp).conditions);
+        }
+    };
+}
+
+fn forget_in_poststate(fcx: fn_ctxt, p: poststate, dead_v: node_id) -> bool {
+    // In the poststate given by parent_exp, clear the bits
+    // for any constraints mentioning dead_v
+    let d = local_node_id_to_local_def_id(fcx, dead_v);
+    let mut changed = false;
+    do option::iter(d) |d_id| {
+        do for_constraints_mentioning(fcx, d_id) |c| {
+                changed |= clear_in_poststate_(c.bit_num, p);
+        }
+    }
+    return changed;
+}
+
+fn any_eq(v: ~[node_id], d: node_id) -> bool {
+    for v.each |i| { if i == d { return true; } }
+    false
+}
+
+fn constraint_mentions(_fcx: fn_ctxt, c: norm_constraint, v: node_id) ->
+   bool {
+    return args_mention(c.c.node.args, any_eq, ~[v]);
+}
+
+fn args_mention<T>(args: ~[@constr_arg_use],
+                   q: fn(~[T], node_id) -> bool,
+                   s: ~[T]) -> bool {
+
+    for args.each |a| {
+        match a.node {
+          carg_ident(p1) { if q(s, p1.node) { return true; } } _ { }
+        }
+    }
+    return false;
+}
+
+fn use_var(fcx: fn_ctxt, v: node_id) {
+    vec::push(*fcx.enclosing.used_vars, v);
+}
+
+fn op_to_oper_ty(io: init_op) -> oper_type {
+    match io { init_move { oper_move } _ { oper_assign } }
+}
+
+// default function visitor
+fn do_nothing<T>(_fk: visit::fn_kind, _decl: fn_decl, _body: blk,
+                 _sp: span, _id: node_id,
+                 _t: T, _v: visit::vt<T>) {
+}
+
+
+fn args_to_constr_args(tcx: ty::ctxt, args: ~[arg],
+                       indices: ~[@sp_constr_arg<uint>])
+    -> ~[@constr_arg_use] {
+    let mut actuals: ~[@constr_arg_use] = ~[];
+    let num_args = vec::len(args);
+    for indices.each |a| {
+        vec::push(
+            actuals,
+            @respan(a.span,
+                    match a.node {
+                        carg_base { carg_base }
+                        carg_ident(i) {
+                            if i < num_args {
+                                carg_ident({ident: args[i].ident,
+                                            node: args[i].id})
+                            } else {
+                                tcx.sess.span_bug(a.span,
+                                                  ~"index out of bounds in \
+                                                   constraint arg");
+                            }
+                        }
+                        carg_lit(l) { carg_lit(l) }
+                    }));
+    }
+    return actuals;
+}
+
+fn ast_constr_to_ts_constr(tcx: ty::ctxt, args: ~[arg], c: @constr) ->
+   tsconstr {
+    let tconstr = ty::ast_constr_to_constr(tcx, c);
+    return {path: tconstr.node.path,
+         def_id: tconstr.node.id,
+         args: args_to_constr_args(tcx, args, tconstr.node.args)};
+}
+
+fn ast_constr_to_sp_constr(tcx: ty::ctxt, args: ~[arg], c: @constr) ->
+   sp_constr {
+    let tconstr = ast_constr_to_ts_constr(tcx, args, c);
+    return respan(c.span, tconstr);
+}
+
+type binding = {lhs: ~[dest], rhs: option<initializer>};
+
+fn local_to_bindings(tcx: ty::ctxt, loc: @local) -> binding {
+    let mut lhs = ~[];
+    do pat_bindings(tcx.def_map, loc.node.pat) |_bm, p_id, _s, name| {
+      vec::push(lhs, local_dest({ident: path_to_ident(name), node: p_id}));
+    };
+    {lhs: lhs, rhs: loc.node.init}
+}
+
+fn locals_to_bindings(tcx: ty::ctxt, locals: ~[@local]) -> ~[binding] {
+    let mut rslt = ~[];
+    for locals.each |loc| { vec::push(rslt, local_to_bindings(tcx, loc)); }
+    return rslt;
+}
+
+fn callee_modes(fcx: fn_ctxt, callee: node_id) -> ~[mode] {
+    let ty = ty::type_autoderef(fcx.ccx.tcx,
+                                ty::node_id_to_type(fcx.ccx.tcx, callee));
+    match ty::get(ty).struct {
+      ty::ty_fn({inputs: args, _}) {
+        let mut modes = ~[];
+        for args.each |arg| { vec::push(modes, arg.mode); }
+        return modes;
+      }
+      _ {
+        // Shouldn't happen; callee should be ty_fn.
+        fcx.ccx.tcx.sess.bug(~"non-fn callee type in callee_modes: " +
+                                 util::ppaux::ty_to_str(fcx.ccx.tcx, ty));
+      }
+    }
+}
+
+fn callee_arg_init_ops(fcx: fn_ctxt, callee: node_id) -> ~[init_op] {
+    do vec::map(callee_modes(fcx, callee)) |m| {
+        match ty::resolved_mode(fcx.ccx.tcx, m) {
+          by_move { init_move }
+          by_copy | by_ref | by_val | by_mutbl_ref { init_assign }
+        }
+    }
+}
+
+fn arg_bindings(ops: ~[init_op], es: ~[@expr]) -> ~[binding] {
+    let mut bindings: ~[binding] = ~[];
+    let mut i = 0u;
+    for ops.each |op| {
+        vec::push(bindings,
+                  {lhs: ~[call], rhs: some({op: op, expr: es[i]})});
+        i += 1u;
+    }
+    return bindings;
+}
+
+//
+// Local Variables:
+// mode: rust
+// fill-column: 78;
+// indent-tabs-mode: nil
+// c-basic-offset: 4
+// buffer-file-coding-system: utf-8-unix
+// End:
+//
diff --git a/src/rustc/middle/tstate/ck.rs b/src/rustc/middle/tstate/ck.rs
new file mode 100644 (file)
index 0000000..c37f067
--- /dev/null
@@ -0,0 +1,153 @@
+
+import syntax::ast;
+import ast::{stmt, fn_ident, node_id, crate, return_val, noreturn, expr};
+import syntax::{visit, print};
+import syntax::codemap::span;
+import middle::ty;
+import tstate::ann::{precond, prestate,
+                     implies, ann_precond, ann_prestate};
+import aux::*;
+
+import util::ppaux::ty_to_str;
+import bitvectors::*;
+import annotate::annotate_crate;
+import collect_locals::mk_f_to_fn_info;
+import pre_post_conditions::fn_pre_post;
+import states::find_pre_post_state_fn;
+import syntax::print::pprust::expr_to_str;
+import driver::session::session;
+import std::map::hashmap;
+
+fn check_states_expr(e: @expr, fcx: fn_ctxt, v: visit::vt<fn_ctxt>) {
+    visit::visit_expr(e, fcx, v);
+
+    let prec: precond = expr_precond(fcx.ccx, e);
+    let pres: prestate = expr_prestate(fcx.ccx, e);
+
+    if !implies(pres, prec) {
+        let mut s = ~"";
+        let diff = first_difference_string(fcx, prec, pres);
+        s +=
+            ~"unsatisfied precondition constraint (for example, " + diff +
+                ~") for expression:\n";
+        s += syntax::print::pprust::expr_to_str(e);
+        s += ~"\nprecondition:\n";
+        s += tritv_to_str(fcx, prec);
+        s += ~"\nprestate:\n";
+        s += tritv_to_str(fcx, pres);
+        fcx.ccx.tcx.sess.span_fatal(e.span, s);
+    }
+}
+
+fn check_states_stmt(s: @stmt, fcx: fn_ctxt, v: visit::vt<fn_ctxt>) {
+    visit::visit_stmt(s, fcx, v);
+
+    let a = stmt_to_ann(fcx.ccx, *s);
+    let prec: precond = ann_precond(a);
+    let pres: prestate = ann_prestate(a);
+
+    debug!("check_states_stmt:");
+    log(debug, print::pprust::stmt_to_str(*s));
+    debug!("prec = ");
+    log_tritv(fcx, prec);
+    debug!("pres = ");
+    log_tritv(fcx, pres);
+
+    if !implies(pres, prec) {
+        let mut ss = ~"";
+        let diff = first_difference_string(fcx, prec, pres);
+        ss +=
+            ~"unsatisfied precondition constraint (for example, " + diff +
+                ~") for statement:\n";
+        ss += syntax::print::pprust::stmt_to_str(*s);
+        ss += ~"\nprecondition:\n";
+        ss += tritv_to_str(fcx, prec);
+        ss += ~"\nprestate: \n";
+        ss += tritv_to_str(fcx, pres);
+        fcx.ccx.tcx.sess.span_fatal(s.span, ss);
+    }
+}
+
+fn check_states_against_conditions(fcx: fn_ctxt,
+                                   fk: visit::fn_kind,
+                                   f_decl: ast::fn_decl,
+                                   f_body: ast::blk,
+                                   sp: span,
+                                   id: node_id) {
+    /* Postorder traversal instead of pre is important
+       because we want the smallest possible erroneous statement
+       or expression. */
+    let visitor = visit::mk_vt(
+        @{visit_stmt: check_states_stmt,
+          visit_expr: check_states_expr,
+          visit_fn: |a,b,c,d,e,f,g| {
+              do_nothing::<fn_ctxt>(a, b, c, d, e, f, g)
+          }
+          with *visit::default_visitor::<fn_ctxt>()});
+    visit::visit_fn(fk, f_decl, f_body, sp, id, fcx, visitor);
+}
+
+fn check_fn_states(fcx: fn_ctxt,
+                   fk: visit::fn_kind,
+                   f_decl: ast::fn_decl,
+                   f_body: ast::blk,
+                   sp: span,
+                   id: node_id) {
+    /* Compute the pre- and post-states for this function */
+
+    // Fixpoint iteration
+    while find_pre_post_state_fn(fcx, f_decl, f_body) { }
+
+    /* Now compare each expr's pre-state to its precondition
+       and post-state to its postcondition */
+
+    check_states_against_conditions(fcx, fk, f_decl, f_body, sp, id);
+}
+
+fn fn_states(fk: visit::fn_kind, f_decl: ast::fn_decl, f_body: ast::blk,
+             sp: span, id: node_id,
+             ccx: crate_ctxt, v: visit::vt<crate_ctxt>) {
+
+    visit::visit_fn(fk, f_decl, f_body, sp, id, ccx, v);
+
+    // We may not care about typestate for this function if it contains
+    // no constrained calls
+    if !ccx.fm.get(id).ignore {
+        /* Look up the var-to-bit-num map for this function */
+
+        let f_info = ccx.fm.get(id);
+        let name = visit::name_of_fn(fk);
+        let fcx = {enclosing: f_info, id: id, name: name, ccx: ccx};
+        check_fn_states(fcx, fk, f_decl, f_body, sp, id)
+    }
+}
+
+fn check_crate(cx: ty::ctxt, crate: @crate) {
+    let ccx: crate_ctxt = new_crate_ctxt(cx);
+    /* Build the global map from function id to var-to-bit-num-map */
+
+    mk_f_to_fn_info(ccx, crate);
+    /* Add a blank ts_ann for every statement (and expression) */
+
+    annotate_crate(ccx, *crate);
+    /* Compute the pre and postcondition for every subexpression */
+
+    let vtor = visit::default_visitor::<crate_ctxt>();
+    let vtor = @{visit_fn: fn_pre_post with *vtor};
+    visit::visit_crate(*crate, ccx, visit::mk_vt(vtor));
+
+    /* Check the pre- and postcondition against the pre- and poststate
+       for every expression */
+    let vtor = visit::default_visitor::<crate_ctxt>();
+    let vtor = @{visit_fn: fn_states with *vtor};
+    visit::visit_crate(*crate, ccx, visit::mk_vt(vtor));
+}
+//
+// Local Variables:
+// mode: rust
+// fill-column: 78;
+// indent-tabs-mode: nil
+// c-basic-offset: 4
+// buffer-file-coding-system: utf-8-unix
+// End:
+//
diff --git a/src/rustc/middle/tstate/collect_locals.rs b/src/rustc/middle/tstate/collect_locals.rs
new file mode 100644 (file)
index 0000000..d627aab
--- /dev/null
@@ -0,0 +1,165 @@
+import option::*;
+import pat_util::*;
+import syntax::ast::*;
+import syntax::ast_util::*;
+import syntax::visit;
+import syntax::codemap::span;
+import syntax::ast_util::respan;
+import driver::session::session;
+import aux::*;
+import std::map::hashmap;
+import dvec::{dvec, extensions};
+
+type ctxt = {cs: @mut ~[sp_constr], tcx: ty::ctxt};
+
+fn collect_pred(e: @expr, cx: ctxt, v: visit::vt<ctxt>) {
+    match e.node {
+      expr_check(_, ch) { vec::push(*cx.cs, expr_to_constr(cx.tcx, ch)); }
+      expr_if_check(ex, _, _) {
+        vec::push(*cx.cs, expr_to_constr(cx.tcx, ex));
+      }
+
+      // If it's a call, generate appropriate instances of the
+      // call's constraints.
+      expr_call(operator, operands, _) {
+        for constraints_expr(cx.tcx, operator).each |c| {
+            let ct: sp_constr =
+                respan(c.span,
+                       aux::substitute_constr_args(cx.tcx, operands, c));
+            vec::push(*cx.cs, ct);
+        }
+      }
+      _ { }
+    }
+    // visit subexpressions
+    visit::visit_expr(e, cx, v);
+}
+
+fn find_locals(tcx: ty::ctxt,
+               fk: visit::fn_kind,
+               f_decl: fn_decl,
+               f_body: blk,
+               sp: span,
+               id: node_id) -> ctxt {
+    let cx: ctxt = {cs: @mut ~[], tcx: tcx};
+    let visitor = visit::default_visitor::<ctxt>();
+    let visitor =
+        @{visit_expr: collect_pred,
+          visit_fn: do_nothing
+          with *visitor};
+    visit::visit_fn(fk, f_decl, f_body, sp,
+                    id, cx, visit::mk_vt(visitor));
+    return cx;
+}
+
+fn add_constraint(tcx: ty::ctxt, c: sp_constr, next: uint, tbl: constr_map) ->
+   uint {
+    log(debug,
+             constraint_to_str(tcx, c) + ~" |-> " + uint::str(next));
+
+    let {path: p, def_id: d_id, args: args} = c.node;
+    match tbl.find(d_id) {
+      some(ct) {
+        (*ct.descs).push(respan(c.span, {args: args, bit_num: next}));
+      }
+      none {
+        let rslt = @dvec();
+        (*rslt).push(respan(c.span, {args: args, bit_num: next}));
+        tbl.insert(d_id, {path:p, descs:rslt});
+      }
+    }
+    return next + 1u;
+}
+
+fn contains_constrained_calls(tcx: ty::ctxt, body: blk) -> bool {
+    type cx = @{
+        tcx: ty::ctxt,
+        mut has: bool
+    };
+    let cx = @{
+        tcx: tcx,
+        mut has: false
+    };
+    let vtor = visit::default_visitor::<cx>();
+    let vtor = @{visit_expr: visit_expr with *vtor};
+    visit::visit_block(body, cx, visit::mk_vt(vtor));
+    return cx.has;
+
+    fn visit_expr(e: @expr, &&cx: cx, v: visit::vt<cx>) {
+        import syntax::print::pprust;
+        debug!("visiting %?", pprust::expr_to_str(e));
+
+        visit::visit_expr(e, cx, v);
+
+        if constraints_expr(cx.tcx, e).is_not_empty() {
+            debug!("has constraints");
+            cx.has = true;
+        } else {
+            debug!("has not constraints");
+        }
+    }
+}
+
+/* builds a table mapping each local var defined in f
+   to a bit number in the precondition/postcondition vectors */
+fn mk_fn_info(ccx: crate_ctxt,
+              fk: visit::fn_kind,
+              f_decl: fn_decl,
+              f_body: blk,
+              f_sp: span,
+              id: node_id) {
+    let name = visit::name_of_fn(fk);
+    let res_map = new_def_hash::<constraint>();
+    let mut next: uint = 0u;
+
+    let cx: ctxt = find_locals(ccx.tcx, fk, f_decl, f_body, f_sp, id);
+    /* now we have to add bit nums for both the constraints
+       and the variables... */
+
+    let ignore = !contains_constrained_calls(ccx.tcx, f_body);
+
+    if !ignore {
+        let mut i = 0u, l = vec::len(*cx.cs);
+        while i < l {
+            next = add_constraint(cx.tcx, copy cx.cs[i], next, res_map);
+            i += 1u;
+        }
+        /* if this function has any constraints, instantiate them to the
+        argument names and add them */
+        for f_decl.constraints.each |c| {
+            let sc = ast_constr_to_sp_constr(cx.tcx, f_decl.inputs, c);
+            next = add_constraint(cx.tcx, sc, next, res_map);
+        }
+    }
+
+    let v: @mut ~[node_id] = @mut ~[];
+    let rslt =
+        {constrs: res_map,
+         num_constraints: next,
+         cf: f_decl.cf,
+         used_vars: v,
+         ignore: ignore};
+    ccx.fm.insert(id, rslt);
+    debug!("%s has %u constraints", *name, num_constraints(rslt));
+}
+
+
+/* initializes the global fn_info_map (mapping each function ID, including
+   nested locally defined functions, onto a mapping from local variable name
+   to bit number) */
+fn mk_f_to_fn_info(ccx: crate_ctxt, c: @crate) {
+    let visitor =
+        visit::mk_simple_visitor(@{
+            visit_fn: |a,b,c,d,e| mk_fn_info(ccx, a, b, c, d, e)
+            with *visit::default_simple_visitor()});
+    visit::visit_crate(*c, (), visitor);
+}
+//
+// Local Variables:
+// mode: rust
+// fill-column: 78;
+// indent-tabs-mode: nil
+// c-basic-offset: 4
+// buffer-file-coding-system: utf-8-unix
+// End:
+//
diff --git a/src/rustc/middle/tstate/pre_post_conditions.rs b/src/rustc/middle/tstate/pre_post_conditions.rs
new file mode 100644 (file)
index 0000000..37900fc
--- /dev/null
@@ -0,0 +1,617 @@
+import tstate::ann::*;
+import aux::*;
+import bitvectors::{bit_num, seq_preconds, seq_postconds,
+                    intersect_states,
+                    relax_precond_block, gen};
+import tritv::*;
+
+import pat_util::*;
+import syntax::ast::*;
+import syntax::ast_util::*;
+import syntax::print::pprust::{expr_to_str, stmt_to_str};
+import syntax::visit;
+import util::common::{field_exprs, has_nonlocal_exits};
+import syntax::codemap::span;
+import driver::session::session;
+import std::map::hashmap;
+
+fn find_pre_post_mod(_m: _mod) -> _mod {
+    debug!("implement find_pre_post_mod!");
+    fail;
+}
+
+fn find_pre_post_foreign_mod(_m: foreign_mod) -> foreign_mod {
+    debug!("implement find_pre_post_foreign_mod");
+    fail;
+}
+
+fn find_pre_post_method(ccx: crate_ctxt, m: @method) {
+    assert (ccx.fm.contains_key(m.id));
+    let fcx: fn_ctxt =
+        {enclosing: ccx.fm.get(m.id),
+         id: m.id,
+         name: m.ident,
+         ccx: ccx};
+    find_pre_post_fn(fcx, m.body);
+}
+
+fn find_pre_post_item(ccx: crate_ctxt, i: item) {
+    match i.node {
+      item_const(_, e) {
+          // do nothing -- item_consts don't refer to local vars
+      }
+      item_fn(_, _, body) {
+        assert (ccx.fm.contains_key(i.id));
+        let fcx =
+            {enclosing: ccx.fm.get(i.id), id: i.id, name: i.ident, ccx: ccx};
+        find_pre_post_fn(fcx, body);
+      }
+      item_mod(m) { find_pre_post_mod(m); }
+      item_foreign_mod(nm) { find_pre_post_foreign_mod(nm); }
+      item_ty(*) | item_enum(*) | item_trait(*) { return; }
+      item_class(*) {
+          fail ~"find_pre_post_item: shouldn't be called on item_class";
+      }
+      item_impl(_, _, _, ms) {
+        for ms.each |m| { find_pre_post_method(ccx, m); }
+      }
+      item_mac(*) { fail ~"item macros unimplemented" }
+    }
+}
+
+
+/* Finds the pre and postcondition for each expr in <args>;
+   sets the precondition in a to be the result of combining
+   the preconditions for <args>, and the postcondition in a to
+   be the union of all postconditions for <args> */
+fn find_pre_post_exprs(fcx: fn_ctxt, args: ~[@expr], id: node_id) {
+    if vec::len::<@expr>(args) > 0u {
+        debug!("find_pre_post_exprs: oper = %s", expr_to_str(args[0]));
+    }
+    fn do_one(fcx: fn_ctxt, e: @expr) { find_pre_post_expr(fcx, e); }
+    for args.each |e| { do_one(fcx, e); }
+
+    fn get_pp(ccx: crate_ctxt, &&e: @expr) -> pre_and_post {
+        return expr_pp(ccx, e);
+    }
+    let pps = vec::map(args, |a| get_pp(fcx.ccx, a) );
+
+    set_pre_and_post(fcx.ccx, id, seq_preconds(fcx, pps),
+                     seq_postconds(fcx, vec::map(pps, get_post)));
+}
+
+fn find_pre_post_loop(fcx: fn_ctxt, index: @expr, body: blk, id: node_id) {
+    find_pre_post_expr(fcx, index);
+    find_pre_post_block(fcx, body);
+
+    let loop_precond =
+        seq_preconds(fcx, ~[expr_pp(fcx.ccx, index),
+                           block_pp(fcx.ccx, body)]);
+    let loop_postcond =
+        intersect_states(expr_postcond(fcx.ccx, index),
+                         block_postcond(fcx.ccx, body));
+    copy_pre_post_(fcx.ccx, id, loop_precond, loop_postcond);
+}
+
+// Generates a pre/post assuming that a is the
+// annotation for an if-expression with consequent conseq
+// and alternative maybe_alt
+fn join_then_else(fcx: fn_ctxt, antec: @expr, conseq: blk,
+                  maybe_alt: option<@expr>, id: node_id, chck: if_ty) {
+    find_pre_post_expr(fcx, antec);
+    find_pre_post_block(fcx, conseq);
+    match maybe_alt {
+      none {
+        match chck {
+          if_check {
+            let c: sp_constr = expr_to_constr(fcx.ccx.tcx, antec);
+            gen(fcx, antec.id, c.node);
+          }
+          _ { }
+        }
+
+        let precond_res =
+            seq_preconds(fcx,
+                         ~[expr_pp(fcx.ccx, antec),
+                          block_pp(fcx.ccx, conseq)]);
+        set_pre_and_post(fcx.ccx, id, precond_res,
+                         expr_poststate(fcx.ccx, antec));
+      }
+      some(altern) {
+        /*
+          if check = if_check, then
+          be sure that the predicate implied by antec
+          is *not* true in the alternative
+         */
+        find_pre_post_expr(fcx, altern);
+        let precond_false_case =
+            seq_preconds(fcx,
+                         ~[expr_pp(fcx.ccx, antec),
+                          expr_pp(fcx.ccx, altern)]);
+        let postcond_false_case =
+            seq_postconds(fcx,
+                          ~[expr_postcond(fcx.ccx, antec),
+                           expr_postcond(fcx.ccx, altern)]);
+
+        /* Be sure to set the bit for the check condition here,
+         so that it's *not* set in the alternative. */
+        match chck {
+          if_check {
+            let c: sp_constr = expr_to_constr(fcx.ccx.tcx, antec);
+            gen(fcx, antec.id, c.node);
+          }
+          _ { }
+        }
+        let precond_true_case =
+            seq_preconds(fcx,
+                         ~[expr_pp(fcx.ccx, antec),
+                          block_pp(fcx.ccx, conseq)]);
+        let postcond_true_case =
+            seq_postconds(fcx,
+                          ~[expr_postcond(fcx.ccx, antec),
+                           block_postcond(fcx.ccx, conseq)]);
+
+        let precond_res =
+            seq_postconds(fcx, ~[precond_true_case, precond_false_case]);
+        let postcond_res =
+            intersect_states(postcond_true_case, postcond_false_case);
+        set_pre_and_post(fcx.ccx, id, precond_res, postcond_res);
+      }
+    }
+}
+
+fn gen_if_local(fcx: fn_ctxt, lhs: @expr, rhs: @expr, larger_id: node_id,
+                new_var: node_id) {
+    match node_id_to_def(fcx.ccx, new_var) {
+      some(d) {
+        match d {
+          def_local(nid, _) {
+            find_pre_post_expr(fcx, rhs);
+            let p = expr_pp(fcx.ccx, rhs);
+            set_pre_and_post(fcx.ccx, larger_id, p.precondition,
+                             p.postcondition);
+          }
+          _ { find_pre_post_exprs(fcx, ~[lhs, rhs], larger_id); }
+        }
+      }
+      _ { find_pre_post_exprs(fcx, ~[lhs, rhs], larger_id); }
+    }
+}
+
+fn handle_update(fcx: fn_ctxt, parent: @expr, lhs: @expr, rhs: @expr,
+                 ty: oper_type) {
+    find_pre_post_expr(fcx, rhs);
+    match lhs.node {
+      expr_path(p) {
+        let post = expr_postcond(fcx.ccx, parent);
+        let tmp = post.clone();
+
+        match ty {
+          oper_move {
+            if is_path(rhs) { forget_in_postcond(fcx, parent.id, rhs.id); }
+          }
+          oper_swap {
+            forget_in_postcond(fcx, parent.id, lhs.id);
+            forget_in_postcond(fcx, parent.id, rhs.id);
+          }
+          oper_assign {
+            forget_in_postcond(fcx, parent.id, lhs.id);
+          }
+          _ { }
+        }
+
+        gen_if_local(fcx, lhs, rhs, parent.id, lhs.id);
+        match rhs.node {
+          expr_path(p1) {
+            let d = local_node_id_to_local_def_id(fcx, lhs.id);
+            let d1 = local_node_id_to_local_def_id(fcx, rhs.id);
+            match d {
+              some(id) {
+                match d1 {
+                  some(id1) {
+                    let instlhs =
+                        {ident: path_to_ident(p), node: id};
+                    let instrhs =
+                        {ident: path_to_ident(p1), node: id1};
+                    copy_in_poststate_two(fcx, tmp, post, instlhs, instrhs,
+                                          ty);
+                  }
+                  _ { }
+                }
+              }
+              _ { }
+            }
+          }
+          _ {/* do nothing */ }
+        }
+      }
+      _ { find_pre_post_expr(fcx, lhs); }
+    }
+}
+
+fn forget_args_moved_in(fcx: fn_ctxt, parent: @expr, modes: ~[mode],
+                        operands: ~[@expr]) {
+    do vec::iteri(modes) |i,mode| {
+        match ty::resolved_mode(fcx.ccx.tcx, mode) {
+          by_move { forget_in_postcond(fcx, parent.id, operands[i].id); }
+          by_ref | by_val | by_mutbl_ref | by_copy { }
+        }
+    }
+}
+
+fn find_pre_post_expr_fn_upvars(fcx: fn_ctxt, e: @expr) {
+    let rslt = expr_pp(fcx.ccx, e);
+    clear_pp(rslt);
+}
+
+/* Fills in annotations as a side effect. Does not rebuild the expr */
+fn find_pre_post_expr(fcx: fn_ctxt, e: @expr) {
+    let enclosing = fcx.enclosing;
+    let num_local_vars = num_constraints(enclosing);
+    fn do_rand_(fcx: fn_ctxt, e: @expr) { find_pre_post_expr(fcx, e); }
+
+
+    match e.node {
+      expr_call(operator, operands, _) {
+        /* copy */
+
+        let mut args = operands;
+        vec::push(args, operator);
+
+        find_pre_post_exprs(fcx, args, e.id);
+        /* see if the call has any constraints on its type */
+        for constraints_expr(fcx.ccx.tcx, operator).each |c| {
+            let i =
+                bit_num(fcx, substitute_constr_args(fcx.ccx.tcx, args, c));
+            require(i, expr_pp(fcx.ccx, e));
+        }
+
+        forget_args_moved_in(fcx, e, callee_modes(fcx, operator.id),
+                             operands);
+
+        /* if this is a failing call, its postcondition sets everything */
+        match controlflow_expr(fcx.ccx, operator) {
+          noreturn { set_postcond_false(fcx.ccx, e.id); }
+          _ { }
+        }
+      }
+      expr_vstore(ee, _) {
+        find_pre_post_expr(fcx, ee);
+        let p = expr_pp(fcx.ccx, ee);
+        set_pre_and_post(fcx.ccx, e.id, p.precondition, p.postcondition);
+      }
+      expr_vec(args, _) {
+        find_pre_post_exprs(fcx, args, e.id);
+      }
+      expr_path(p) {
+        let rslt = expr_pp(fcx.ccx, e);
+        clear_pp(rslt);
+      }
+      expr_new(p, _, v) {
+        find_pre_post_exprs(fcx, ~[p, v], e.id);
+      }
+      expr_log(_, lvl, arg) {
+        find_pre_post_exprs(fcx, ~[lvl, arg], e.id);
+      }
+      expr_fn(_, _, _, cap_clause) | expr_fn_block(_, _, cap_clause) {
+        find_pre_post_expr_fn_upvars(fcx, e);
+
+        for (*cap_clause).each |cap_item| {
+            let d = local_node_id_to_local_def_id(fcx, cap_item.id);
+            option::iter(d, |id| use_var(fcx, id) );
+        }
+
+        for (*cap_clause).each |cap_item| {
+            if cap_item.is_move {
+                log(debug, (~"forget_in_postcond: ", cap_item));
+                forget_in_postcond(fcx, e.id, cap_item.id);
+            }
+        }
+      }
+      expr_block(b) {
+        find_pre_post_block(fcx, b);
+        let p = block_pp(fcx.ccx, b);
+        set_pre_and_post(fcx.ccx, e.id, p.precondition, p.postcondition);
+      }
+      expr_rec(fields, maybe_base) {
+        let mut es = field_exprs(fields);
+        match maybe_base { none {/* no-op */ } some(b) { vec::push(es, b); } }
+        find_pre_post_exprs(fcx, es, e.id);
+      }
+      expr_tup(elts) { find_pre_post_exprs(fcx, elts, e.id); }
+      expr_move(lhs, rhs) { handle_update(fcx, e, lhs, rhs, oper_move); }
+      expr_swap(lhs, rhs) { handle_update(fcx, e, lhs, rhs, oper_swap); }
+      expr_assign(lhs, rhs) { handle_update(fcx, e, lhs, rhs, oper_assign); }
+      expr_assign_op(_, lhs, rhs) {
+        /* Different from expr_assign in that the lhs *must*
+           already be initialized */
+
+        find_pre_post_exprs(fcx, ~[lhs, rhs], e.id);
+        forget_in_postcond(fcx, e.id, lhs.id);
+      }
+      expr_lit(_) { clear_pp(expr_pp(fcx.ccx, e)); }
+      expr_ret(maybe_val) {
+        match maybe_val {
+          none {
+            clear_precond(fcx.ccx, e.id);
+            set_postcond_false(fcx.ccx, e.id);
+          }
+          some(ret_val) {
+            find_pre_post_expr(fcx, ret_val);
+            set_precondition(node_id_to_ts_ann(fcx.ccx, e.id),
+                             expr_precond(fcx.ccx, ret_val));
+            set_postcond_false(fcx.ccx, e.id);
+          }
+        }
+      }
+      expr_if(antec, conseq, maybe_alt) {
+        join_then_else(fcx, antec, conseq, maybe_alt, e.id, plain_if);
+      }
+      expr_binary(bop, l, r) {
+        if lazy_binop(bop) {
+            find_pre_post_expr(fcx, l);
+            find_pre_post_expr(fcx, r);
+            let overall_pre =
+                seq_preconds(fcx,
+                             ~[expr_pp(fcx.ccx, l), expr_pp(fcx.ccx, r)]);
+            set_precondition(node_id_to_ts_ann(fcx.ccx, e.id), overall_pre);
+            set_postcondition(node_id_to_ts_ann(fcx.ccx, e.id),
+                              expr_postcond(fcx.ccx, l));
+        } else { find_pre_post_exprs(fcx, ~[l, r], e.id); }
+      }
+      expr_addr_of(_, x) | expr_cast(x, _) | expr_unary(_, x) |
+      expr_loop_body(x) | expr_do_body(x) | expr_assert(x) | expr_copy(x) {
+        find_pre_post_expr(fcx, x);
+        copy_pre_post(fcx.ccx, e.id, x);
+      }
+      expr_while(test, body) {
+        find_pre_post_expr(fcx, test);
+        find_pre_post_block(fcx, body);
+        set_pre_and_post(fcx.ccx, e.id,
+                         seq_preconds(fcx,
+                                      ~[expr_pp(fcx.ccx, test),
+                                       block_pp(fcx.ccx, body)]),
+                         intersect_states(expr_postcond(fcx.ccx, test),
+                                          block_postcond(fcx.ccx, body)));
+      }
+      expr_loop(body) {
+        find_pre_post_block(fcx, body);
+        /* Infinite loop: if control passes it, everything is true. */
+        let mut loop_postcond = false_postcond(num_local_vars);
+        /* Conservative approximation: if the body has any nonlocal exits,
+         the poststate is blank since we don't know what parts of it
+          execute. */
+        if has_nonlocal_exits(body) {
+            loop_postcond = empty_poststate(num_local_vars);
+        }
+        set_pre_and_post(fcx.ccx, e.id, block_precond(fcx.ccx, body),
+                         loop_postcond);
+      }
+      expr_index(val, sub) { find_pre_post_exprs(fcx, ~[val, sub], e.id); }
+      expr_match(ex, alts, _) {
+        find_pre_post_expr(fcx, ex);
+        fn do_an_alt(fcx: fn_ctxt, an_alt: arm) -> pre_and_post {
+            match an_alt.guard {
+              some(e) { find_pre_post_expr(fcx, e); }
+              _ {}
+            }
+            find_pre_post_block(fcx, an_alt.body);
+            return block_pp(fcx.ccx, an_alt.body);
+        }
+        let mut alt_pps = ~[];
+        for alts.each |a| { vec::push(alt_pps, do_an_alt(fcx, a)); }
+        fn combine_pp(antec: pre_and_post, fcx: fn_ctxt, &&pp: pre_and_post,
+                      &&next: pre_and_post) -> pre_and_post {
+            union(pp.precondition, seq_preconds(fcx, ~[antec, next]));
+            intersect(pp.postcondition, next.postcondition);
+            return pp;
+        }
+        let antec_pp = pp_clone(expr_pp(fcx.ccx, ex));
+        let e_pp =
+            {precondition: empty_prestate(num_local_vars),
+             postcondition: false_postcond(num_local_vars)};
+        let g = |a,b| combine_pp(antec_pp, fcx, a, b);
+        let alts_overall_pp =
+            vec::foldl(e_pp, alt_pps, g);
+        set_pre_and_post(fcx.ccx, e.id, alts_overall_pp.precondition,
+                         alts_overall_pp.postcondition);
+      }
+      expr_field(operator, _, _) {
+        find_pre_post_expr(fcx, operator);
+        copy_pre_post(fcx.ccx, e.id, operator);
+      }
+      expr_fail(maybe_val) {
+        let mut prestate;
+        match maybe_val {
+          none { prestate = empty_prestate(num_local_vars); }
+          some(fail_val) {
+            find_pre_post_expr(fcx, fail_val);
+            prestate = expr_precond(fcx.ccx, fail_val);
+          }
+        }
+        set_pre_and_post(fcx.ccx, e.id,
+                         /* if execution continues after fail,
+                            then everything is true! */
+                         prestate, false_postcond(num_local_vars));
+      }
+      expr_check(_, p) {
+        find_pre_post_expr(fcx, p);
+        copy_pre_post(fcx.ccx, e.id, p);
+        /* predicate p holds after this expression executes */
+
+        let c: sp_constr = expr_to_constr(fcx.ccx.tcx, p);
+        gen(fcx, e.id, c.node);
+      }
+      expr_if_check(p, conseq, maybe_alt) {
+        join_then_else(fcx, p, conseq, maybe_alt, e.id, if_check);
+      }
+      expr_break { clear_pp(expr_pp(fcx.ccx, e)); }
+      expr_again { clear_pp(expr_pp(fcx.ccx, e)); }
+      expr_mac(_) { fcx.ccx.tcx.sess.bug(~"unexpanded macro"); }
+    }
+}
+
+fn find_pre_post_stmt(fcx: fn_ctxt, s: stmt) {
+    debug!("stmt = %s", stmt_to_str(s));
+    match s.node {
+      stmt_decl(adecl, id) {
+        match adecl.node {
+          decl_local(alocals) {
+            let prev_pp = empty_pre_post(num_constraints(fcx.enclosing));
+            for alocals.each |alocal| {
+                match alocal.node.init {
+                  some(an_init) {
+                    /* LHS always becomes initialized,
+                     whether or not this is a move */
+                    find_pre_post_expr(fcx, an_init.expr);
+                    do pat_bindings(fcx.ccx.tcx.def_map, alocal.node.pat)
+                        |p_id, _s, _n| {
+                        copy_pre_post(fcx.ccx, p_id, an_init.expr);
+                    };
+                    /* Inherit ann from initializer, and add var being
+                       initialized to the postcondition */
+                    copy_pre_post(fcx.ccx, id, an_init.expr);
+
+                    let mut p = none;
+                    match an_init.expr.node {
+                      expr_path(_p) { p = some(_p); }
+                      _ { }
+                    }
+
+                    do pat_bindings(fcx.ccx.tcx.def_map, alocal.node.pat)
+                        |p_id, _s, n| {
+                        let ident = path_to_ident(n);
+                        match p {
+                          some(p) {
+                            copy_in_postcond(fcx, id,
+                                             {ident: ident, node: p_id},
+                                             {ident:
+                                                  path_to_ident(p),
+                                              node: an_init.expr.id},
+                                             op_to_oper_ty(an_init.op));
+                          }
+                          none { }
+                        }
+                    };
+
+                    /* Clear out anything that the previous initializer
+                    guaranteed */
+                    let e_pp = expr_pp(fcx.ccx, an_init.expr);
+                    prev_pp.precondition.become(
+                               seq_preconds(fcx, ~[prev_pp, e_pp]));
+
+                    /* Include the LHSs too, since those aren't in the
+                     postconds of the RHSs themselves */
+                    copy_pre_post_(fcx.ccx, id, prev_pp.precondition,
+                                   prev_pp.postcondition);
+                  }
+                  none {
+                    do pat_bindings(fcx.ccx.tcx.def_map, alocal.node.pat)
+                        |p_id, _s, _n| {
+                        clear_pp(node_id_to_ts_ann(fcx.ccx, p_id).conditions);
+                    };
+                    clear_pp(node_id_to_ts_ann(fcx.ccx, id).conditions);
+                  }
+                }
+            }
+          }
+          decl_item(anitem) {
+            clear_pp(node_id_to_ts_ann(fcx.ccx, id).conditions);
+            find_pre_post_item(fcx.ccx, *anitem);
+          }
+        }
+      }
+      stmt_expr(e, id) | stmt_semi(e, id) {
+        find_pre_post_expr(fcx, e);
+        copy_pre_post(fcx.ccx, id, e);
+      }
+    }
+}
+
+fn find_pre_post_block(fcx: fn_ctxt, b: blk) {
+    /* Want to say that if there is a break or cont in this
+     block, then that invalidates the poststate upheld by
+    any of the stmts after it.
+    Given that the typechecker has run, we know any break will be in
+    a block that forms a loop body. So that's ok. There'll never be an
+    expr_break outside a loop body, therefore, no expr_break outside a block.
+    */
+
+    /* Conservative approximation for now: This says that if a block contains
+     *any* breaks or conts, then its postcondition doesn't promise anything.
+     This will mean that:
+     x = 0;
+     break;
+
+     won't have a postcondition that says x is initialized, but that's ok.
+     */
+
+    let nv = num_constraints(fcx.enclosing);
+    fn do_one_(fcx: fn_ctxt, s: @stmt) {
+        find_pre_post_stmt(fcx, *s);
+    }
+    for b.node.stmts.each |s| { do_one_(fcx, s); }
+    fn do_inner_(fcx: fn_ctxt, &&e: @expr) { find_pre_post_expr(fcx, e); }
+    let do_inner = |a| do_inner_(fcx, a);
+    option::map::<@expr, ()>(b.node.expr, do_inner);
+
+    let mut pps: ~[pre_and_post] = ~[];
+    for b.node.stmts.each |s| { vec::push(pps, stmt_pp(fcx.ccx, *s)); }
+    match b.node.expr {
+      none {/* no-op */ }
+      some(e) { vec::push(pps, expr_pp(fcx.ccx, e)); }
+    }
+
+    let block_precond = seq_preconds(fcx, pps);
+
+    let mut postconds = ~[];
+    for pps.each |pp| { vec::push(postconds, get_post(pp)); }
+
+    /* A block may be empty, so this next line ensures that the postconds
+       vector is non-empty. */
+    vec::push(postconds, block_precond);
+
+    let mut block_postcond = empty_poststate(nv);
+    /* conservative approximation */
+
+    if !has_nonlocal_exits(b) {
+        block_postcond = seq_postconds(fcx, postconds);
+    }
+    set_pre_and_post(fcx.ccx, b.node.id, block_precond, block_postcond);
+}
+
+fn find_pre_post_fn(fcx: fn_ctxt, body: blk) {
+    find_pre_post_block(fcx, body);
+
+    // Treat the tail expression as a return statement
+    match body.node.expr {
+      some(tailexpr) { set_postcond_false(fcx.ccx, tailexpr.id); }
+      none {/* fallthrough */ }
+    }
+}
+
+fn fn_pre_post(fk: visit::fn_kind, decl: fn_decl, body: blk, sp: span,
+               id: node_id,
+               ccx: crate_ctxt, v: visit::vt<crate_ctxt>) {
+
+    visit::visit_fn(fk, decl, body, sp, id, ccx, v);
+    assert (ccx.fm.contains_key(id));
+    if !ccx.fm.get(id).ignore {
+        let fcx =
+            {enclosing: ccx.fm.get(id),
+             id: id,
+             name: visit::name_of_fn(fk),
+             ccx: ccx};
+        find_pre_post_fn(fcx, body);
+    }
+}
+
+//
+// Local Variables:
+// mode: rust
+// fill-column: 78;
+// indent-tabs-mode: nil
+// c-basic-offset: 4
+// buffer-file-coding-system: utf-8-unix
+// End:
+//
diff --git a/src/rustc/middle/tstate/states.rs b/src/rustc/middle/tstate/states.rs
new file mode 100644 (file)
index 0000000..7802841
--- /dev/null
@@ -0,0 +1,623 @@
+import ann::*;
+import aux::*;
+import tritv::*;
+
+import syntax::print::pprust::block_to_str;
+import bitvectors::*;
+import pat_util::*;
+import syntax::ast::*;
+import syntax::ast_util::*;
+import syntax::print::pprust::{expr_to_str, stmt_to_str};
+import syntax::codemap::span;
+import middle::ty::{expr_ty, type_is_bot};
+import util::common::{field_exprs, has_nonlocal_exits, may_break};
+import driver::session::session;
+import std::map::hashmap;
+
+fn forbid_upvar(fcx: fn_ctxt, rhs_id: node_id, sp: span, t: oper_type) {
+    match t {
+      oper_move {
+        match local_node_id_to_def(fcx, rhs_id) {
+          some(def_upvar(_, _, _)) {
+            fcx.ccx.tcx.sess.span_err(sp,
+                                      ~"tried to deinitialize a variable \
+              declared in a different scope");
+          }
+          _ { }
+        }
+      }
+      _ {/* do nothing */ }
+    }
+}
+
+fn handle_move_or_copy(fcx: fn_ctxt, post: poststate, rhs_path: @path,
+                       rhs_id: node_id, destlhs: dest, init_op: init_op) {
+    forbid_upvar(fcx, rhs_id, rhs_path.span, op_to_oper_ty(init_op));
+
+    let rhs_d_id = local_node_id_to_def_id(fcx, rhs_id);
+    match rhs_d_id {
+      some(rhsid) {
+        // RHS is a local var
+        let instrhs =
+            {ident: path_to_ident(rhs_path), node: rhsid.node};
+        match destlhs {
+          local_dest(instlhs) {
+             copy_in_poststate(fcx, post, instlhs, instrhs,
+                               op_to_oper_ty(init_op));
+          }
+          _ {}
+        }
+      }
+      _ {
+        // not a local -- do nothing
+      }
+    }
+}
+
+fn seq_states(fcx: fn_ctxt, pres: prestate, bindings: ~[binding]) ->
+   {changed: bool, post: poststate} {
+    let mut changed = false;
+    let mut post = pres.clone();
+    for bindings.each |b| {
+        match b.rhs {
+          some(an_init) {
+            // an expression, with or without a destination
+            changed |=
+                find_pre_post_state_expr(fcx, post, an_init.expr) || changed;
+            post = expr_poststate(fcx.ccx, an_init.expr).clone();
+            for b.lhs.each |d| {
+                match an_init.expr.node {
+                  expr_path(p) {
+                    handle_move_or_copy(fcx, post, p, an_init.expr.id, d,
+                                        an_init.op);
+                  }
+                  _ { }
+                }
+            }
+
+            // Forget the RHS if we just moved it.
+            if an_init.op == init_move {
+                forget_in_poststate(fcx, post, an_init.expr.id);
+            }
+          }
+          none {
+          }
+        }
+    }
+    return {changed: changed, post: post};
+}
+
+fn find_pre_post_state_sub(fcx: fn_ctxt, pres: prestate, e: @expr,
+                           parent: node_id, c: option<tsconstr>) -> bool {
+    let mut changed = find_pre_post_state_expr(fcx, pres, e);
+
+    changed = set_prestate_ann(fcx.ccx, parent, pres) || changed;
+
+    let post = expr_poststate(fcx.ccx, e).clone();
+    match c {
+      none { }
+      some(c1) { set_in_poststate_(bit_num(fcx, c1), post); }
+    }
+
+    changed = set_poststate_ann(fcx.ccx, parent, post) || changed;
+    return changed;
+}
+
+fn find_pre_post_state_two(fcx: fn_ctxt, pres: prestate, lhs: @expr,
+                           rhs: @expr, parent: node_id, ty: oper_type) ->
+   bool {
+    let mut changed = set_prestate_ann(fcx.ccx, parent, pres);
+    changed = find_pre_post_state_expr(fcx, pres, lhs) || changed;
+    changed =
+        find_pre_post_state_expr(fcx, expr_poststate(fcx.ccx, lhs), rhs) ||
+            changed;
+    forbid_upvar(fcx, rhs.id, rhs.span, ty);
+
+    let post = expr_poststate(fcx.ccx, rhs).clone();
+
+    match lhs.node {
+      expr_path(p) {
+        // for termination, need to make sure intermediate changes don't set
+        // changed flag
+        // tmp remembers "old" constraints we'd otherwise forget,
+        // for substitution purposes
+        let tmp = post.clone();
+
+        match ty {
+          oper_move {
+            if is_path(rhs) { forget_in_poststate(fcx, post, rhs.id); }
+            forget_in_poststate(fcx, post, lhs.id);
+          }
+          oper_swap {
+            forget_in_poststate(fcx, post, lhs.id);
+            forget_in_poststate(fcx, post, rhs.id);
+          }
+          _ { forget_in_poststate(fcx, post, lhs.id); }
+        }
+
+        match rhs.node {
+          expr_path(p1) {
+            let d = local_node_id_to_local_def_id(fcx, lhs.id);
+            let d1 = local_node_id_to_local_def_id(fcx, rhs.id);
+            match d {
+              some(id) {
+                match d1 {
+                  some(id1) {
+                    let instlhs =
+                        {ident: path_to_ident(p), node: id};
+                    let instrhs =
+                        {ident: path_to_ident(p1), node: id1};
+                    copy_in_poststate_two(fcx, tmp, post, instlhs, instrhs,
+                                          ty);
+                  }
+                  _ { }
+                }
+              }
+              _ { }
+            }
+          }
+          _ {/* do nothing */ }
+        }
+      }
+      _ { }
+    }
+    changed = set_poststate_ann(fcx.ccx, parent, post) || changed;
+    return changed;
+}
+
+fn find_pre_post_state_call(fcx: fn_ctxt, pres: prestate, a: @expr,
+                            id: node_id, ops: ~[init_op], bs: ~[@expr],
+                            cf: ret_style) -> bool {
+    let mut changed = find_pre_post_state_expr(fcx, pres, a);
+    // FIXME (#2178): This could be a typestate constraint (except we're
+    // not using them inside the compiler, I guess... see discussion in
+    // bug)
+    if vec::len(bs) != vec::len(ops) {
+        fcx.ccx.tcx.sess.span_bug(a.span,
+                                  fmt!("mismatched arg lengths: \
+                                        %u exprs vs. %u ops",
+                                       vec::len(bs), vec::len(ops)));
+    }
+    return find_pre_post_state_exprs(fcx, pres, id, ops,
+                                   bs, cf) || changed;
+}
+
+fn find_pre_post_state_exprs(fcx: fn_ctxt, pres: prestate, id: node_id,
+                             ops: ~[init_op], es: ~[@expr],
+                             cf: ret_style) -> bool {
+    let rs = seq_states(fcx, pres, arg_bindings(ops, es));
+    let mut changed = rs.changed | set_prestate_ann(fcx.ccx, id, pres);
+    /* if this is a failing call, it sets everything as initialized */
+    match cf {
+      noreturn {
+        let post = false_postcond(num_constraints(fcx.enclosing));
+        changed |= set_poststate_ann(fcx.ccx, id, post);
+      }
+      _ { changed |= set_poststate_ann(fcx.ccx, id, rs.post); }
+    }
+    return changed;
+}
+
+fn join_then_else(fcx: fn_ctxt, antec: @expr, conseq: blk,
+                  maybe_alt: option<@expr>, id: node_id, chk: if_ty,
+                  pres: prestate) -> bool {
+    let mut changed =
+        set_prestate_ann(fcx.ccx, id, pres) |
+            find_pre_post_state_expr(fcx, pres, antec);
+
+    match maybe_alt {
+      none {
+        match chk {
+          if_check {
+            let c: sp_constr = expr_to_constr(fcx.ccx.tcx, antec);
+            let conseq_prestate = expr_poststate(fcx.ccx, antec).clone();
+            conseq_prestate.set(bit_num(fcx, c.node), ttrue);
+            changed |=
+                find_pre_post_state_block(fcx, conseq_prestate, conseq) |
+                    set_poststate_ann(fcx.ccx, id,
+                                      expr_poststate(fcx.ccx, antec));
+          }
+          _ {
+            changed |=
+                find_pre_post_state_block(fcx, expr_poststate(fcx.ccx, antec),
+                                          conseq) |
+                    set_poststate_ann(fcx.ccx, id,
+                                      expr_poststate(fcx.ccx, antec));
+          }
+        }
+      }
+      some(altern) {
+        changed |=
+            find_pre_post_state_expr(fcx, expr_poststate(fcx.ccx, antec),
+                                     altern);
+
+        let mut conseq_prestate = expr_poststate(fcx.ccx, antec);
+        match chk {
+          if_check {
+            let c: sp_constr = expr_to_constr(fcx.ccx.tcx, antec);
+            conseq_prestate = conseq_prestate.clone();
+            conseq_prestate.set(bit_num(fcx, c.node),  ttrue);
+          }
+          _ { }
+        }
+
+
+        changed |= find_pre_post_state_block(fcx, conseq_prestate, conseq);
+
+        let poststate_res =
+            intersect_states(block_poststate(fcx.ccx, conseq),
+                             expr_poststate(fcx.ccx, altern));
+        /*
+           fcx.ccx.tcx.sess.span_note(antec.span,
+           "poststate_res = " + aux::tritv_to_str(fcx, poststate_res));
+        fcx.ccx.tcx.sess.span_note(antec.span,
+           "altern poststate = " +
+            aux::tritv_to_str(fcx, expr_poststate(fcx.ccx, altern)));
+        fcx.ccx.tcx.sess.span_note(antec.span,
+        "conseq poststate = " + aux::tritv_to_str(fcx,
+           block_poststate(fcx.ccx, conseq)));
+        */
+
+        changed |= set_poststate_ann(fcx.ccx, id, poststate_res);
+      }
+    }
+    return changed;
+}
+
+fn find_pre_post_state_cap_clause(fcx: fn_ctxt, e_id: node_id,
+                                  pres: prestate, cap_clause: capture_clause)
+    -> bool
+{
+    let ccx = fcx.ccx;
+    let pres_changed = set_prestate_ann(ccx, e_id, pres);
+    let post = pres.clone();
+    for (*cap_clause).each |cap_item| {
+        if cap_item.is_move {
+            forget_in_poststate(fcx, post, cap_item.id);
+        }
+    }
+    return set_poststate_ann(ccx, e_id, post) || pres_changed;
+}
+
+fn find_pre_post_state_expr(fcx: fn_ctxt, pres: prestate, e: @expr) -> bool {
+    let num_constrs = num_constraints(fcx.enclosing);
+
+    match e.node {
+      expr_new(p, _, v) {
+        return find_pre_post_state_two(fcx, pres, p, v, e.id, oper_pure);
+      }
+      expr_vstore(ee, _) {
+        let mut changed = find_pre_post_state_expr(fcx, pres, ee);
+        set_prestate_ann(fcx.ccx, e.id, expr_prestate(fcx.ccx, ee));
+        set_poststate_ann(fcx.ccx, e.id, expr_poststate(fcx.ccx, ee));
+        return changed;
+      }
+      expr_vec(elts, _) {
+        return find_pre_post_state_exprs(fcx, pres, e.id,
+                                      vec::from_elem(vec::len(elts),
+                                                    init_assign), elts,
+                                      return_val);
+      }
+      expr_call(operator, operands, _) {
+        debug!("hey it's a call: %s", expr_to_str(e));
+        return find_pre_post_state_call(fcx, pres, operator, e.id,
+                                     callee_arg_init_ops(fcx, operator.id),
+                                     operands,
+                                     controlflow_expr(fcx.ccx, operator));
+      }
+      expr_path(_) { return pure_exp(fcx.ccx, e.id, pres); }
+      expr_log(_, lvl, ex) {
+        return find_pre_post_state_two(fcx, pres, lvl, ex, e.id, oper_pure);
+      }
+      expr_mac(_) { fcx.ccx.tcx.sess.bug(~"unexpanded macro"); }
+      expr_lit(l) { return pure_exp(fcx.ccx, e.id, pres); }
+      expr_fn(_, _, _, cap_clause) {
+        return find_pre_post_state_cap_clause(fcx, e.id, pres, cap_clause);
+      }
+      expr_fn_block(_, _, cap_clause) {
+        return find_pre_post_state_cap_clause(fcx, e.id, pres, cap_clause);
+      }
+      expr_block(b) {
+        return find_pre_post_state_block(fcx, pres, b) |
+                set_prestate_ann(fcx.ccx, e.id, pres) |
+                set_poststate_ann(fcx.ccx, e.id, block_poststate(fcx.ccx, b));
+      }
+      expr_rec(fields, maybe_base) {
+        let exs = field_exprs(fields);
+        let mut changed =
+            find_pre_post_state_exprs(fcx, pres, e.id,
+                                      vec::from_elem(vec::len(fields),
+                                                    init_assign),
+                                      exs, return_val);
+
+        let base_pres = match vec::last_opt(exs) { none { pres }
+                          some(f) { expr_poststate(fcx.ccx, f) }};
+        option::iter(maybe_base, |base| {
+            changed |= find_pre_post_state_expr(fcx, base_pres, base) |
+                set_poststate_ann(fcx.ccx, e.id,
+                                  expr_poststate(fcx.ccx, base))
+        });
+        return changed;
+      }
+      expr_tup(elts) {
+        return find_pre_post_state_exprs(fcx, pres, e.id,
+                                      vec::from_elem(vec::len(elts),
+                                                    init_assign), elts,
+                                      return_val);
+      }
+      expr_move(lhs, rhs) {
+        return find_pre_post_state_two(fcx, pres, lhs, rhs, e.id, oper_move);
+      }
+      expr_assign(lhs, rhs) {
+        return find_pre_post_state_two(
+            fcx, pres, lhs, rhs, e.id, oper_assign);
+      }
+      expr_swap(lhs, rhs) {
+        return find_pre_post_state_two(fcx, pres, lhs, rhs, e.id, oper_swap);
+        // Could be more precise and actually swap the role of
+        // lhs and rhs in constraints
+      }
+      expr_ret(maybe_ret_val) {
+        let mut changed = set_prestate_ann(fcx.ccx, e.id, pres);
+        /* everything is true if execution continues after
+           a return expression (since execution never continues locally
+           after a return expression */
+        let post = false_postcond(num_constrs);
+
+        set_poststate_ann(fcx.ccx, e.id, post);
+
+        match maybe_ret_val {
+          none {/* do nothing */ }
+          some(ret_val) {
+            changed |= find_pre_post_state_expr(fcx, pres, ret_val);
+          }
+        }
+        return changed;
+      }
+      expr_if(antec, conseq, maybe_alt) {
+        return join_then_else(fcx, antec, conseq, maybe_alt, e.id, plain_if,
+                           pres);
+      }
+      expr_binary(bop, l, r) {
+        if lazy_binop(bop) {
+            let mut changed = find_pre_post_state_expr(fcx, pres, l);
+            changed |=
+                find_pre_post_state_expr(fcx, expr_poststate(fcx.ccx, l), r);
+            return changed | set_prestate_ann(fcx.ccx, e.id, pres) |
+                    set_poststate_ann(fcx.ccx, e.id,
+                                      expr_poststate(fcx.ccx, l));
+        } else {
+            return find_pre_post_state_two(fcx, pres, l, r, e.id, oper_pure);
+        }
+      }
+      expr_assign_op(op, lhs, rhs) {
+        return find_pre_post_state_two(fcx, pres, lhs, rhs, e.id,
+                                    oper_assign_op);
+      }
+      expr_while(test, body) {
+        let loop_pres =
+            intersect_states(block_poststate(fcx.ccx, body), pres);
+
+        let mut changed =
+            set_prestate_ann(fcx.ccx, e.id, loop_pres) |
+                find_pre_post_state_expr(fcx, loop_pres, test) |
+                find_pre_post_state_block(fcx, expr_poststate(fcx.ccx, test),
+                                          body);
+
+        /* conservative approximation: if a loop contains a break
+           or cont, we assume nothing about the poststate */
+        /* which is still unsound -- see ~[Break-unsound] */
+        if has_nonlocal_exits(body) {
+            return changed | set_poststate_ann(fcx.ccx, e.id, pres);
+        } else {
+            let e_post = expr_poststate(fcx.ccx, test);
+            let b_post = block_poststate(fcx.ccx, body);
+            return changed |
+                    set_poststate_ann(fcx.ccx, e.id,
+                                      intersect_states(e_post, b_post));
+        }
+      }
+      expr_loop(body) {
+        let loop_pres =
+            intersect_states(block_poststate(fcx.ccx, body), pres);
+        let mut changed = set_prestate_ann(fcx.ccx, e.id, loop_pres)
+              | find_pre_post_state_block(fcx, loop_pres, body);
+        /* conservative approximation: if a loop contains a break
+           or cont, we assume nothing about the poststate (so, we
+           set all predicates to "don't know" */
+        /* which is still unsound -- see ~[Break-unsound] */
+        if may_break(body) {
+                /* Only do this if there are *breaks* not conts.
+                 An infinite loop with conts is still an infinite loop.
+                We assume all preds are FALSE, not '?' -- because in the
+                worst case, the body could invalidate all preds and
+                deinitialize everything before breaking */
+            let post = empty_poststate(num_constrs);
+            post.kill();
+            return changed | set_poststate_ann(fcx.ccx, e.id, post);
+        } else {
+            return changed | set_poststate_ann(fcx.ccx, e.id,
+                                            false_postcond(num_constrs));
+        }
+      }
+      expr_index(val, sub) {
+        return find_pre_post_state_two(fcx, pres, val, sub, e.id, oper_pure);
+      }
+      expr_match(val, alts, _) {
+        let mut changed =
+            set_prestate_ann(fcx.ccx, e.id, pres) |
+                find_pre_post_state_expr(fcx, pres, val);
+        let e_post = expr_poststate(fcx.ccx, val);
+        let mut a_post;
+        if vec::len(alts) > 0u {
+            a_post = false_postcond(num_constrs);
+            for alts.each |an_alt| {
+                match an_alt.guard {
+                  some(e) {
+                    changed |= find_pre_post_state_expr(fcx, e_post, e);
+                  }
+                  _ {}
+                }
+                changed |=
+                    find_pre_post_state_block(fcx, e_post, an_alt.body);
+                intersect(a_post, block_poststate(fcx.ccx, an_alt.body));
+                // We deliberately do *not* update changed here, because
+                // we'd go into an infinite loop that way, and the change
+                // gets made after the if expression.
+
+            }
+        } else {
+            // No alts; poststate is the poststate of the test
+
+            a_post = e_post;
+        }
+        return changed | set_poststate_ann(fcx.ccx, e.id, a_post);
+      }
+      expr_field(x, _, _) | expr_loop_body(x) | expr_do_body(x) |
+      expr_unary(_, x) |
+      expr_addr_of(_, x) | expr_assert(x) | expr_cast(x, _) |
+      expr_copy(x) {
+        return find_pre_post_state_sub(fcx, pres, x, e.id, none);
+      }
+      expr_fail(maybe_fail_val) {
+        /* if execution continues after fail, then everything is true!
+        woo! */
+        let post = false_postcond(num_constrs);
+        return set_prestate_ann(fcx.ccx, e.id, pres) |
+                set_poststate_ann(fcx.ccx, e.id, post) |
+                option::map_default(
+                    maybe_fail_val, false,
+                    |fail_val|
+                    find_pre_post_state_expr(fcx, pres, fail_val) );
+      }
+      expr_check(_, p) {
+        /* predicate p holds after this expression executes */
+        let c: sp_constr = expr_to_constr(fcx.ccx.tcx, p);
+        return find_pre_post_state_sub(fcx, pres, p, e.id, some(c.node));
+      }
+      expr_if_check(p, conseq, maybe_alt) {
+        return join_then_else(
+            fcx, p, conseq, maybe_alt, e.id, if_check, pres);
+      }
+      expr_break { return pure_exp(fcx.ccx, e.id, pres); }
+      expr_again { return pure_exp(fcx.ccx, e.id, pres); }
+    }
+}
+
+fn find_pre_post_state_stmt(fcx: fn_ctxt, pres: prestate, s: @stmt) -> bool {
+    let stmt_ann = stmt_to_ann(fcx.ccx, *s);
+
+    debug!("[ %s ]", *fcx.name);
+    debug!("*At beginning: stmt = %s", stmt_to_str(*s));
+    debug!("*prestate = %s", stmt_ann.states.prestate.to_str());
+    debug!("*poststate = %s", stmt_ann.states.prestate.to_str());
+
+    match s.node {
+      stmt_decl(adecl, id) {
+        match adecl.node {
+          decl_local(alocals) {
+            set_prestate(stmt_ann, pres);
+            let c_and_p = seq_states(fcx, pres,
+                  locals_to_bindings(fcx.ccx.tcx, alocals));
+            /* important to do this in one step to ensure
+            termination (don't want to set changed to true
+            for intermediate changes) */
+
+            let mut changed =
+                set_poststate(stmt_ann, c_and_p.post) | c_and_p.changed;
+
+            debug!("Summary: stmt = %s", stmt_to_str(*s));
+            debug!("prestate = %s", stmt_ann.states.prestate.to_str());
+            debug!("poststate = %s", stmt_ann.states.poststate.to_str());
+            debug!("changed = %s", bool::to_str(changed));
+
+            return changed;
+          }
+          decl_item(an_item) {
+            return set_prestate(stmt_ann, pres)
+                | set_poststate(stmt_ann, pres);
+            /* the outer visitor will recurse into the item */
+          }
+        }
+      }
+      stmt_expr(ex, _) | stmt_semi(ex, _) {
+        let mut changed =
+            find_pre_post_state_expr(fcx, pres, ex) |
+                set_prestate(stmt_ann, expr_prestate(fcx.ccx, ex)) |
+                set_poststate(stmt_ann, expr_poststate(fcx.ccx, ex));
+
+
+        debug!("Finally: %s", stmt_to_str(*s));
+        debug!("prestate = %s", stmt_ann.states.prestate.to_str());
+        debug!("poststate = %s", stmt_ann.states.poststate.to_str());
+        debug!("changed = %s", bool::to_str(changed));
+
+        return changed;
+      }
+    }
+}
+
+
+/* Updates the pre- and post-states of statements in the block,
+   returns a boolean flag saying whether any pre- or poststates changed */
+fn find_pre_post_state_block(fcx: fn_ctxt, pres0: prestate, b: blk) -> bool {
+    /* First, set the pre-states and post-states for every expression */
+
+    let mut pres = pres0;
+    /* Iterate over each stmt. The new prestate is <pres>. The poststate
+     consist of improving <pres> with whatever variables this stmt
+     initializes.  Then <pres> becomes the new poststate. */
+
+    let mut changed = false;
+    for b.node.stmts.each |s| {
+        changed |= find_pre_post_state_stmt(fcx, pres, s);
+        pres = stmt_poststate(fcx.ccx, *s);
+    }
+    let mut post = pres;
+    match b.node.expr {
+      none { }
+      some(e) {
+        changed |= find_pre_post_state_expr(fcx, pres, e);
+        post = expr_poststate(fcx.ccx, e);
+      }
+    }
+
+    set_prestate_ann(fcx.ccx, b.node.id, pres0);
+    set_poststate_ann(fcx.ccx, b.node.id, post);
+
+    return changed;
+}
+
+fn find_pre_post_state_fn(fcx: fn_ctxt,
+                          f_decl: fn_decl,
+                          f_body: blk) -> bool {
+    // All constraints are considered false until proven otherwise.
+    // This ensures that intersect works correctly.
+    kill_all_prestate(fcx, f_body.node.id);
+
+    // Instantiate any constraints on the arguments so we can use them
+    let block_pre = block_prestate(fcx.ccx, f_body);
+    for f_decl.constraints.each |c| {
+        let tsc = ast_constr_to_ts_constr(fcx.ccx.tcx, f_decl.inputs, c);
+        set_in_prestate_constr(fcx, tsc, block_pre);
+    }
+
+    let mut changed = find_pre_post_state_block(fcx, block_pre, f_body);
+
+    /*
+        error!("find_pre_post_state_fn");
+        log(error, changed);
+        fcx.ccx.tcx.sess.span_note(f_body.span, fcx.name);
+    */
+
+    return changed;
+}
+//
+// Local Variables:
+// mode: rust
+// fill-column: 78;
+// indent-tabs-mode: nil
+// c-basic-offset: 4
+// buffer-file-coding-system: utf-8-unix
+// End:
+//
index 13bb97fcdbf9da0bf94518e0a109c0ec27b9d5a1..fe317f737b140d65c2ca333a8de136ac005a1dce 100644 (file)
@@ -521,17 +521,17 @@ trait vid {
 
 impl tv_vid: vid {
     pure fn to_uint() -> uint { *self }
-    pure fn to_str() -> ~str { fmt!{"<V%u>", self.to_uint()} }
+    pure fn to_str() -> ~str { fmt!("<V%u>", self.to_uint()) }
 }
 
 impl tvi_vid: vid {
     pure fn to_uint() -> uint { *self }
-    pure fn to_str() -> ~str { fmt!{"<VI%u>", self.to_uint()} }
+    pure fn to_str() -> ~str { fmt!("<VI%u>", self.to_uint()) }
 }
 
 impl region_vid: vid {
     pure fn to_uint() -> uint { *self }
-    pure fn to_str() -> ~str { fmt!{"%?", self} }
+    pure fn to_str() -> ~str { fmt!("%?", self) }
 }
 
 trait purity_to_str {
@@ -1135,23 +1135,23 @@ fn substs_is_noop(substs: &substs) -> bool {
 }
 
 fn substs_to_str(cx: ctxt, substs: &substs) -> ~str {
-    fmt!{"substs(self_r=%s, self_ty=%s, tps=%?)",
+    fmt!("substs(self_r=%s, self_ty=%s, tps=%?)",
          substs.self_r.map_default(~"none", |r| region_to_str(cx, r)),
          substs.self_ty.map_default(~"none", |t| ty_to_str(cx, t)),
-         substs.tps.map(|t| ty_to_str(cx, t))}
+         substs.tps.map(|t| ty_to_str(cx, t)))
 }
 
 fn subst(cx: ctxt,
          substs: &substs,
          typ: t) -> t {
 
-    debug!{"subst(substs=%s, typ=%s)",
+    debug!("subst(substs=%s, typ=%s)",
            substs_to_str(cx, substs),
-           ty_to_str(cx, typ)};
+           ty_to_str(cx, typ));
 
     if substs_is_noop(substs) { return typ; }
     let r = do_subst(cx, substs, typ);
-    debug!{"  r = %s", ty_to_str(cx, r)};
+    debug!("  r = %s", ty_to_str(cx, r));
     return r;
 
     fn do_subst(cx: ctxt,
@@ -1880,27 +1880,27 @@ fn is_instantiable(cx: ctxt, r_ty: t) -> bool {
 
     fn type_requires(cx: ctxt, seen: @mut ~[def_id],
                      r_ty: t, ty: t) -> bool {
-        debug!{"type_requires(%s, %s)?",
+        debug!("type_requires(%s, %s)?",
                ty_to_str(cx, r_ty),
-               ty_to_str(cx, ty)};
+               ty_to_str(cx, ty));
 
         let r = {
             get(r_ty).struct == get(ty).struct ||
                 subtypes_require(cx, seen, r_ty, ty)
         };
 
-        debug!{"type_requires(%s, %s)? %b",
+        debug!("type_requires(%s, %s)? %b",
                ty_to_str(cx, r_ty),
                ty_to_str(cx, ty),
-               r};
+               r);
         return r;
     }
 
     fn subtypes_require(cx: ctxt, seen: @mut ~[def_id],
                         r_ty: t, ty: t) -> bool {
-        debug!{"subtypes_require(%s, %s)?",
+        debug!("subtypes_require(%s, %s)?",
                ty_to_str(cx, r_ty),
-               ty_to_str(cx, ty)};
+               ty_to_str(cx, ty));
 
         let r = match get(ty).struct {
           ty_nil |
@@ -1976,10 +1976,10 @@ fn subtypes_require(cx: ctxt, seen: @mut ~[def_id],
           }
         };
 
-        debug!{"subtypes_require(%s, %s)? %b",
+        debug!("subtypes_require(%s, %s)? %b",
                ty_to_str(cx, r_ty),
                ty_to_str(cx, ty),
-               r};
+               r);
 
         return r;
     }
@@ -1991,7 +1991,7 @@ fn subtypes_require(cx: ctxt, seen: @mut ~[def_id],
 fn type_structurally_contains(cx: ctxt, ty: t, test: fn(x: &sty) -> bool) ->
    bool {
     let sty = &get(ty).struct;
-    debug!{"type_structurally_contains: %s", ty_to_str(cx, ty)};
+    debug!("type_structurally_contains: %s", ty_to_str(cx, ty));
     if test(sty) { return true; }
     match *sty {
       ty_enum(did, ref substs) => {
@@ -2326,9 +2326,9 @@ fn node_id_to_type(cx: ctxt, id: ast::node_id) -> t {
     match smallintmap::find(*cx.node_types, id as uint) {
        some(t) => t,
        none => cx.sess.bug(
-           fmt!{"node_id_to_type: unbound node ID %s",
+           fmt!("node_id_to_type: unbound node ID %s",
                 ast_map::node_id_to_str(cx.items, id,
-                                        cx.sess.parse_sess.interner)})
+                                        cx.sess.parse_sess.interner)))
     }
 }
 
@@ -2382,7 +2382,7 @@ fn is_fn_ty(fty: t) -> bool {
 fn ty_region(ty: t) -> region {
     match get(ty).struct {
       ty_rptr(r, _) => r,
-      s => fail fmt!{"ty_region() invoked on non-rptr: %?", s}
+      s => fail fmt!("ty_region() invoked on non-rptr: %?", s)
     }
 }
 
@@ -2400,15 +2400,15 @@ fn is_pred_ty(fty: t) -> bool {
 fn ty_var_id(typ: t) -> tv_vid {
     match get(typ).struct {
       ty_var(vid) => return vid,
-      _ => { error!{"ty_var_id called on non-var ty"}; fail; }
+      _ => { error!("ty_var_id called on non-var ty"); fail; }
     }
 }
 
 fn ty_var_integral_id(typ: t) -> tvi_vid {
     match get(typ).struct {
       ty_var_integral(vid) => return vid,
-      _ => { error!{"ty_var_integral_id called on ty other than \
-                  ty_var_integral"};
+      _ => { error!("ty_var_integral_id called on ty other than \
+                  ty_var_integral");
          fail; }
     }
 }
@@ -2591,7 +2591,7 @@ fn canon_mode(cx: ctxt, m0: ast::mode) -> ast::mode {
 fn resolved_mode(cx: ctxt, m: ast::mode) -> ast::rmode {
     match canon_mode(cx, m) {
       ast::infer(_) => {
-        cx.sess.bug(fmt!{"mode %? was never resolved", m});
+        cx.sess.bug(fmt!("mode %? was never resolved", m));
       }
       ast::expl(m0) => m0
     }
@@ -2642,7 +2642,7 @@ fn ty_sort_str(cx: ctxt, t: t) -> ~str {
         ty_to_str(cx, t)
       }
 
-      ty_enum(id, _) => fmt!{"enum %s", item_path_str(cx, id)},
+      ty_enum(id, _) => fmt!("enum %s", item_path_str(cx, id)),
       ty_box(_) => ~"@-ptr",
       ty_uniq(_) => ~"~-ptr",
       ty_evec(_, _) => ~"vector",
@@ -2651,8 +2651,8 @@ fn ty_sort_str(cx: ctxt, t: t) -> ~str {
       ty_rptr(_, _) => ~"&-ptr",
       ty_rec(_) => ~"record",
       ty_fn(_) => ~"fn",
-      ty_trait(id, _, _) => fmt!{"trait %s", item_path_str(cx, id)},
-      ty_class(id, _) => fmt!{"class %s", item_path_str(cx, id)},
+      ty_trait(id, _, _) => fmt!("trait %s", item_path_str(cx, id)),
+      ty_class(id, _) => fmt!("class %s", item_path_str(cx, id)),
       ty_tup(_) => ~"tuple",
       ty_var(_) => ~"variable",
       ty_var_integral(_) => ~"integral variable",
@@ -2685,14 +2685,14 @@ fn to_str(s: ast::ret_style) -> ~str {
                     to_str(values.expected))
       }
       terr_purity_mismatch(values) => {
-        fmt!{"expected %s fn but found %s fn",
+        fmt!("expected %s fn but found %s fn",
                     purity_to_str(values.expected),
-                    purity_to_str(values.found)}
+                    purity_to_str(values.found))
       }
       terr_proto_mismatch(values) => {
-        fmt!{"expected %s closure, found %s closure",
+        fmt!("expected %s closure, found %s closure",
              proto_ty_to_str(cx, values.expected),
-             proto_ty_to_str(cx, values.found)}
+             proto_ty_to_str(cx, values.found))
       }
       terr_mutability => ~"values differ in mutability",
       terr_box_mutability => ~"boxed values differ in mutability",
@@ -2728,14 +2728,14 @@ fn to_str(s: ast::ret_style) -> ~str {
              mode_to_str(values.expected), mode_to_str(values.found))
       }
       terr_regions_does_not_outlive(subregion, superregion) => {
-        fmt!{"%s does not necessarily outlive %s",
+        fmt!("%s does not necessarily outlive %s",
                     explain_region(cx, superregion),
-                    explain_region(cx, subregion)}
+                    explain_region(cx, subregion))
       }
       terr_regions_not_same(region1, region2) => {
-        fmt!{"%s is not the same as %s",
+        fmt!("%s is not the same as %s",
                     explain_region(cx, region1),
-                    explain_region(cx, region2)}
+                    explain_region(cx, region2))
       }
       terr_regions_no_overlap(region1, region2) => {
         fmt!("%s does not intersect %s",
@@ -2753,9 +2753,9 @@ fn to_str(s: ast::ret_style) -> ~str {
              type_err_to_str(cx, err))
       }
       terr_sorts(values) => {
-        fmt!{"expected %s but found %s",
+        fmt!("expected %s but found %s",
                     ty_sort_str(cx, values.expected),
-                    ty_sort_str(cx, values.found)}
+                    ty_sort_str(cx, values.found))
       }
       terr_self_substs => {
         ~"inconsistent self substitution" // XXX this is more of a bug
@@ -2800,7 +2800,7 @@ fn trait_methods(cx: ctxt, id: ast::def_id) -> @~[method] {
 
 fn impl_traits(cx: ctxt, id: ast::def_id) -> ~[t] {
     if id.crate == ast::local_crate {
-        debug!{"(impl_traits) searching for trait impl %?", id};
+        debug!("(impl_traits) searching for trait impl %?", id);
         match cx.items.find(id.node) {
            some(ast_map::node_item(@{
                         node: ast::item_impl(_, trait_refs, _, _),
@@ -2816,12 +2816,12 @@ fn impl_traits(cx: ctxt, id: ast::def_id) -> ~[t] {
              match cx.def_map.find(id.node) {
                some(def_ty(trait_id)) => {
                    // XXX: Doesn't work cross-crate.
-                   debug!{"(impl_traits) found trait id %?", trait_id};
+                   debug!("(impl_traits) found trait id %?", trait_id);
                    ~[node_id_to_type(cx, trait_id.node)]
                }
                some(x) => {
-                 cx.sess.bug(fmt!{"impl_traits: trait ref is in trait map \
-                                   but is bound to %?", x});
+                 cx.sess.bug(fmt!("impl_traits: trait ref is in trait map \
+                                   but is bound to %?", x));
                }
                none => {
                  ~[]
@@ -2932,7 +2932,7 @@ fn item_path(cx: ctxt, id: ast::def_id) -> ast_map::path {
           ast_map::node_stmt(*) | ast_map::node_expr(*) |
           ast_map::node_arg(*) | ast_map::node_local(*) |
           ast_map::node_export(*) | ast_map::node_block(*) => {
-            cx.sess.bug(fmt!{"cannot find item_path for node %?", node});
+            cx.sess.bug(fmt!("cannot find item_path for node %?", node));
           }
         }
     }
@@ -3080,9 +3080,9 @@ fn lookup_class_fields(cx: ctxt, did: ast::def_id) -> ~[field_ty] {
        }
        _ => {
            cx.sess.bug(
-               fmt!{"class ID not bound to an item: %s",
+               fmt!("class ID not bound to an item: %s",
                     ast_map::node_id_to_str(cx.items, did.node,
-                                            cx.sess.parse_sess.interner)});
+                                            cx.sess.parse_sess.interner)));
        }
     }
         }
@@ -3147,8 +3147,8 @@ fn lookup_class_method_ids(cx: ctxt, did: ast::def_id)
              return ast_util::local_def(m.id);
          }
        }
-       cx.sess.span_fatal(sp, fmt!{"Class doesn't have a method \
-           named %s", cx.sess.str_of(name)});
+       cx.sess.span_fatal(sp, fmt!("Class doesn't have a method \
+           named %s", cx.sess.str_of(name)));
     }
     else {
       csearch::get_class_method(cx.sess.cstore, did, name)
index 641d2e89c6c077ee1e675081d25847b967537995..302bc604c2a36cb083842b0439b8f6aca3fbbe94 100644 (file)
@@ -175,7 +175,7 @@ enum crate_ctxt {
 
 // Functions that write types into the node type table
 fn write_ty_to_tcx(tcx: ty::ctxt, node_id: ast::node_id, ty: ty::t) {
-    debug!{"write_ty_to_tcx(%d, %s)", node_id, ty_to_str(tcx, ty)};
+    debug!("write_ty_to_tcx(%d, %s)", node_id, ty_to_str(tcx, ty));
     smallintmap::insert(*tcx.node_types, node_id as uint, ty);
 }
 fn write_substs_to_tcx(tcx: ty::ctxt,
@@ -275,10 +275,10 @@ fn check_main_fn_ty(ccx: @crate_ctxt,
               arg_is_argv_ty(tcx, inputs[0]);
         if !ok {
                 tcx.sess.span_err(main_span,
-                   fmt!{"Wrong type in main function: found `%s`, \
+                   fmt!("Wrong type in main function: found `%s`, \
                    expected `extern fn(~[str]) -> ()` \
                    or `extern fn() -> ()`",
-                         ty_to_str(tcx, main_t)});
+                         ty_to_str(tcx, main_t)));
          }
       }
       _ => {
index a636fbded1a2ee27bc5fecd7787b14eabfd0eff5..1b6f4e86a61d99cf7a80393957a941fba9426ece 100644 (file)
@@ -87,8 +87,8 @@ fn ast_path_to_substs_and_ty<AC: ast_conv, RS: region_scope copy owned>(
     let {bounds: decl_bounds, region_param: decl_rp, ty: decl_ty} =
         self.get_item_ty(did);
 
-    debug!["ast_path_to_substs_and_ty: did=%? decl_rp=%?",
-           did, decl_rp];
+    debug!("ast_path_to_substs_and_ty: did=%? decl_rp=%?",
+           did, decl_rp);
 
     // If the type is parameterized by the self region, then replace self
     // region with the current anon region binding (in other words,
@@ -100,9 +100,9 @@ fn ast_path_to_substs_and_ty<AC: ast_conv, RS: region_scope copy owned>(
       (none, some(_)) => {
         tcx.sess.span_err(
             path.span,
-            fmt!{"no region bound is allowed on `%s`, \
+            fmt!("no region bound is allowed on `%s`, \
                   which is not declared as containing region pointers",
-                 ty::item_path_str(tcx, did)});
+                 ty::item_path_str(tcx, did)));
         none
       }
       (some(_), none) => {
@@ -119,8 +119,8 @@ fn ast_path_to_substs_and_ty<AC: ast_conv, RS: region_scope copy owned>(
     if !vec::same_length(*decl_bounds, path.types) {
         self.tcx().sess.span_fatal(
             path.span,
-            fmt!{"wrong number of type arguments: expected %u but found %u",
-                 (*decl_bounds).len(), path.types.len()});
+            fmt!("wrong number of type arguments: expected %u but found %u",
+                 (*decl_bounds).len(), path.types.len()));
     }
     let tps = path.types.map(|a_t| ast_ty_to_ty(self, rscope, a_t));
 
@@ -310,8 +310,8 @@ fn check_path_args(tcx: ty::ctxt,
       ast::ty_path(path, id) => {
         let a_def = match tcx.def_map.find(id) {
           none => tcx.sess.span_fatal(
-              ast_ty.span, fmt!{"unbound path %s",
-                                path_to_str(path, tcx.sess.intr())}),
+              ast_ty.span, fmt!("unbound path %s",
+                                path_to_str(path, tcx.sess.intr()))),
           some(d) => d
         };
         match a_def {
@@ -368,8 +368,8 @@ fn check_path_args(tcx: ty::ctxt,
                         |ty| {
                             tcx.sess.span_err(
                                 a_t.span,
-                                fmt!{"bound not allowed on a %s",
-                                     ty::ty_sort_str(tcx, ty.ty)});
+                                fmt!("bound not allowed on a %s",
+                                     ty::ty_sort_str(tcx, ty.ty)));
                             ty.ty
                         })
       }
@@ -470,7 +470,7 @@ fn ty_of_fn_decl<AC: ast_conv, RS: region_scope copy owned>(
     expected_tys: expected_tys,
     span: span) -> ty::fn_ty {
 
-    debug!{"ty_of_fn_decl"};
+    debug!("ty_of_fn_decl");
     do indent {
         // new region names that appear inside of the fn decl are bound to
         // that function type
index fe01ec5bb4ed8306cbc0631ccd91c86122267af1..956dc70e5ddc0e2ce2267751b781ca78fd743769 100644 (file)
@@ -209,10 +209,10 @@ fn check_fn(ccx: @crate_ctxt,
     let arg_tys = fn_ty.inputs.map(|a| a.ty);
     let ret_ty = fn_ty.output;
 
-    debug!{"check_fn(arg_tys=%?, ret_ty=%?, self_info.self_ty=%?)",
+    debug!("check_fn(arg_tys=%?, ret_ty=%?, self_info.self_ty=%?)",
            arg_tys.map(|a| ty_to_str(tcx, a)),
            ty_to_str(tcx, ret_ty),
-           option::map(self_info, |s| ty_to_str(tcx, s.self_ty))};
+           option::map(self_info, |s| ty_to_str(tcx, s.self_ty)));
 
     // ______________________________________________________________________
     // Create the function context.  This is either derived from scratch or,
@@ -329,16 +329,16 @@ fn gather_locals(fcx: @fn_ctxt,
         for self_info.each |info| {
             assign(info.explicit_self.span,
                    info.self_id, some(info.self_ty));
-            debug!{"self is assigned to %s",
-                   fcx.locals.get(info.self_id).to_str()};
+            debug!("self is assigned to %s",
+                   fcx.locals.get(info.self_id).to_str());
         }
 
         // Add formal parameters.
         do vec::iter2(arg_tys, decl.inputs) |arg_ty, input| {
             assign(input.ty.span, input.id, some(arg_ty));
-            debug!{"Argument %s is assigned to %s",
+            debug!("Argument %s is assigned to %s",
                    tcx.sess.str_of(input.ident),
-                   fcx.locals.get(input.id).to_str()};
+                   fcx.locals.get(input.id).to_str());
         }
 
         // Add explicitly-declared locals.
@@ -349,9 +349,9 @@ fn gather_locals(fcx: @fn_ctxt,
               _ => some(fcx.to_ty(local.node.ty))
             };
             assign(local.span, local.node.id, o_ty);
-            debug!{"Local variable %s is assigned to %s",
+            debug!("Local variable %s is assigned to %s",
                    pat_to_str(local.node.pat, tcx.sess.intr()),
-                   fcx.locals.get(local.node.id).to_str()};
+                   fcx.locals.get(local.node.id).to_str());
             visit::visit_local(local, e, v);
         };
 
@@ -361,9 +361,9 @@ fn gather_locals(fcx: @fn_ctxt,
               ast::pat_ident(_, path, _)
                   if !pat_util::pat_is_variant(fcx.ccx.tcx.def_map, p) => {
                 assign(p.span, p.id, none);
-                debug!{"Pattern binding %s is assigned to %s",
+                debug!("Pattern binding %s is assigned to %s",
                        tcx.sess.str_of(path.idents[0]),
-                       fcx.locals.get(p.id).to_str()};
+                       fcx.locals.get(p.id).to_str());
               }
               _ => {}
             }
@@ -414,9 +414,9 @@ fn check_no_duplicate_fields(tcx: ty::ctxt, fields:
         let (id, sp) = p;
         match field_names.find(id) {
           some(orig_sp) => {
-            tcx.sess.span_err(sp, fmt!{"Duplicate field \
+            tcx.sess.span_err(sp, fmt!("Duplicate field \
                                    name %s in record type declaration",
-                                        tcx.sess.str_of(id)});
+                                        tcx.sess.str_of(id)));
             tcx.sess.span_note(orig_sp, ~"First declaration of \
                                           this field occurred here");
             break;
@@ -528,7 +528,7 @@ fn check_item(ccx: @crate_ctxt, it: @ast::item) {
                 if (*tpt.bounds).is_not_empty() {
                     ccx.tcx.sess.span_err(
                         item.span,
-                        fmt!{"foreign items may not have type parameters"});
+                        fmt!("foreign items may not have type parameters"));
                 }
             }
         }
@@ -561,8 +561,8 @@ fn named_region(span: span, id: ast::ident) -> result<ty::region, ~str> {
               none if id == syntax::parse::token::special_idents::blk
                   => result::ok(self.block_region()),
               none => {
-                result::err(fmt!{"named region `%s` not in scope here",
-                                 self.ccx.tcx.sess.str_of(id)})
+                result::err(fmt!("named region `%s` not in scope here",
+                                 self.ccx.tcx.sess.str_of(id)))
               }
             }
         }
@@ -570,14 +570,14 @@ fn named_region(span: span, id: ast::ident) -> result<ty::region, ~str> {
 }
 
 impl @fn_ctxt {
-    fn tag() -> ~str { fmt!{"%x", ptr::addr_of(*self) as uint} }
+    fn tag() -> ~str { fmt!("%x", ptr::addr_of(*self) as uint) }
     fn block_region() -> ty::region {
         ty::re_scope(self.region_lb)
     }
     #[inline(always)]
     fn write_ty(node_id: ast::node_id, ty: ty::t) {
-        debug!{"write_ty(%d, %s) in fcx %s",
-               node_id, ty_to_str(self.tcx(), ty), self.tag()};
+        debug!("write_ty(%d, %s) in fcx %s",
+               node_id, ty_to_str(self.tcx(), ty), self.tag());
         self.node_types.insert(node_id, ty);
     }
     fn write_substs(node_id: ast::node_id, +substs: ty::substs) {
@@ -607,9 +607,9 @@ fn expr_ty(ex: @ast::expr) -> ty::t {
           some(t) => t,
           none => {
             self.tcx().sess.bug(
-                fmt!{"no type for expr %d (%s) in fcx %s",
+                fmt!("no type for expr %d (%s) in fcx %s",
                      ex.id, expr_to_str(ex, self.ccx.tcx.sess.intr()),
-                     self.tag()});
+                     self.tag()));
           }
         }
     }
@@ -618,11 +618,11 @@ fn node_ty(id: ast::node_id) -> ty::t {
           some(t) => t,
           none => {
             self.tcx().sess.bug(
-                fmt!{"no type for node %d: %s in fcx %s",
+                fmt!("no type for node %d: %s in fcx %s",
                      id, ast_map::node_id_to_str(
                          self.tcx().items, id,
                          self.tcx().sess.parse_sess.interner),
-                     self.tag()});
+                     self.tag()));
           }
         }
     }
@@ -631,11 +631,11 @@ fn node_ty_substs(id: ast::node_id) -> ty::substs {
           some(ts) => ts,
           none => {
             self.tcx().sess.bug(
-                fmt!{"no type substs for node %d: %s in fcx %s",
+                fmt!("no type substs for node %d: %s in fcx %s",
                      id, ast_map::node_id_to_str(
                          self.tcx().items, id,
                          self.tcx().sess.parse_sess.interner),
-                     self.tag()});
+                     self.tag()));
           }
         }
     }
@@ -647,10 +647,10 @@ fn report_mismatched_types(sp: span, e: ty::t, a: ty::t,
                                err: &ty::type_err) {
         self.ccx.tcx.sess.span_err(
             sp,
-            fmt!{"mismatched types: expected `%s` but found `%s` (%s)",
+            fmt!("mismatched types: expected `%s` but found `%s` (%s)",
                  self.infcx.ty_to_str(e),
                  self.infcx.ty_to_str(a),
-                 ty::type_err_to_str(self.ccx.tcx, err)});
+                 ty::type_err_to_str(self.ccx.tcx, err)));
     }
 
     fn mk_subty(a_is_expected: bool, span: span,
@@ -692,7 +692,7 @@ fn require_unsafe(sp: span, op: ~str) {
           _ => {
             self.ccx.tcx.sess.span_err(
                 sp,
-                fmt!{"%s requires unsafe function or block", op});
+                fmt!("%s requires unsafe function or block", op));
           }
         }
     }
@@ -863,10 +863,10 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
                            expected: option<ty::t>,
                            unifier: fn()) -> bool {
 
-    debug!{
+    debug!(
         ">> typechecking expr %d (%s)",
         expr.id, syntax::print::pprust::expr_to_str(expr,
-                                                    fcx.ccx.tcx.sess.intr())};
+                                                    fcx.ccx.tcx.sess.intr()));
 
     // A generic function to factor out common logic from call and
     // overloaded operations
@@ -880,8 +880,8 @@ fn check_call_inner(
         // Replace all region parameters in the arguments and return
         // type with fresh region variables.
 
-        debug!{"check_call_inner: before universal quant., in_fty=%s",
-               fcx.infcx.ty_to_str(in_fty)};
+        debug!("check_call_inner: before universal quant., in_fty=%s",
+               fcx.infcx.ty_to_str(in_fty));
 
         // This is subtle: we expect `fty` to be a function type, which
         // normally introduce a level of binding.  In this case, we want to
@@ -907,8 +907,8 @@ fn check_call_inner(
             };
 
         let fty = ty::mk_fn(fcx.tcx(), fn_ty);
-        debug!{"check_call_inner: after universal quant., fty=%s",
-               fcx.infcx.ty_to_str(fty)};
+        debug!("check_call_inner: after universal quant., fty=%s",
+               fcx.infcx.ty_to_str(fty));
 
         let supplied_arg_count = vec::len(args);
 
@@ -919,7 +919,7 @@ fn check_call_inner(
             fn_ty.inputs.map(|a| a.ty)
         } else {
             fcx.ccx.tcx.sess.span_err(
-                sp, fmt!{"this function takes %u parameter%s but %u \
+                sp, fmt!("this function takes %u parameter%s but %u \
                           parameter%s supplied", expected_arg_count,
                          if expected_arg_count == 1u {
                              ~""
@@ -931,7 +931,7 @@ fn check_call_inner(
                              ~" was"
                          } else {
                              ~"s were"
-                         }});
+                         }));
             fcx.infcx.next_ty_vars(supplied_arg_count)
         };
 
@@ -1099,8 +1099,8 @@ fn check_binop(fcx: @fn_ctxt, expr: @ast::expr,
                 // separate case below.
                 tcx.sess.span_bug(
                     expr.span,
-                    fmt!{"comparison operator in expr_binop: %s",
-                         ast_util::binop_to_str(op)});
+                    fmt!("comparison operator in expr_binop: %s",
+                         ast_util::binop_to_str(op)));
               }
               _ => lhs_t
             };
@@ -1161,8 +1161,8 @@ fn check_user_unop(fcx: @fn_ctxt, op_str: ~str, mname: ~str,
           some((ret_ty, _)) => ret_ty,
           _ => {
             fcx.ccx.tcx.sess.span_err(
-                ex.span, fmt!{"cannot apply unary operator `%s` to type `%s`",
-                              op_str, fcx.infcx.ty_to_str(rhs_t)});
+                ex.span, fmt!("cannot apply unary operator `%s` to type `%s`",
+                              op_str, fcx.infcx.ty_to_str(rhs_t)));
             rhs_t
           }
         }
@@ -1243,8 +1243,8 @@ fn check_expr_fn(fcx: @fn_ctxt,
 
         let fty = ty::mk_fn(tcx, fn_ty);
 
-        debug!{"check_expr_fn_with_unifier %s fty=%s",
-               expr_to_str(expr, tcx.sess.intr()), fcx.infcx.ty_to_str(fty)};
+        debug!("check_expr_fn_with_unifier %s fty=%s",
+               expr_to_str(expr, tcx.sess.intr()), fcx.infcx.ty_to_str(fty));
 
         fcx.write_ty(expr.id, fty);
 
@@ -1285,7 +1285,7 @@ fn check_field(fcx: @fn_ctxt, expr: @ast::expr, is_callee: bool,
 
               // (1) verify that the class id actually has a field called
               // field
-              debug!{"class named %s", ty_to_str(tcx, base_t)};
+              debug!("class named %s", ty_to_str(tcx, base_t));
               /*
                 check whether this is a self-reference or not, which
                 determines whether we look at all fields or only public
@@ -1335,11 +1335,11 @@ fn check_field(fcx: @fn_ctxt, expr: @ast::expr, is_callee: bool,
               }
               none => {
                 let t_err = fcx.infcx.resolve_type_vars_if_possible(expr_t);
-                let msg = fmt!{"attempted access of field `%s` on type `%s`, \
+                let msg = fmt!("attempted access of field `%s` on type `%s`, \
                                 but no public field or method with that name \
                                 was found",
                                 tcx.sess.str_of(field),
-                                fcx.infcx.ty_to_str(t_err)};
+                                fcx.infcx.ty_to_str(t_err));
                 tcx.sess.span_err(expr.span, msg);
                 // NB: Adding a bogus type to allow typechecking to continue
                 fcx.write_ty(expr.id, fcx.infcx.next_ty_var());
@@ -1466,8 +1466,8 @@ fn check_field(fcx: @fn_ctxt, expr: @ast::expr, is_callee: bool,
                   _ => {
                     tcx.sess.span_err(
                         expr.span,
-                        fmt!{"type %s cannot be dereferenced",
-                             fcx.infcx.ty_to_str(oprnd_t)});
+                        fmt!("type %s cannot be dereferenced",
+                             fcx.infcx.ty_to_str(oprnd_t)));
                   }
                 }
               }
@@ -1626,9 +1626,9 @@ fn check_field(fcx: @fn_ctxt, expr: @ast::expr, is_callee: bool,
               result::ok(_) => (),
               result::err(err) => {
                 tcx.sess.span_fatal(
-                    expr.span, fmt!{"a `loop` function's last argument \
+                    expr.span, fmt!("a `loop` function's last argument \
                                      should return `bool`, not `%s`",
-                                    fcx.infcx.ty_to_str(fty.output)});
+                                    fcx.infcx.ty_to_str(fty.output)));
               }
             }
             (ty::mk_fn(tcx, {output: ty::mk_nil(tcx) with fty}), fty.proto)
@@ -1702,8 +1702,8 @@ fn check_field(fcx: @fn_ctxt, expr: @ast::expr, is_callee: bool,
         let t_1 = fcx.to_ty(t);
         let t_e = fcx.expr_ty(e);
 
-        debug!{"t_1=%s", fcx.infcx.ty_to_str(t_1)};
-        debug!{"t_e=%s", fcx.infcx.ty_to_str(t_e)};
+        debug!("t_1=%s", fcx.infcx.ty_to_str(t_1));
+        debug!("t_e=%s", fcx.infcx.ty_to_str(t_e));
 
         match ty::get(t_1).struct {
           // This will be looked up later on
@@ -1902,14 +1902,14 @@ fn get_node(f: spanned<field>) -> field { f.node }
                 none => {
                     tcx.sess.span_err(
                         field.span,
-                        fmt!{"structure has no field named field named `%s`",
-                             tcx.sess.str_of(field.node.ident)});
+                        fmt!("structure has no field named field named `%s`",
+                             tcx.sess.str_of(field.node.ident)));
                 }
                 some((_, true)) => {
                     tcx.sess.span_err(
                         field.span,
-                        fmt!{"field `%s` specified more than once",
-                             tcx.sess.str_of(field.node.ident)});
+                        fmt!("field `%s` specified more than once",
+                             tcx.sess.str_of(field.node.ident)));
                 }
                 some((field_id, false)) => {
                     let expected_field_type =
@@ -1939,14 +1939,14 @@ fn get_node(f: spanned<field>) -> field { f.node }
                     }
 
                     tcx.sess.span_err(expr.span,
-                                      fmt!{"missing field%s: %s",
+                                      fmt!("missing field%s: %s",
                                            if missing_fields.len() == 1 {
                                                ~""
                                            } else {
                                                ~"s"
                                            },
                                            str::connect(missing_fields,
-                                                        ~", ")});
+                                                        ~", ")));
                 }
             }
             some(base_expr) => {
@@ -1992,17 +1992,17 @@ fn get_node(f: spanned<field>) -> field { f.node }
     }
     if bot { fcx.write_bot(expr.id); }
 
-    debug!{"type of expr %s is %s, expected is %s",
+    debug!("type of expr %s is %s, expected is %s",
            syntax::print::pprust::expr_to_str(expr, tcx.sess.intr()),
            ty_to_str(tcx, fcx.expr_ty(expr)),
            match expected {
                some(t) => ty_to_str(tcx, t),
                _ => ~"empty"
-           }};
+           });
 
     unifier();
 
-    debug!{"<< bot=%b", bot};
+    debug!("<< bot=%b", bot);
     return bot;
 }
 
@@ -2152,10 +2152,10 @@ fn check_instantiable(tcx: ty::ctxt,
                       item_id: ast::node_id) {
     let item_ty = ty::node_id_to_type(tcx, item_id);
     if !ty::is_instantiable(tcx, item_ty) {
-        tcx.sess.span_err(sp, fmt!{"this type cannot be instantiated \
+        tcx.sess.span_err(sp, fmt!("this type cannot be instantiated \
                                     without an instance of itself; \
                                     consider using `option<%s>`",
-                                   ty_to_str(tcx, item_ty)});
+                                   ty_to_str(tcx, item_ty)));
     }
 }
 
@@ -2439,7 +2439,7 @@ fn ast_expr_vstore_to_vstore(fcx: @fn_ctxt, e: @ast::expr, n: uint,
       ast::vstore_fixed(none) => ty::vstore_fixed(n),
       ast::vstore_fixed(some(u)) => {
         if n != u {
-            let s = fmt!{"fixed-size sequence mismatch: %u vs. %u",u, n};
+            let s = fmt!("fixed-size sequence mismatch: %u vs. %u",u, n);
             fcx.ccx.tcx.sess.span_err(e.span,s);
         }
         ty::vstore_fixed(u)
@@ -2475,8 +2475,8 @@ fn check_bounds_are_used(ccx: @crate_ctxt,
     for tps_used.eachi |i, b| {
         if !b {
             ccx.tcx.sess.span_err(
-                span, fmt!{"type parameter `%s` is unused",
-                           ccx.tcx.sess.str_of(tps[i].ident)});
+                span, fmt!("type parameter `%s` is unused",
+                           ccx.tcx.sess.str_of(tps[i].ident)));
         }
     }
 }
@@ -2574,14 +2574,14 @@ fn arg(m: ast::rmode, ty: ty::t) -> ty::arg {
     let i_ty = ty::lookup_item_type(ccx.tcx, local_def(it.id));
     let i_n_tps = (*i_ty.bounds).len();
     if i_n_tps != n_tps {
-        tcx.sess.span_err(it.span, fmt!{"intrinsic has wrong number \
+        tcx.sess.span_err(it.span, fmt!("intrinsic has wrong number \
                                          of type parameters: found %u, \
-                                         expected %u", i_n_tps, n_tps});
+                                         expected %u", i_n_tps, n_tps));
     } else {
         require_same_types(
             tcx, none, false, it.span, i_ty.ty, fty,
-            || fmt!{"intrinsic has wrong type: \
+            || fmt!("intrinsic has wrong type: \
                       expected `%s`",
-                     ty_to_str(ccx.tcx, fty)});
+                     ty_to_str(ccx.tcx, fty)));
     }
 }
index a38e42ff07679a055e4ede298a0e38ff2a79aecc..be41fddd7198364627f33af7b0170d22981ff592 100644 (file)
@@ -101,12 +101,12 @@ fn check_pat_variant(pcx: pat_ctxt, pat: @ast::pat, path: @ast::path,
         if arg_len > 0u {
             // N-ary variant.
             if arg_len != subpats_len {
-                let s = fmt!{"this pattern has %u field%s, but the \
+                let s = fmt!("this pattern has %u field%s, but the \
                               corresponding variant has %u field%s",
                              subpats_len,
                              if subpats_len == 1u { ~"" } else { ~"s" },
                              arg_len,
-                             if arg_len == 1u { ~"" } else { ~"s" }};
+                             if arg_len == 1u { ~"" } else { ~"s" });
                 tcx.sess.span_fatal(pat.span, s);
             }
 
@@ -117,18 +117,18 @@ fn check_pat_variant(pcx: pat_ctxt, pat: @ast::pat, path: @ast::path,
             };
         } else if subpats_len > 0u {
             tcx.sess.span_fatal
-                (pat.span, fmt!{"this pattern has %u field%s, \
+                (pat.span, fmt!("this pattern has %u field%s, \
                                  but the corresponding variant has no fields",
                                 subpats_len,
                                 if subpats_len == 1u { ~"" }
-                                else { ~"s" }});
+                                else { ~"s" }));
         }
       }
       _ => {
         tcx.sess.span_fatal
             (pat.span,
-             fmt!{"mismatched types: expected enum but found `%s`",
-                  fcx.infcx.ty_to_str(expected)});
+             fmt!("mismatched types: expected enum but found `%s`",
+                  fcx.infcx.ty_to_str(expected)));
       }
     }
 }
@@ -154,8 +154,8 @@ fn check_pat(pcx: pat_ctxt, pat: @ast::pat, expected: ty::t) {
             fcx.infcx.resolve_type_vars_if_possible(fcx.expr_ty(begin));
         let e_ty =
             fcx.infcx.resolve_type_vars_if_possible(fcx.expr_ty(end));
-        debug!{"pat_range beginning type: %?", b_ty};
-        debug!{"pat_range ending type: %?", e_ty};
+        debug!("pat_range beginning type: %?", b_ty);
+        debug!("pat_range ending type: %?", e_ty);
         if !require_same_types(
             tcx, some(fcx.infcx), false, pat.span, b_ty, e_ty,
             || ~"mismatched types in range") {
@@ -240,18 +240,18 @@ fn check_pat(pcx: pat_ctxt, pat: @ast::pat, expected: ty::t) {
           _ => {
             tcx.sess.span_fatal
                 (pat.span,
-                fmt!{"mismatched types: expected `%s` but found record",
-                     fcx.infcx.ty_to_str(expected)});
+                fmt!("mismatched types: expected `%s` but found record",
+                     fcx.infcx.ty_to_str(expected)));
           }
         };
         let f_count = vec::len(fields);
         let ex_f_count = vec::len(ex_fields);
         if ex_f_count < f_count || !etc && ex_f_count > f_count {
             tcx.sess.span_fatal
-                (pat.span, fmt!{"mismatched types: expected a record \
+                (pat.span, fmt!("mismatched types: expected a record \
                       with %u fields, found one with %u \
                       fields",
-                                ex_f_count, f_count});
+                                ex_f_count, f_count));
         }
 
         for fields.each |f| {
@@ -261,9 +261,9 @@ fn check_pat(pcx: pat_ctxt, pat: @ast::pat, expected: ty::t) {
               }
               none => {
                 tcx.sess.span_fatal(pat.span,
-                                    fmt!{"mismatched types: did not \
+                                    fmt!("mismatched types: did not \
                                           expect a record with a field `%s`",
-                                          tcx.sess.str_of(f.ident)});
+                                          tcx.sess.str_of(f.ident)));
               }
             }
         }
@@ -363,16 +363,16 @@ fn check_pat(pcx: pat_ctxt, pat: @ast::pat, expected: ty::t) {
           _ => {
             tcx.sess.span_fatal
                 (pat.span,
-                 fmt!{"mismatched types: expected `%s`, found tuple",
-                      fcx.infcx.ty_to_str(expected)});
+                 fmt!("mismatched types: expected `%s`, found tuple",
+                      fcx.infcx.ty_to_str(expected)));
           }
         };
         let e_count = vec::len(elts);
         if e_count != vec::len(ex_elts) {
             tcx.sess.span_fatal
-                (pat.span, fmt!{"mismatched types: expected a tuple \
+                (pat.span, fmt!("mismatched types: expected a tuple \
                       with %u fields, found one with %u \
-                      fields", vec::len(ex_elts), e_count});
+                      fields", vec::len(ex_elts), e_count));
         }
         let mut i = 0u;
         for elts.each |elt| {
index 2b953bcdd8e001b1b5f3f439bb56e5ac8b5c3ff8..ae913bb894bb8db0ee5d0d74967cedb1e1fa98df 100644 (file)
@@ -106,10 +106,10 @@ struct lookup {
 
     // Entrypoint:
     fn method() -> option<method_map_entry> {
-        debug!{"method lookup(m_name=%s, self_ty=%s, %?)",
+        debug!("method lookup(m_name=%s, self_ty=%s, %?)",
                self.fcx.tcx().sess.str_of(self.m_name),
                self.fcx.infcx.ty_to_str(self.self_ty),
-               ty::get(self.self_ty).struct};
+               ty::get(self.self_ty).struct);
 
         // Determine if there are any inherent methods we can call.
         // (An inherent method is one that belongs to no trait, but is
@@ -122,15 +122,15 @@ fn method() -> option<method_map_entry> {
             optional_inherent_methods = none;
           }
           some(base_type_def_id) => {
-            debug!{"(checking method) found base type"};
+            debug!("(checking method) found base type");
             optional_inherent_methods =
                 self.fcx.ccx.coherence_info.inherent_methods.find
                 (base_type_def_id);
 
             if optional_inherent_methods.is_none() {
-                debug!{"(checking method) ... no inherent methods found"};
+                debug!("(checking method) ... no inherent methods found");
             } else {
-                debug!{"(checking method) ... inherent methods found"};
+                debug!("(checking method) ... inherent methods found");
             }
           }
         }
@@ -177,8 +177,8 @@ fn method() -> option<method_map_entry> {
 
             // if we found anything, stop before trying borrows
             if self.candidates.len() > 0u {
-                debug!{"(checking method) found at least one inherent \
-                        method; giving up looking now"};
+                debug!("(checking method) found at least one inherent \
+                        method; giving up looking now");
                 break;
             }
 
@@ -205,8 +205,8 @@ fn method() -> option<method_map_entry> {
 
             // if we found anything, stop before attempting auto-deref.
             if self.candidates.len() > 0u {
-                debug!{"(checking method) found at least one inherent \
-                        method; giving up looking now"};
+                debug!("(checking method) found at least one inherent \
+                        method; giving up looking now");
                 break;
             }
 
@@ -221,8 +221,8 @@ fn method() -> option<method_map_entry> {
         }
 
         if self.candidates.len() == 0u {
-            debug!{"(checking method) couldn't find any candidate methods; \
-                    returning none"};
+            debug!("(checking method) couldn't find any candidate methods; \
+                    returning none");
             return none;
         }
 
@@ -261,30 +261,30 @@ fn report_static_candidate(idx: uint, did: ast::def_id) {
         };
         self.tcx().sess.span_note(
             span,
-            fmt!{"candidate #%u is `%s`",
+            fmt!("candidate #%u is `%s`",
                  (idx+1u),
-                 ty::item_path_str(self.tcx(), did)});
+                 ty::item_path_str(self.tcx(), did)));
     }
 
     fn report_param_candidate(idx: uint, did: ast::def_id) {
         self.tcx().sess.span_note(
             self.expr.span,
-            fmt!{"candidate #%u derives from the bound `%s`",
+            fmt!("candidate #%u derives from the bound `%s`",
                  (idx+1u),
-                 ty::item_path_str(self.tcx(), did)});
+                 ty::item_path_str(self.tcx(), did)));
     }
 
     fn report_trait_candidate(idx: uint, did: ast::def_id) {
         self.tcx().sess.span_note(
             self.expr.span,
-            fmt!{"candidate #%u derives from the type of the receiver, \
+            fmt!("candidate #%u derives from the type of the receiver, \
                   which is the trait `%s`",
                  (idx+1u),
-                 ty::item_path_str(self.tcx(), did)});
+                 ty::item_path_str(self.tcx(), did)));
     }
 
     fn add_candidates_from_param(n: uint, did: ast::def_id) {
-        debug!{"add_candidates_from_param"};
+        debug!("add_candidates_from_param");
 
         let tcx = self.tcx();
         let mut trait_bnd_idx = 0u; // count only trait bounds
@@ -334,7 +334,7 @@ fn add_candidates_from_param(n: uint, did: ast::def_id) {
 
     fn add_candidates_from_trait(did: ast::def_id, trait_substs: ty::substs) {
 
-        debug!{"add_candidates_from_trait"};
+        debug!("add_candidates_from_trait");
 
         let ms = *ty::trait_methods(self.tcx(), did);
         for ms.eachi |i, m| {
@@ -369,7 +369,7 @@ fn add_candidates_from_trait(did: ast::def_id, trait_substs: ty::substs) {
 
     fn add_candidates_from_class(did: ast::def_id, class_substs: ty::substs) {
 
-        debug!{"add_candidates_from_class"};
+        debug!("add_candidates_from_class");
 
         let ms = *ty::trait_methods(self.tcx(), did);
 
@@ -469,7 +469,7 @@ fn add_candidates_from_impl(im: @resolve3::Impl, mode: method_lookup_mode)
                     matches = self.fcx.can_mk_subty(ref_ty, impl_ty);
                 }
             }
-            debug!{"matches = %?", matches};
+            debug!("matches = %?", matches);
             match matches {
               result::err(_) => { /* keep looking */ }
               result::ok(_) => {
@@ -528,15 +528,15 @@ fn add_inherent_and_extension_candidates(optional_inherent_methods:
             // Continue.
           }
           some(inherent_methods) => {
-            debug!{"(adding inherent and extension candidates) adding \
-                    inherent candidates"};
+            debug!("(adding inherent and extension candidates) adding \
+                    inherent candidates");
             for inherent_methods.each |implementation| {
-                debug!{"(adding inherent and extension candidates) \
+                debug!("(adding inherent and extension candidates) \
                         adding candidates from impl: %s",
                         node_id_to_str(self.tcx().items,
                                        implementation.did.node,
                                        self.fcx.tcx().sess.parse_sess
-                                           .interner)};
+                                           .interner));
                 self.add_candidates_from_impl(implementation, mode);
             }
           }
@@ -549,9 +549,9 @@ fn add_inherent_and_extension_candidates(optional_inherent_methods:
           }
           some(trait_ids) => {
             for (*trait_ids).each |trait_id| {
-                debug!{"(adding inherent and extension candidates) \
+                debug!("(adding inherent and extension candidates) \
                         trying trait: %s",
-                        self.def_id_to_str(trait_id)};
+                        self.def_id_to_str(trait_id));
 
                 let coherence_info = self.fcx.ccx.coherence_info;
                 match coherence_info.extension_methods.find(trait_id) {
@@ -560,10 +560,10 @@ fn add_inherent_and_extension_candidates(optional_inherent_methods:
                   }
                   some(extension_methods) => {
                     for extension_methods.each |implementation| {
-                        debug!{"(adding inherent and extension \
+                        debug!("(adding inherent and extension \
                                 candidates) adding impl %s",
                                 self.def_id_to_str
-                                (implementation.did)};
+                                (implementation.did));
                         self.add_candidates_from_impl(implementation, mode);
                     }
                   }
@@ -586,10 +586,10 @@ fn def_id_to_str(def_id: ast::def_id) -> ~str {
     fn write_mty_from_candidate(cand: candidate) -> method_map_entry {
         let tcx = self.fcx.ccx.tcx;
 
-        debug!{"write_mty_from_candidate(n_tps_m=%u, fty=%s, entry=%?)",
+        debug!("write_mty_from_candidate(n_tps_m=%u, fty=%s, entry=%?)",
                cand.n_tps_m,
                self.fcx.infcx.ty_to_str(cand.fty),
-               cand.entry};
+               cand.entry);
 
         match cand.mode {
             subtyping_mode | assignability_mode => {
@@ -602,9 +602,9 @@ fn write_mty_from_candidate(cand: candidate) -> method_map_entry {
                   result::err(_) => {
                     self.tcx().sess.span_bug(
                         self.expr.span,
-                        fmt!{"%s was assignable to %s but now is not?",
+                        fmt!("%s was assignable to %s but now is not?",
                              self.fcx.infcx.ty_to_str(cand.self_ty),
-                             self.fcx.infcx.ty_to_str(cand.rcvr_ty)});
+                             self.fcx.infcx.ty_to_str(cand.rcvr_ty)));
                   }
                 }
             }
index 87701a01bdf4aed66f1bafe02d9848beee35bab0..fc8997407d8727b1eead3a7e84362b0ee91e11eb 100644 (file)
@@ -156,8 +156,8 @@ fn visit_block(b: ast::blk, &&rcx: @rcx, v: rvt) {
 }
 
 fn visit_expr(e: @ast::expr, &&rcx: @rcx, v: rvt) {
-    debug!{"visit_expr(e=%s)",
-           pprust::expr_to_str(e, rcx.fcx.tcx().sess.intr())};
+    debug!("visit_expr(e=%s)",
+           pprust::expr_to_str(e, rcx.fcx.tcx().sess.intr()));
 
     match e.node {
       ast::expr_path(*) => {
@@ -257,8 +257,8 @@ fn visit_node(id: ast::node_id, span: span, rcx: @rcx) -> bool {
     let tcx = fcx.ccx.tcx;
     let encl_region = ty::encl_region(tcx, id);
 
-    debug!{"visit_node(ty=%s, id=%d, encl_region=%?)",
-           ty_to_str(tcx, ty), id, encl_region};
+    debug!("visit_node(ty=%s, id=%d, encl_region=%?)",
+           ty_to_str(tcx, ty), id, encl_region);
 
     // Otherwise, look at the type and see if it is a region pointer.
     return constrain_regions_in_type(rcx, encl_region, span, ty);
@@ -316,8 +316,8 @@ fn constrain_region(rcx: @rcx,
                         region: ty::region) {
         let tcx = rcx.fcx.ccx.tcx;
 
-        debug!{"constrain_region(encl_region=%?, region=%?)",
-               encl_region, region};
+        debug!("constrain_region(encl_region=%?, region=%?)",
+               encl_region, region);
 
         match region {
           ty::re_bound(_) => {
index 7eb88a397dfb5f771fb29185d25b558edcfc5bdd..b879e4b8fed54c747db91709886683e2bdea5a8a 100644 (file)
@@ -35,15 +35,15 @@ fn replace_bound_regions_in_fn_ty(
 
     for self_ty.each |t| { vec::push(all_tys, t) }
 
-    debug!{"replace_bound_regions_in_fn_ty(self_info.self_ty=%?, fn_ty=%s, \
+    debug!("replace_bound_regions_in_fn_ty(self_info.self_ty=%?, fn_ty=%s, \
                 all_tys=%?)",
            self_ty.map(|t| ty_to_str(tcx, t)),
            ty_to_str(tcx, ty::mk_fn(tcx, *fn_ty)),
-           all_tys.map(|t| ty_to_str(tcx, t))};
+           all_tys.map(|t| ty_to_str(tcx, t)));
     let _i = indenter();
 
     let isr = do create_bound_region_mapping(tcx, isr, all_tys) |br| {
-        debug!{"br=%?", br};
+        debug!("br=%?", br);
         mapf(br)
     };
     let ty_fn = ty::ty_fn(*fn_ty);
@@ -52,10 +52,10 @@ fn replace_bound_regions_in_fn_ty(
     });
     let t_self = self_ty.map(|t| replace_bound_regions(tcx, isr, t));
 
-    debug!{"result of replace_bound_regions_in_fn_ty: self_info.self_ty=%?, \
+    debug!("result of replace_bound_regions_in_fn_ty: self_info.self_ty=%?, \
                 fn_ty=%s",
            t_self.map(|t| ty_to_str(tcx, t)),
-           ty_to_str(tcx, t_fn)};
+           ty_to_str(tcx, t_fn));
 
 
     // Glue updated self_ty back together with its original def_id.
@@ -161,9 +161,9 @@ fn replace_bound_regions(
                   none if in_fn => r,
                   none => {
                     tcx.sess.bug(
-                        fmt!{"Bound region not found in \
+                        fmt!("Bound region not found in \
                               in_scope_regions list: %s",
-                             region_to_str(tcx, r)});
+                             region_to_str(tcx, r)));
                   }
                 }
               }
index d6c8d1cd2f70ae3e9caf88ee7f08a0d0586ccdbb..930bb3480b943f7282414e0dbb696817d8e3b4a1 100644 (file)
@@ -83,8 +83,8 @@ fn lookup_vtable(fcx: @fn_ctxt,
     -> vtable_origin
 {
 
-    debug!{"lookup_vtable(ty=%s, trait_ty=%s)",
-           fcx.infcx.ty_to_str(ty), fcx.infcx.ty_to_str(trait_ty)};
+    debug!("lookup_vtable(ty=%s, trait_ty=%s)",
+           fcx.infcx.ty_to_str(ty), fcx.infcx.ty_to_str(trait_ty));
     let _i = indenter();
 
     let tcx = fcx.ccx.tcx;
@@ -116,8 +116,8 @@ fn lookup_vtable(fcx: @fn_ctxt,
                 match check ty::get(ity).struct {
                   ty::ty_trait(idid, substs, _) => {
                     if trait_id == idid {
-                        debug!{"(checking vtable) @0 relating ty to trait ty
-                                with did %?", idid};
+                        debug!("(checking vtable) @0 relating ty to trait ty
+                                with did %?", idid);
                         relate_trait_tys(fcx, expr, trait_ty, ity);
                         return vtable_param(n, n_bound);
                     }
@@ -130,8 +130,8 @@ fn lookup_vtable(fcx: @fn_ctxt,
       }
 
       ty::ty_trait(did, substs, _) if trait_id == did => {
-        debug!{"(checking vtable) @1 relating ty to trait ty with did %?",
-               did};
+        debug!("(checking vtable) @1 relating ty to trait ty with did %?",
+               did);
 
         relate_trait_tys(fcx, expr, trait_ty, ty);
         if !allow_unsafe && !is_early {
@@ -258,9 +258,9 @@ fn fixup_ty(fcx: @fn_ctxt,
       result::err(e) if !is_early => {
         tcx.sess.span_fatal(
             expr.span,
-            fmt!{"cannot determine a type \
+            fmt!("cannot determine a type \
                   for this bounded type parameter: %s",
-                 fixup_err_to_str(e)})
+                 fixup_err_to_str(e)))
       }
       result::err(e) => {
         none
@@ -275,8 +275,8 @@ fn connect_trait_tps(fcx: @fn_ctxt, expr: @ast::expr, impl_tys: ~[ty::t],
     // XXX: This should work for multiple traits.
     let ity = ty::impl_traits(tcx, impl_did)[0];
     let trait_ty = ty::subst_tps(tcx, impl_tys, ity);
-    debug!{"(connect trait tps) trait type is %?, impl did is %?",
-           ty::get(trait_ty).struct, impl_did};
+    debug!("(connect trait tps) trait type is %?, impl did is %?",
+           ty::get(trait_ty).struct, impl_did);
     match check ty::get(trait_ty).struct {
       ty::ty_trait(_, substs, _) => {
         vec::iter2(substs.tps, trait_tys,
index 15251098b1f2f0196029550278d3bfd4b13fb03d..3201ffc7459f14938753947d0c2f248afdec92e8 100644 (file)
@@ -16,9 +16,9 @@ fn resolve_type_vars_in_type(fcx: @fn_ctxt, sp: span, typ: ty::t) ->
         if !fcx.ccx.tcx.sess.has_errors() {
             fcx.ccx.tcx.sess.span_err(
                 sp,
-                fmt!{"cannot determine a type \
+                fmt!("cannot determine a type \
                       for this expression: %s",
-                     infer::fixup_err_to_str(e)})
+                     infer::fixup_err_to_str(e)))
         }
         return none;
       }
@@ -35,8 +35,8 @@ fn resolve_type_vars_for_node(wbcx: wb_ctxt, sp: span, id: ast::node_id)
       }
 
       some(t) => {
-        debug!{"resolve_type_vars_for_node(id=%d, n_ty=%s, t=%s)",
-               id, ty_to_str(tcx, n_ty), ty_to_str(tcx, t)};
+        debug!("resolve_type_vars_for_node(id=%d, n_ty=%s, t=%s)",
+               id, ty_to_str(tcx, n_ty), ty_to_str(tcx, t));
         write_ty_to_tcx(tcx, id, t);
         match fcx.opt_node_ty_substs(id) {
           some(substs) => {
@@ -116,11 +116,11 @@ fn visit_block(b: ast::blk, wbcx: wb_ctxt, v: wb_vt) {
 fn visit_pat(p: @ast::pat, wbcx: wb_ctxt, v: wb_vt) {
     if !wbcx.success { return; }
     resolve_type_vars_for_node(wbcx, p.span, p.id);
-    debug!{"Type for pattern binding %s (id %d) resolved to %s",
+    debug!("Type for pattern binding %s (id %d) resolved to %s",
            pat_to_str(p, wbcx.fcx.ccx.tcx.sess.intr()), p.id,
            wbcx.fcx.infcx.ty_to_str(
                ty::node_id_to_type(wbcx.fcx.ccx.tcx,
-                                   p.id))};
+                                   p.id)));
     visit::visit_pat(p, wbcx, v);
 }
 fn visit_local(l: @ast::local, wbcx: wb_ctxt, v: wb_vt) {
@@ -129,17 +129,17 @@ fn visit_local(l: @ast::local, wbcx: wb_ctxt, v: wb_vt) {
     let var_ty = ty::mk_var(wbcx.fcx.tcx(), var_id);
     match resolve_type(wbcx.fcx.infcx, var_ty, resolve_all | force_all) {
       result::ok(lty) => {
-        debug!{"Type for local %s (id %d) resolved to %s",
+        debug!("Type for local %s (id %d) resolved to %s",
                pat_to_str(l.node.pat, wbcx.fcx.ccx.tcx.sess.intr()),l.node.id,
-               wbcx.fcx.infcx.ty_to_str(lty)};
+               wbcx.fcx.infcx.ty_to_str(lty));
         write_ty_to_tcx(wbcx.fcx.ccx.tcx, l.node.id, lty);
       }
       result::err(e) => {
         wbcx.fcx.ccx.tcx.sess.span_err(
             l.span,
-            fmt!{"cannot determine a type \
+            fmt!("cannot determine a type \
                   for this local variable: %s",
-                 infer::fixup_err_to_str(e)});
+                 infer::fixup_err_to_str(e)));
         wbcx.success = false;
       }
     }
index 5691af2b91a94d0999e4c25d7ac55a7e96a8181c..6254d244fc7950cb061c52db37b57ce91cb94b9d 100644 (file)
@@ -60,13 +60,13 @@ fn get_base_type(inference_context: infer_ctxt, span: span, original_type: t)
         ty_uniq(base_mutability_and_type) |
         ty_ptr(base_mutability_and_type) |
         ty_rptr(_, base_mutability_and_type) => {
-            debug!{"(getting base type) recurring"};
+            debug!("(getting base type) recurring");
             get_base_type(inference_context, span,
                           base_mutability_and_type.ty)
         }
 
         ty_enum(*) | ty_trait(*) | ty_class(*) => {
-            debug!{"(getting base type) found base type"};
+            debug!("(getting base type) found base type");
             some(resolved_type)
         }
 
@@ -75,8 +75,8 @@ fn get_base_type(inference_context: infer_ctxt, span: span, original_type: t)
         ty_fn(*) | ty_tup(*) | ty_var(*) | ty_var_integral(*) |
         ty_param(*) | ty_self | ty_type | ty_opaque_box |
         ty_opaque_closure_ptr(*) | ty_unboxed_vec(*) => {
-            debug!{"(getting base type) no base type; found %?",
-                   get(original_type).struct};
+            debug!("(getting base type) no base type; found %?",
+                   get(original_type).struct);
             none
         }
     }
@@ -173,9 +173,9 @@ fn build_provided_methods_map(crate: @crate) {
                 match item.node {
                   item_trait(_, _, trait_methods) => {
                     for trait_methods.each |trait_method| {
-                        debug!{"(building provided methods map) checking \
+                        debug!("(building provided methods map) checking \
                                 trait `%s` with id %d",
-                                sess.str_of(item.ident), item.id};
+                                sess.str_of(item.ident), item.id);
 
                         match trait_method {
                             required(_) => { /* fall through */}
@@ -191,11 +191,11 @@ trait `%s` with id %d",
                                       // provided_methods_map, we just
                                       // need to add this method to
                                       // that entry.
-                                      debug!{"(building provided \
+                                      debug!("(building provided \
                                               methods map) adding \
                                               method `%s` to entry for \
                                               existing trait",
-                                              sess.str_of(mi.ident)};
+                                              sess.str_of(mi.ident));
                                       let mut method_infos = mis;
                                       push(method_infos, mi);
                                       pmm.insert(item.id, method_infos);
@@ -203,10 +203,10 @@ trait `%s` with id %d",
                                     none => {
                                       // If the trait doesn't have an
                                       // entry yet, create one.
-                                      debug!{"(building provided \
+                                      debug!("(building provided \
                                               methods map) creating new \
                                               entry for method `%s`",
-                                              sess.str_of(mi.ident)};
+                                              sess.str_of(mi.ident));
                                       pmm.insert(item.id, ~[mi]);
                                     }
                                 }
@@ -229,8 +229,8 @@ fn check_coherence(crate: @crate) {
         // inherent methods and extension methods.
         visit_crate(*crate, (), mk_simple_visitor(@{
             visit_item: |item| {
-                debug!{"(checking coherence) item '%s'",
-                       self.crate_context.tcx.sess.str_of(item.ident)};
+                debug!("(checking coherence) item '%s'",
+                       self.crate_context.tcx.sess.str_of(item.ident));
 
                 match item.node {
                     item_impl(_, associated_traits, _, _) => {
@@ -270,9 +270,9 @@ fn check_implementation(item: @item, associated_traits: ~[@trait_ref]) {
         // base type.
 
         if associated_traits.len() == 0 {
-            debug!{"(checking implementation) no associated traits for item \
+            debug!("(checking implementation) no associated traits for item \
                     '%s'",
-                   self.crate_context.tcx.sess.str_of(item.ident)};
+                   self.crate_context.tcx.sess.str_of(item.ident));
 
             match get_base_type_def_id(self.inference_context,
                                        item.span,
@@ -293,12 +293,12 @@ fn check_implementation(item: @item, associated_traits: ~[@trait_ref]) {
         for associated_traits.each |associated_trait| {
             let trait_did =
                 self.trait_ref_to_trait_def_id(associated_trait);
-            debug!{"(checking implementation) adding impl for trait \
+            debug!("(checking implementation) adding impl for trait \
                     '%s', item '%s'",
                     ast_map::node_id_to_str(
                         self.crate_context.tcx.items, trait_did.node,
                         self.crate_context.tcx.sess.parse_sess.interner),
-                    self.crate_context.tcx.sess.str_of(item.ident)};
+                    self.crate_context.tcx.sess.str_of(item.ident));
 
             let implementation = self.create_impl_from_item(item);
             self.add_trait_method(trait_did, implementation);
@@ -442,10 +442,10 @@ fn check_privileged_scopes(crate: @crate) {
                         let privileged_types =
                             self.gather_privileged_types(module_.items);
                         for privileged_types.each |privileged_type| {
-                            debug!{"(checking privileged scopes) entering \
+                            debug!("(checking privileged scopes) entering \
                                     privileged scope of %d:%d",
                                    privileged_type.crate,
-                                   privileged_type.node};
+                                   privileged_type.node);
 
                             self.privileged_types.insert(privileged_type, ());
                         }
@@ -586,9 +586,9 @@ fn add_provided_methods(inherent_methods: ~[@MethodInfo],
                 }
 
                 if !method_inherent_to_impl {
-                    debug!{
+                    debug!(
                         "(creating impl) adding provided method `%s` to impl",
-                        sess.str_of(provided_method.ident)};
+                        sess.str_of(provided_method.ident));
                     push(methods, provided_method);
                 }
             }
@@ -616,14 +616,14 @@ fn add_provided_methods(inherent_methods: ~[@MethodInfo],
                     match self.crate_context.provided_methods_map
                         .find(trait_did.node) {
                         none => {
-                            debug!{"(creating impl) trait with node_id `%d` \
-                                    has no provided methods", trait_did.node};
+                            debug!("(creating impl) trait with node_id `%d` \
+                                    has no provided methods", trait_did.node);
                             /* fall through */
                         }
                         some(all_provided)
                                     => {
-                            debug!{"(creating impl) trait with node_id `%d` \
-                                    has provided methods", trait_did.node};
+                            debug!("(creating impl) trait with node_id `%d` \
+                                    has provided methods", trait_did.node);
                             // Selectively add only those provided
                             // methods that aren't inherent to the
                             // trait.
@@ -722,11 +722,11 @@ fn add_impls_for_module(impls_seen: hashmap<def_id,()>,
                                            self_type.ty) {
                     none => {
                         let session = self.crate_context.tcx.sess;
-                        session.bug(fmt!{
+                        session.bug(fmt!(
                             "no base type for external impl \
                              with no trait: %s (type %s)!",
                              session.str_of(implementation.ident),
-                             ty_to_str(self.crate_context.tcx,self_type.ty)});
+                             ty_to_str(self.crate_context.tcx,self_type.ty)));
                     }
                     some(_) => {
                         // Nothing to do.
index 85b1ebc58de2371520f99c699e64794399c828f4..132ec2a4e9052eae6ae83182f749dd9df8058d7d 100644 (file)
@@ -95,8 +95,8 @@ fn get_item_ty(id: ast::def_id) -> ty::ty_param_bounds_and_ty {
                 ty_of_foreign_item(self, foreign_item)
               }
               x => {
-                self.tcx.sess.bug(fmt!{"unexpected sort of item \
-                                        in get_item_ty(): %?", x});
+                self.tcx.sess.bug(fmt!("unexpected sort of item \
+                                        in get_item_ty(): %?", x));
               }
             }
         }
@@ -249,17 +249,17 @@ fn compare_impl_method(tcx: ty::ctxt, sp: span,
 
     if impl_m.purity != trait_m.purity {
         tcx.sess.span_err(
-            sp, fmt!{"method `%s`'s purity does \
+            sp, fmt!("method `%s`'s purity does \
                           not match the trait method's \
-                          purity", tcx.sess.str_of(impl_m.ident)});
+                          purity", tcx.sess.str_of(impl_m.ident)));
     }
 
     // is this check right?
     if impl_m.self_ty != trait_m.self_ty {
         tcx.sess.span_err(
-            sp, fmt!{"method `%s`'s self type does \
+            sp, fmt!("method `%s`'s self type does \
                           not match the trait method's \
-                          self type", tcx.sess.str_of(impl_m.ident)});
+                          self type", tcx.sess.str_of(impl_m.ident)));
     }
 
     if impl_m.tps != trait_m.tps {
@@ -269,11 +269,11 @@ fn compare_impl_method(tcx: ty::ctxt, sp: span,
     }
 
     if vec::len(impl_m.fty.inputs) != vec::len(trait_m.fty.inputs) {
-        tcx.sess.span_err(sp,fmt!{"method `%s` has %u parameters \
+        tcx.sess.span_err(sp,fmt!("method `%s` has %u parameters \
                                    but the trait has %u",
                                    tcx.sess.str_of(trait_m.ident),
                                    vec::len(impl_m.fty.inputs),
-                                   vec::len(trait_m.fty.inputs)});
+                                   vec::len(trait_m.fty.inputs)));
         return;
     }
 
@@ -357,8 +357,8 @@ fn check_methods_against_trait(ccx: @crate_ctxt,
                     none => {
                       tcx.sess.span_err(
                           a_trait_ty.path.span,
-                          fmt!{"missing method `%s`",
-                               tcx.sess.str_of(trait_m.ident)});
+                          fmt!("missing method `%s`",
+                               tcx.sess.str_of(trait_m.ident)));
                     }
                   }
                 }
@@ -413,8 +413,8 @@ fn convert_methods(ccx: @crate_ctxt,
 fn convert(ccx: @crate_ctxt, it: @ast::item) {
     let tcx = ccx.tcx;
     let rp = tcx.region_paramd_items.find(it.id);
-    #debug["convert: item %s with id %d rp %?",
-           tcx.sess.str_of(it.ident), it.id, rp];
+    debug!("convert: item %s with id %d rp %?",
+           tcx.sess.str_of(it.ident), it.id, rp);
     match it.node {
       // These don't define types.
       ast::item_foreign_mod(_) | ast::item_mod(_) => {}
@@ -440,8 +440,8 @@ fn convert(ccx: @crate_ctxt, it: @ast::item) {
       }
       ast::item_trait(tps, _, trait_methods) => {
         let tpt = ty_of_item(ccx, it);
-        debug!{"item_trait(it.id=%d, tpt.ty=%s)",
-               it.id, ty_to_str(tcx, tpt.ty)};
+        debug!("item_trait(it.id=%d, tpt.ty=%s)",
+               it.id, ty_to_str(tcx, tpt.ty));
         write_ty_to_tcx(tcx, it.id, tpt.ty);
         ensure_trait_methods(ccx, it.id, tpt.ty);
 
@@ -621,8 +621,8 @@ fn ty_of_item(ccx: @crate_ctxt, it: @ast::item)
         let tpt = {bounds: bounds,
                    region_param: none,
                    ty: ty::mk_fn(ccx.tcx, tofd)};
-        debug!{"type of %s (id %d) is %s",
-               tcx.sess.str_of(it.ident), it.id, ty_to_str(tcx, tpt.ty)};
+        debug!("type of %s (id %d) is %s",
+               tcx.sess.str_of(it.ident), it.id, ty_to_str(tcx, tpt.ty));
         ccx.tcx.tcache.insert(local_def(it.id), tpt);
         return tpt;
       }
index 3620a728d6bd4e27b32536cfc9b28e5df7166cdb..dd5f8bd0db77143a684594deaf0a0f853f2c7e09 100644 (file)
@@ -352,8 +352,8 @@ fn fixup_err_to_str(f: fixup_err) -> ~str {
       cyclic_ty(_) => ~"cyclic type of infinite size",
       unresolved_region(_) => ~"unconstrained region",
       region_var_bound_by_region_var(r1, r2) => {
-        fmt!{"region var %? bound by another region var %?; this is \
-              a bug in rustc", r1, r2}
+        fmt!("region var %? bound by another region var %?; this is \
+              a bug in rustc", r1, r2)
       }
     }
 }
@@ -384,7 +384,7 @@ fn mk_sub(cx: infer_ctxt, a_is_expected: bool, span: span) -> Sub {
 
 fn mk_subty(cx: infer_ctxt, a_is_expected: bool, span: span,
             a: ty::t, b: ty::t) -> ures {
-    debug!{"mk_subty(%s <: %s)", a.to_str(cx), b.to_str(cx)};
+    debug!("mk_subty(%s <: %s)", a.to_str(cx), b.to_str(cx));
     do indent {
         do cx.commit {
             mk_sub(cx, a_is_expected, span).tys(a, b)
@@ -393,7 +393,7 @@ fn mk_subty(cx: infer_ctxt, a_is_expected: bool, span: span,
 }
 
 fn can_mk_subty(cx: infer_ctxt, a: ty::t, b: ty::t) -> ures {
-    debug!{"can_mk_subty(%s <: %s)", a.to_str(cx), b.to_str(cx)};
+    debug!("can_mk_subty(%s <: %s)", a.to_str(cx), b.to_str(cx));
     do indent {
         do cx.probe {
             mk_sub(cx, true, ast_util::dummy_sp()).tys(a, b)
@@ -403,7 +403,7 @@ fn can_mk_subty(cx: infer_ctxt, a: ty::t, b: ty::t) -> ures {
 
 fn mk_subr(cx: infer_ctxt, a_is_expected: bool, span: span,
            a: ty::region, b: ty::region) -> ures {
-    debug!{"mk_subr(%s <: %s)", a.to_str(cx), b.to_str(cx)};
+    debug!("mk_subr(%s <: %s)", a.to_str(cx), b.to_str(cx));
     do indent {
         do cx.commit {
             mk_sub(cx, a_is_expected, span).regions(a, b)
@@ -413,7 +413,7 @@ fn mk_subr(cx: infer_ctxt, a_is_expected: bool, span: span,
 
 fn mk_eqty(cx: infer_ctxt, a_is_expected: bool, span: span,
            a: ty::t, b: ty::t) -> ures {
-    debug!{"mk_eqty(%s <: %s)", a.to_str(cx), b.to_str(cx)};
+    debug!("mk_eqty(%s <: %s)", a.to_str(cx), b.to_str(cx));
     do indent {
         do cx.commit {
             let suber = mk_sub(cx, a_is_expected, span);
@@ -424,8 +424,8 @@ fn mk_eqty(cx: infer_ctxt, a_is_expected: bool, span: span,
 
 fn mk_assignty(cx: infer_ctxt, anmnt: &assignment,
                a: ty::t, b: ty::t) -> ures {
-    debug!{"mk_assignty(%? / %s <: %s)",
-           anmnt, a.to_str(cx), b.to_str(cx)};
+    debug!("mk_assignty(%? / %s <: %s)",
+           anmnt, a.to_str(cx), b.to_str(cx));
     do indent {
         do cx.commit {
             cx.assign_tys(anmnt, a, b)
@@ -435,8 +435,8 @@ fn mk_assignty(cx: infer_ctxt, anmnt: &assignment,
 
 fn can_mk_assignty(cx: infer_ctxt, anmnt: &assignment,
                 a: ty::t, b: ty::t) -> ures {
-    debug!{"can_mk_assignty(%? / %s <: %s)",
-           anmnt, a.to_str(cx), b.to_str(cx)};
+    debug!("can_mk_assignty(%? / %s <: %s)",
+           anmnt, a.to_str(cx), b.to_str(cx));
 
     // FIXME(#2593)---this will not unroll any entries we make in the
     // borrowings table.  But this is OK for the moment because this
@@ -464,8 +464,8 @@ fn resolve_borrowings(cx: infer_ctxt) {
     for cx.borrowings.each |item| {
         match resolve_region(cx, item.scope, resolve_all|force_all) {
           ok(region) => {
-            debug!{"borrowing for expr %d resolved to region %?, mutbl %?",
-                   item.expr_id, region, item.mutbl};
+            debug!("borrowing for expr %d resolved to region %?, mutbl %?",
+                   item.expr_id, region, item.mutbl);
             cx.tcx.borrowings.insert(
                 item.expr_id, {region: region, mutbl: item.mutbl});
           }
@@ -474,7 +474,7 @@ fn resolve_borrowings(cx: infer_ctxt) {
             let str = fixup_err_to_str(e);
             cx.tcx.sess.span_err(
                 item.span,
-                fmt!{"could not resolve lifetime for borrow: %s", str});
+                fmt!("could not resolve lifetime for borrow: %s", str));
           }
         }
     }
@@ -573,7 +573,7 @@ fn rollback_to(snapshot: &Snapshot) {
     fn commit<T,E>(f: fn() -> result<T,E>) -> result<T,E> {
         assert !self.in_snapshot();
 
-        debug!{"commit()"};
+        debug!("commit()");
         do indent {
             let r <- self.try(f);
 
@@ -589,7 +589,7 @@ fn commit<T,E>(f: fn() -> result<T,E>) -> result<T,E> {
 
     /// Execute `f`, unroll bindings on failure
     fn try<T,E>(f: fn() -> result<T,E>) -> result<T,E> {
-        debug!{"try()"};
+        debug!("try()");
         do indent {
             let snapshot = self.start_snapshot();
             let r = f();
@@ -603,7 +603,7 @@ fn try<T,E>(f: fn() -> result<T,E>) -> result<T,E> {
 
     /// Execute `f` then unroll any bindings it creates
     fn probe<T,E>(f: fn() -> result<T,E>) -> result<T,E> {
-        debug!{"probe()"};
+        debug!("probe()");
         do indent {
             let snapshot = self.start_snapshot();
             let r = self.try(f);
index 47ee2d823c917d9ab0b26f6f71357b9f532896a6..105c466d98b19c743e0a801518ad623518c2cbc3 100644 (file)
@@ -63,8 +63,8 @@ fn select(fst: option<ty::t>, snd: option<ty::t>) -> option<ty::t> {
             }
         }
 
-        debug!{"assign_tys(anmnt=%?, %s -> %s)",
-               anmnt, a.to_str(self), b.to_str(self)};
+        debug!("assign_tys(anmnt=%?, %s -> %s)",
+               anmnt, a.to_str(self), b.to_str(self));
         let _r = indenter();
 
         match (ty::get(a).struct, ty::get(b).struct) {
@@ -110,9 +110,9 @@ fn assign_tys_or_sub(
         a: ty::t, b: ty::t,
         +a_bnd: option<ty::t>, +b_bnd: option<ty::t>) -> ures {
 
-        debug!{"assign_tys_or_sub(anmnt=%?, %s -> %s, %s -> %s)",
+        debug!("assign_tys_or_sub(anmnt=%?, %s -> %s, %s -> %s)",
                anmnt, a.to_str(self), b.to_str(self),
-               a_bnd.to_str(self), b_bnd.to_str(self)};
+               a_bnd.to_str(self), b_bnd.to_str(self));
         let _r = indenter();
 
         fn is_borrowable(v: ty::vstore) -> bool {
@@ -167,9 +167,9 @@ fn crosspollinate(anmnt: &assignment,
                       m: ast::mutability,
                       r_b: ty::region) -> ures {
 
-        debug!{"crosspollinate(anmnt=%?, a=%s, nr_b=%s, r_b=%s)",
+        debug!("crosspollinate(anmnt=%?, a=%s, nr_b=%s, r_b=%s)",
                anmnt, a.to_str(self), nr_b.to_str(self),
-               r_b.to_str(self)};
+               r_b.to_str(self));
 
         do indent {
             let sub = mk_sub(self, false, anmnt.span);
@@ -179,12 +179,12 @@ fn crosspollinate(anmnt: &assignment,
                 let r_a = self.next_region_var(anmnt.span,
                                                anmnt.borrow_lb);
 
-                debug!{"anmnt=%?", anmnt};
+                debug!("anmnt=%?", anmnt);
                 do sub.contraregions(r_a, r_b).chain |_r| {
                     // if successful, add an entry indicating that
                     // borrowing occurred
-                    debug!{"borrowing expression #%?, scope=%?, m=%?",
-                           anmnt, r_a, m};
+                    debug!("borrowing expression #%?, scope=%?, m=%?",
+                           anmnt, r_a, m);
                     self.borrowings.push({expr_id: anmnt.expr_id,
                                           span: anmnt.span,
                                           scope: r_a,
index 308818d50f013b6e84a7f4db4f58efc107efc788..2c42e32417b912fbb70380a95c2eb20d83ea2c50 100644 (file)
@@ -99,9 +99,9 @@ fn eq_tys<C: combine>(self: &C, a: ty::t, b: ty::t) -> ures {
 }
 
 fn eq_regions<C: combine>(self: &C, a: ty::region, b: ty::region) -> ures {
-    debug!{"eq_regions(%s, %s)",
+    debug!("eq_regions(%s, %s)",
            a.to_str(self.infcx()),
-           b.to_str(self.infcx())};
+           b.to_str(self.infcx()));
     let sub = self.sub();
     do indent {
         self.infcx().try(|| {
@@ -140,10 +140,10 @@ fn eq_opt_regions<C:combine>(
         // consistently have a region parameter or not have a
         // region parameter.
         self.infcx().tcx.sess.bug(
-            fmt!{"substitution a had opt_region %s and \
+            fmt!("substitution a had opt_region %s and \
                   b had opt_region %s",
                  a.to_str(self.infcx()),
-                 b.to_str(self.infcx())});
+                 b.to_str(self.infcx())));
       }
     }
 }
@@ -346,10 +346,10 @@ fn super_tys<C:combine>(
       (ty::ty_var(_), _) |
       (_, ty::ty_var(_)) => {
         tcx.sess.bug(
-            fmt!{"%s: bot and var types should have been handled (%s,%s)",
+            fmt!("%s: bot and var types should have been handled (%s,%s)",
                  self.tag(),
                  a.to_str(self.infcx()),
-                 b.to_str(self.infcx())});
+                 b.to_str(self.infcx())));
       }
 
       // Relate integral variables to other types
index 966611ab0d9c727b9774ce66dd3f4e8ff94a96b1..f2c14b321c4f81d86621e0552d39bee6d7d3c955 100644 (file)
@@ -16,10 +16,10 @@ fn glb() -> Glb { Glb(*self) }
     fn mts(a: ty::mt, b: ty::mt) -> cres<ty::mt> {
         let tcx = self.infcx.tcx;
 
-        debug!{"%s.mts(%s, %s)",
+        debug!("%s.mts(%s, %s)",
                self.tag(),
                mt_to_str(tcx, a),
-               mt_to_str(tcx, b)};
+               mt_to_str(tcx, b));
 
         match (a.mutbl, b.mutbl) {
           // If one side or both is mut, then the GLB must use
@@ -110,10 +110,10 @@ fn ret_styles(r1: ret_style, r2: ret_style) -> cres<ret_style> {
     }
 
     fn regions(a: ty::region, b: ty::region) -> cres<ty::region> {
-        debug!{"%s.regions(%?, %?)",
+        debug!("%s.regions(%?, %?)",
                self.tag(),
                a.to_str(self.infcx),
-               b.to_str(self.infcx)};
+               b.to_str(self.infcx));
 
         do indent {
             self.infcx.region_vars.glb_regions(self.span, a, b)
index 090014da1d11e0164b6e9fbeafb3d6123a18a120..8cff0b2729dcca4d9d5a6644fe4cc692ccb788f7 100644 (file)
@@ -37,7 +37,7 @@ fn intersection(a: int_ty_set, b: int_ty_set) -> int_ty_set {
 
 fn single_type_contained_in(tcx: ty::ctxt, a: int_ty_set) ->
     option<ty::t> {
-    debug!{"single_type_contained_in(a=%s)", uint::to_str(*a, 10u)};
+    debug!("single_type_contained_in(a=%s)", uint::to_str(*a, 10u));
 
     if *a == INT_TY_SET_i8    { return some(ty::mk_i8(tcx)); }
     if *a == INT_TY_SET_u8    { return some(ty::mk_u8(tcx)); }
index c847191a761d7ab58888de57fc7472fb68a5caef..851b08c0fe7d83b82a7f84d8dcb826070c30c3f6 100644 (file)
@@ -37,9 +37,9 @@ fn ty_bot(_t: ty::t) -> cres<ty::t> {
 fn lattice_tys<L:lattice_ops combine>(
     self: &L, a: ty::t, b: ty::t) -> cres<ty::t> {
 
-    debug!{"%s.lattice_tys(%s, %s)", self.tag(),
+    debug!("%s.lattice_tys(%s, %s)", self.tag(),
            a.to_str(self.infcx()),
-           b.to_str(self.infcx())};
+           b.to_str(self.infcx()));
     if a == b { return ok(a); }
     do indent {
         match (ty::get(a).struct, ty::get(b).struct) {
@@ -84,10 +84,10 @@ fn lattice_vars<L:lattice_ops combine>(
     let a_bounds = nde_a.possible_types;
     let b_bounds = nde_b.possible_types;
 
-    debug!{"%s.lattice_vars(%s=%s <: %s=%s)",
+    debug!("%s.lattice_vars(%s=%s <: %s=%s)",
            self.tag(),
            a_vid.to_str(), a_bounds.to_str(self.infcx()),
-           b_vid.to_str(), b_bounds.to_str(self.infcx())};
+           b_vid.to_str(), b_bounds.to_str(self.infcx()));
 
     if a_vid == b_vid {
         return ok(a_t);
@@ -123,21 +123,21 @@ fn lattice_var_and_t<L:lattice_ops combine>(
     // The comments in this function are written for LUB, but they
     // apply equally well to GLB if you inverse upper/lower/sub/super/etc.
 
-    debug!{"%s.lattice_var_and_t(%s=%s <: %s)",
+    debug!("%s.lattice_var_and_t(%s=%s <: %s)",
            self.tag(),
            a_id.to_str(), a_bounds.to_str(self.infcx()),
-           b.to_str(self.infcx())};
+           b.to_str(self.infcx()));
 
     match self.bnd(a_bounds) {
       some(a_bnd) => {
         // If a has an upper bound, return the LUB(a.ub, b)
-        debug!{"bnd=some(%s)", a_bnd.to_str(self.infcx())};
+        debug!("bnd=some(%s)", a_bnd.to_str(self.infcx()));
         return c_ts(a_bnd, b);
       }
       none => {
         // If a does not have an upper bound, make b the upper bound of a
         // and then return b.
-        debug!{"bnd=none"};
+        debug!("bnd=none");
         let a_bounds = self.with_bnd(a_bounds, b);
         do bnds(self, a_bounds.lb, a_bounds.ub).then {
             self.infcx().set(vb, a_id, root(a_bounds, nde_a.rank));
index d5a6b44aa5c7df2a77aa0600aa26ba07b784f0e9..fd9505737fc22bfea03ab8d231ec5b6fbc7b39f6 100644 (file)
@@ -19,10 +19,10 @@ fn ty_bot(b: ty::t) -> cres<ty::t> { self.bot_ty(b) } // commutative
     fn mts(a: ty::mt, b: ty::mt) -> cres<ty::mt> {
         let tcx = self.infcx.tcx;
 
-        debug!{"%s.mts(%s, %s)",
+        debug!("%s.mts(%s, %s)",
                self.tag(),
                mt_to_str(tcx, a),
-               mt_to_str(tcx, b)};
+               mt_to_str(tcx, b));
 
         let m = if a.mutbl == b.mutbl {
             a.mutbl
@@ -93,10 +93,10 @@ fn contraregions(a: ty::region, b: ty::region) -> cres<ty::region> {
     }
 
     fn regions(a: ty::region, b: ty::region) -> cres<ty::region> {
-        debug!{"%s.regions(%?, %?)",
+        debug!("%s.regions(%?, %?)",
                self.tag(),
                a.to_str(self.infcx),
-               b.to_str(self.infcx)};
+               b.to_str(self.infcx));
 
         do indent {
             self.infcx.region_vars.lub_regions(self.span, a, b)
index 0f7a6f12982d2e327a495c74747e848e563e7ae7..d55a71fc237903be716a4967ae914629bf920ca7 100644 (file)
@@ -77,9 +77,9 @@ fn should(mode: uint) -> bool {
     fn resolve_type_chk(typ: ty::t) -> fres<ty::t> {
         self.err = none;
 
-        debug!{"Resolving %s (modes=%x)",
+        debug!("Resolving %s (modes=%x)",
                ty_to_str(self.infcx.tcx, typ),
-               self.modes};
+               self.modes);
 
         // n.b. This is a hokey mess because the current fold doesn't
         // allow us to pass back errors in any useful way.
@@ -89,9 +89,9 @@ fn resolve_type_chk(typ: ty::t) -> fres<ty::t> {
         assert vec::is_empty(self.v_seen);
         match self.err {
           none => {
-            debug!{"Resolved to %s (modes=%x)",
+            debug!("Resolved to %s (modes=%x)",
                    ty_to_str(self.infcx.tcx, rty),
-                   self.modes};
+                   self.modes);
             return ok(rty);
           }
           some(e) => return err(e)
@@ -108,7 +108,7 @@ fn resolve_region_chk(orig: ty::region) -> fres<ty::region> {
     }
 
     fn resolve_type(typ: ty::t) -> ty::t {
-        debug!{"resolve_type(%s)", typ.to_str(self.infcx)};
+        debug!("resolve_type(%s)", typ.to_str(self.infcx));
         indent(fn&() -> ty::t {
             if !ty::type_needs_infer(typ) { return typ; }
 
@@ -137,7 +137,7 @@ fn resolve_type(typ: ty::t) -> ty::t {
     }
 
     fn resolve_nested_tvar(typ: ty::t) -> ty::t {
-        debug!{"Resolve_if_deep(%s)", typ.to_str(self.infcx)};
+        debug!("Resolve_if_deep(%s)", typ.to_str(self.infcx));
         if !self.should(resolve_nested_tvar) {
             typ
         } else {
@@ -146,7 +146,7 @@ fn resolve_nested_tvar(typ: ty::t) -> ty::t {
     }
 
     fn resolve_region(orig: ty::region) -> ty::region {
-        debug!{"Resolve_region(%s)", orig.to_str(self.infcx)};
+        debug!("Resolve_region(%s)", orig.to_str(self.infcx));
         match orig {
           ty::re_var(rid) => self.resolve_region_var(rid),
           _ => orig
index d2bdc61724ccf64201f5068491b54396190ec584..edcc5e07b0de1249c495603625575be283b4c76b 100644 (file)
@@ -28,10 +28,10 @@ fn contraregions(a: ty::region, b: ty::region) -> cres<ty::region> {
     }
 
     fn regions(a: ty::region, b: ty::region) -> cres<ty::region> {
-        debug!{"%s.regions(%s, %s)",
+        debug!("%s.regions(%s, %s)",
                self.tag(),
                a.to_str(self.infcx),
-               b.to_str(self.infcx)};
+               b.to_str(self.infcx));
         do indent {
             match self.infcx.region_vars.make_subregion(self.span, a, b) {
               ok(()) => ok(a),
@@ -41,7 +41,7 @@ fn regions(a: ty::region, b: ty::region) -> cres<ty::region> {
     }
 
     fn mts(a: ty::mt, b: ty::mt) -> cres<ty::mt> {
-        debug!{"mts(%s <: %s)", a.to_str(self.infcx), b.to_str(self.infcx)};
+        debug!("mts(%s <: %s)", a.to_str(self.infcx), b.to_str(self.infcx));
 
         if a.mutbl != b.mutbl && b.mutbl != m_const {
             return err(ty::terr_mutability);
@@ -97,8 +97,8 @@ fn ret_styles(a: ret_style, b: ret_style) -> cres<ret_style> {
     }
 
     fn tys(a: ty::t, b: ty::t) -> cres<ty::t> {
-        debug!{"%s.tys(%s, %s)", self.tag(),
-               a.to_str(self.infcx), b.to_str(self.infcx)};
+        debug!("%s.tys(%s, %s)", self.tag(),
+               a.to_str(self.infcx), b.to_str(self.infcx));
         if a == b { return ok(a); }
         do indent {
             match (ty::get(a).struct, ty::get(b).struct) {
@@ -143,9 +143,9 @@ fn fns(a: &ty::fn_ty, b: &ty::fn_ty) -> cres<ty::fn_ty> {
                 // NDM--we should not be used dummy_sp() here, but
                 // rather passing in the span or something like that.
                 let rvar = self.infcx.next_region_var_nb(dummy_sp());
-                debug!{"Bound region %s maps to %s",
+                debug!("Bound region %s maps to %s",
                        bound_region_to_str(self.infcx.tcx, br),
-                       region_to_str(self.infcx.tcx, rvar)};
+                       region_to_str(self.infcx.tcx, rvar));
                 rvar
             }
         };
index 28aa0a2cc45869ee2e994548489d16476a117762..9dfd8ae4535d8ac9e8a8ed74312b0726a934a810 100644 (file)
@@ -34,9 +34,9 @@ fn to_str(cx: infer_ctxt) -> ~str {
 
 impl<T:copy to_str> bounds<T>: to_str {
     fn to_str(cx: infer_ctxt) -> ~str {
-        fmt!{"{%s <: %s}",
+        fmt!("{%s <: %s}",
              self.lb.to_str(cx),
-             self.ub.to_str(cx)}
+             self.ub.to_str(cx))
     }
 }
 
@@ -51,9 +51,9 @@ fn to_str(_cx: infer_ctxt) -> ~str {
 impl<V:copy vid, T:copy to_str> var_value<V, T>: to_str {
     fn to_str(cx: infer_ctxt) -> ~str {
         match self {
-          redirect(vid) => fmt!{"redirect(%s)", vid.to_str()},
-          root(pt, rk) => fmt!{"root(%s, %s)", pt.to_str(cx),
-                               uint::to_str(rk, 10u)}
+          redirect(vid) => fmt!("redirect(%s)", vid.to_str()),
+          root(pt, rk) => fmt!("root(%s, %s)", pt.to_str(cx),
+                               uint::to_str(rk, 10u))
         }
     }
 }
index 2dcfa654c0cc317500be5b2d483ea7338d42ad15..d2de394202bb88733e8c3b685969ecb110daa71c 100644 (file)
@@ -25,7 +25,7 @@ fn get<V:copy vid, T:copy>(
         let vid_u = vid.to_uint();
         match vb.vals.find(vid_u) {
           none => {
-            self.tcx.sess.bug(fmt!{"failed lookup of vid `%u`", vid_u});
+            self.tcx.sess.bug(fmt!("failed lookup of vid `%u`", vid_u));
           }
           some(var_val) => {
             match var_val {
@@ -53,8 +53,8 @@ fn set<V:copy vid, T:copy to_str>(
         vec::push(vb.bindings, (vid, old_v));
         vb.vals.insert(vid.to_uint(), new_v);
 
-        debug!{"Updating variable %s from %s to %s",
-               vid.to_str(), old_v.to_str(self), new_v.to_str(self)};
+        debug!("Updating variable %s from %s to %s",
+               vid.to_str(), old_v.to_str(self), new_v.to_str(self));
     }
 }
 
@@ -87,15 +87,15 @@ fn merge_bnds<C: combine>(
 
     let _r = indenter();
     do merge_bnd(self, a.ub, b.ub, glb).chain |ub| {
-        debug!{"glb of ubs %s and %s is %s",
+        debug!("glb of ubs %s and %s is %s",
                a.ub.to_str(self.infcx()),
                b.ub.to_str(self.infcx()),
-               ub.to_str(self.infcx())};
+               ub.to_str(self.infcx()));
         do merge_bnd(self, a.lb, b.lb, lub).chain |lb| {
-            debug!{"lub of lbs %s and %s is %s",
+            debug!("lub of lbs %s and %s is %s",
                    a.lb.to_str(self.infcx()),
                    b.lb.to_str(self.infcx()),
-                   lb.to_str(self.infcx())};
+                   lb.to_str(self.infcx()));
             ok({lb: lb, ub: ub})
         }
     }
@@ -134,10 +134,10 @@ fn set_var_to_merged_bounds<C: combine>(
     //       A     \ / A
     //              B
 
-    debug!{"merge(%s,%s,%s)",
+    debug!("merge(%s,%s,%s)",
            v_id.to_str(),
            a.to_str(self.infcx()),
-           b.to_str(self.infcx())};
+           b.to_str(self.infcx()));
 
     // First, relate the lower/upper bounds of A and B.
     // Note that these relations *must* hold for us to
@@ -153,9 +153,9 @@ fn set_var_to_merged_bounds<C: combine>(
                     do merge_bnd(self, a.lb, b.lb,
                                  |x, y| self.lub().tys(x, y)).chain |lb| {
                         let bounds = {lb: lb, ub: ub};
-                        debug!{"merge(%s): bounds=%s",
+                        debug!("merge(%s): bounds=%s",
                                v_id.to_str(),
-                               bounds.to_str(self.infcx())};
+                               bounds.to_str(self.infcx()));
 
                         // the new bounds must themselves
                         // be relatable:
@@ -186,9 +186,9 @@ fn var_sub_var<C: combine>(self: &C,
     let a_bounds = nde_a.possible_types;
     let b_bounds = nde_b.possible_types;
 
-    debug!{"vars(%s=%s <: %s=%s)",
+    debug!("vars(%s=%s <: %s=%s)",
            a_id.to_str(), a_bounds.to_str(self.infcx()),
-           b_id.to_str(), b_bounds.to_str(self.infcx())};
+           b_id.to_str(), b_bounds.to_str(self.infcx()));
 
     if a_id == b_id { return uok(); }
 
@@ -214,20 +214,20 @@ fn var_sub_var<C: combine>(self: &C,
     // Make the node with greater rank the parent of the node with
     // smaller rank.
     if nde_a.rank > nde_b.rank {
-        debug!{"vars(): a has smaller rank"};
+        debug!("vars(): a has smaller rank");
         // a has greater rank, so a should become b's parent,
         // i.e., b should redirect to a.
         self.infcx().set(vb, b_id, redirect(a_id));
         set_var_to_merged_bounds(
             self, a_id, a_bounds, b_bounds, nde_a.rank)
     } else if nde_a.rank < nde_b.rank {
-        debug!{"vars(): b has smaller rank"};
+        debug!("vars(): b has smaller rank");
         // b has greater rank, so a should redirect to b.
         self.infcx().set(vb, a_id, redirect(b_id));
         set_var_to_merged_bounds(
             self, b_id, a_bounds, b_bounds, nde_b.rank)
     } else {
-        debug!{"vars(): a and b have equal rank"};
+        debug!("vars(): a and b have equal rank");
         assert nde_a.rank == nde_b.rank;
         // If equal, just redirect one to the other and increment
         // the other's rank.  We choose arbitrarily to redirect b
@@ -247,10 +247,10 @@ fn var_sub_t<C: combine>(self: &C, a_id: ty::tv_vid, b: ty::t) -> ures {
     let a_id = nde_a.root;
     let a_bounds = nde_a.possible_types;
 
-    debug!{"var_sub_t(%s=%s <: %s)",
+    debug!("var_sub_t(%s=%s <: %s)",
            a_id.to_str(),
            a_bounds.to_str(self.infcx()),
-           b.to_str(self.infcx())};
+           b.to_str(self.infcx()));
     let b_bounds = {lb: none, ub: some(b)};
     set_var_to_merged_bounds(self, a_id, a_bounds, b_bounds, nde_a.rank)
 }
@@ -264,17 +264,17 @@ fn t_sub_var<C: combine>(self: &C, a: ty::t, b_id: ty::tv_vid) -> ures {
     let b_id = nde_b.root;
     let b_bounds = nde_b.possible_types;
 
-    debug!{"t_sub_var(%s <: %s=%s)",
+    debug!("t_sub_var(%s <: %s=%s)",
            a.to_str(self.infcx()),
            b_id.to_str(),
-           b_bounds.to_str(self.infcx())};
+           b_bounds.to_str(self.infcx()));
     set_var_to_merged_bounds(self, b_id, a_bounds, b_bounds, nde_b.rank)
 }
 
 fn bnds<C: combine>(
     self: &C, a: bound<ty::t>, b: bound<ty::t>) -> ures {
 
-    debug!{"bnds(%s <: %s)", a.to_str(self.infcx()), b.to_str(self.infcx())};
+    debug!("bnds(%s <: %s)", a.to_str(self.infcx()), b.to_str(self.infcx()));
     do indent {
         match (a, b) {
           (none, none) |
@@ -316,18 +316,18 @@ fn vars_integral(a_id: ty::tvi_vid, b_id: ty::tvi_vid) -> ures {
 
         // Rank optimization
         if nde_a.rank > nde_b.rank {
-            debug!{"vars_integral(): a has smaller rank"};
+            debug!("vars_integral(): a has smaller rank");
             // a has greater rank, so a should become b's parent,
             // i.e., b should redirect to a.
             self.set(vb, a_id, root(intersection, nde_a.rank));
             self.set(vb, b_id, redirect(a_id));
         } else if nde_a.rank < nde_b.rank {
-            debug!{"vars_integral(): b has smaller rank"};
+            debug!("vars_integral(): b has smaller rank");
             // b has greater rank, so a should redirect to b.
             self.set(vb, b_id, root(intersection, nde_b.rank));
             self.set(vb, a_id, redirect(b_id));
         } else {
-            debug!{"vars_integral(): a and b have equal rank"};
+            debug!("vars_integral(): a and b have equal rank");
             assert nde_a.rank == nde_b.rank;
             // If equal, just redirect one to the other and increment
             // the other's rank.  We choose arbitrarily to redirect b
index 42b7bc19cc842b71bdc52e4f5f78d3368d6c83df..856a0907b43cb16fcec01b1e733b00818ed956f6 100644 (file)
@@ -8,20 +8,20 @@
 fn indent<R>(op: fn() -> R) -> R {
     // Use in conjunction with the log post-processor like `src/etc/indenter`
     // to make debug output more readable.
-    debug!{">>"};
+    debug!(">>");
     let r <- op();
-    debug!{"<< (Result = %?)", r};
+    debug!("<< (Result = %?)", r);
     return r;
 }
 
 struct _indenter {
     let _i: ();
     new(_i: ()) { self._i = (); }
-    drop { debug!{"<<"}; }
+    drop { debug!("<<"); }
 }
 
 fn indenter() -> _indenter {
-    debug!{">>"};
+    debug!(">>");
     _indenter(())
 }
 
index e22fa9fb173d100cd3f54af6a16c5ff6d1adef58..1634d38577e377ae3cde96cfb1b85aba234c87d2 100644 (file)
@@ -100,7 +100,7 @@ fn explain_span(cx: ctxt, heading: ~str, span: span)
         -> (~str, option<span>)
     {
         let lo = codemap::lookup_char_pos_adj(cx.sess.codemap, span.lo);
-        (fmt!{"the %s at %u:%u", heading, lo.line, lo.col}, some(span))
+        (fmt!("the %s at %u:%u", heading, lo.line, lo.col), some(span))
     }
 }
 
@@ -118,7 +118,7 @@ fn bound_region_to_str(cx: ctxt, br: bound_region) -> ~str {
       // does not fail
       br_cap_avoid(id, br) => {
         if cx.sess.ppregions() {
-            fmt!{"br_cap_avoid(%?, %s)", id, bound_region_to_str(cx, *br)}
+            fmt!("br_cap_avoid(%?, %s)", id, bound_region_to_str(cx, *br))
         } else {
             bound_region_to_str(cx, *br)
         }
@@ -129,40 +129,40 @@ fn bound_region_to_str(cx: ctxt, br: bound_region) -> ~str {
 fn re_scope_id_to_str(cx: ctxt, node_id: ast::node_id) -> ~str {
     match cx.items.find(node_id) {
       some(ast_map::node_block(blk)) => {
-        fmt!{"<block at %s>",
-             codemap::span_to_str(blk.span, cx.sess.codemap)}
+        fmt!("<block at %s>",
+             codemap::span_to_str(blk.span, cx.sess.codemap))
       }
       some(ast_map::node_expr(expr)) => {
         match expr.node {
           ast::expr_call(*) => {
-            fmt!{"<call at %s>",
-                 codemap::span_to_str(expr.span, cx.sess.codemap)}
+            fmt!("<call at %s>",
+                 codemap::span_to_str(expr.span, cx.sess.codemap))
           }
           ast::expr_match(*) => {
-            fmt!{"<alt at %s>",
-                 codemap::span_to_str(expr.span, cx.sess.codemap)}
+            fmt!("<alt at %s>",
+                 codemap::span_to_str(expr.span, cx.sess.codemap))
           }
           ast::expr_assign_op(*) |
           ast::expr_field(*) |
           ast::expr_unary(*) |
           ast::expr_binary(*) |
           ast::expr_index(*) => {
-            fmt!{"<method at %s>",
-                 codemap::span_to_str(expr.span, cx.sess.codemap)}
+            fmt!("<method at %s>",
+                 codemap::span_to_str(expr.span, cx.sess.codemap))
           }
           _ => {
-            fmt!{"<expression at %s>",
-                 codemap::span_to_str(expr.span, cx.sess.codemap)}
+            fmt!("<expression at %s>",
+                 codemap::span_to_str(expr.span, cx.sess.codemap))
           }
         }
       }
       none => {
-        fmt!{"<unknown-%d>", node_id}
+        fmt!("<unknown-%d>", node_id)
       }
       _ => { cx.sess.bug(
-          fmt!{"re_scope refers to %s",
+          fmt!("re_scope refers to %s",
                ast_map::node_id_to_str(cx.items, node_id,
-                                       cx.sess.parse_sess.interner)}) }
+                                       cx.sess.parse_sess.interner))) }
     }
 }
 
@@ -198,7 +198,7 @@ fn mt_to_str(cx: ctxt, m: mt) -> ~str {
 
 fn vstore_to_str(cx: ctxt, vs: ty::vstore) -> ~str {
     match vs {
-      ty::vstore_fixed(n) => fmt!{"%u", n},
+      ty::vstore_fixed(n) => fmt!("%u", n),
       ty::vstore_uniq => ~"~",
       ty::vstore_box => ~"@",
       ty::vstore_slice(r) => region_to_str(cx, r)
@@ -208,9 +208,9 @@ fn vstore_to_str(cx: ctxt, vs: ty::vstore) -> ~str {
 fn vstore_ty_to_str(cx: ctxt, ty: ~str, vs: ty::vstore) -> ~str {
     match vs {
       ty::vstore_fixed(_) => {
-        fmt!{"%s/%s", ty, vstore_to_str(cx, vs)}
+        fmt!("%s/%s", ty, vstore_to_str(cx, vs))
       }
-      _ => fmt!{"%s%s", vstore_to_str(cx, vs), ty}
+      _ => fmt!("%s%s", vstore_to_str(cx, vs), ty)
     }
 }
 
@@ -347,7 +347,7 @@ fn field_to_str(cx: ctxt, f: field) -> ~str {
         vstore_ty_to_str(cx, result, vs)
       }
       ty_evec(mt, vs) => {
-        vstore_ty_to_str(cx, fmt!{"[%s]", mt_to_str(cx, mt)}, vs)
+        vstore_ty_to_str(cx, fmt!("[%s]", mt_to_str(cx, mt)), vs)
       }
       ty_estr(vs) => vstore_ty_to_str(cx, ~"str", vs),
       ty_opaque_box => ~"@?",
@@ -365,15 +365,15 @@ fn parameterized(cx: ctxt,
     let r_str = match self_r {
       none => ~"",
       some(r) => {
-        fmt!{"/%s", region_to_str(cx, r)}
+        fmt!("/%s", region_to_str(cx, r))
       }
     };
 
     if vec::len(tps) > 0u {
         let strs = vec::map(tps, |t| ty_to_str(cx, t) );
-        fmt!{"%s%s<%s>", base, r_str, str::connect(strs, ~",")}
+        fmt!("%s%s<%s>", base, r_str, str::connect(strs, ~","))
     } else {
-        fmt!{"%s%s", base, r_str}
+        fmt!("%s%s", base, r_str)
     }
 }
 
index bb37697ff39d6cf37657eb1297c78c14f9a0a5d7..947c7905c409e82eb8ca91d356d92155dd34c8b6 100644 (file)
@@ -51,7 +51,7 @@ fn doc_meta(
 
     if vec::is_not_empty(doc_metas) {
         if vec::len(doc_metas) != 1u {
-            warn!{"ignoring %u doc attributes", vec::len(doc_metas) - 1u};
+            warn!("ignoring %u doc attributes", vec::len(doc_metas) - 1u);
         }
         some(doc_metas[0])
     } else {
index 7631e3b82f2631a74432e84c99da94c793310cc6..96f418247afb76740b44bfd886f9450642b13191 100644 (file)
@@ -62,7 +62,7 @@ fn usage() {
     println(~"Usage: rustdoc ~[options] <cratefile>\n");
     println(~"Options:\n");
     for opts().each |opt| {
-        println(fmt!{"    %s", opt.second()});
+        println(fmt!("    %s", opt.second()));
     }
     println(~"");
 }
@@ -179,7 +179,7 @@ fn parse_output_format(output_format: ~str) -> result<output_format, ~str> {
     match output_format {
       ~"markdown" => result::ok(markdown),
       ~"html" => result::ok(pandoc_html),
-      _ => result::err(fmt!{"unknown output format '%s'", output_format})
+      _ => result::err(fmt!("unknown output format '%s'", output_format))
     }
 }
 
@@ -187,7 +187,7 @@ fn parse_output_style(output_style: ~str) -> result<output_style, ~str> {
     match output_style {
       ~"doc-per-crate" => result::ok(doc_per_crate),
       ~"doc-per-mod" => result::ok(doc_per_mod),
-      _ => result::err(fmt!{"unknown output style '%s'", output_style})
+      _ => result::err(fmt!("unknown output style '%s'", output_style))
     }
 }
 
@@ -214,7 +214,7 @@ fn maybe_find_pandoc(
 
     let pandoc = do vec::find(possible_pandocs) |pandoc| {
         let output = program_output(pandoc, ~[~"--version"]);
-        debug!{"testing pandoc cmd %s: %?", pandoc, output};
+        debug!("testing pandoc cmd %s: %?", pandoc, output);
         output.status == 0
     };
 
index 2757bd8fbf10ee92d5864b44702dbc9c8d0c18e5..6ed6dc4abab506c193a3baddfb55435af10d7ea3 100644 (file)
@@ -124,7 +124,7 @@ fn should_request_new_writer_for_each_page() {
 }
 
 fn write_title(ctxt: ctxt, page: doc::page) {
-    ctxt.w.write_line(fmt!{"%% %s", make_title(page)});
+    ctxt.w.write_line(fmt!("%% %s", make_title(page)));
     ctxt.w.write_line(~"");
 }
 
@@ -176,7 +176,7 @@ fn write_header(ctxt: ctxt, lvl: hlvl, doc: doc::itemtag) {
 
 fn write_header_(ctxt: ctxt, lvl: hlvl, title: ~str) {
     let hashes = str::from_chars(vec::from_elem(lvl as uint, '#'));
-    ctxt.w.write_line(fmt!{"%s %s", hashes, title});
+    ctxt.w.write_line(fmt!("%s %s", hashes, title));
     ctxt.w.write_line(~"");
 }
 
@@ -234,7 +234,7 @@ fn header_name(doc: doc::itemtag) -> ~str {
             }
             trait_part += trait_type;
         }
-        fmt!{"%s%s for %s", doc.name(), trait_part, self_ty}
+        fmt!("%s%s for %s", doc.name(), trait_part, self_ty)
       }
       _ => {
         doc.name()
@@ -247,12 +247,12 @@ fn header_text(doc: doc::itemtag) -> ~str {
       doc::impltag(impldoc) => {
         let header_kind = header_kind(doc);
         let desc = if impldoc.trait_types.is_empty() {
-            fmt!{"for `%s`", impldoc.self_ty.get()}
+            fmt!("for `%s`", impldoc.self_ty.get())
         } else {
-            fmt!{"of `%s` for `%s`", impldoc.trait_types[0],
-                 impldoc.self_ty.get()}
+            fmt!("of `%s` for `%s`", impldoc.trait_types[0],
+                 impldoc.self_ty.get())
         };
-        fmt!{"%s %s", header_kind, desc}
+        fmt!("%s %s", header_kind, desc)
       }
       _ => {
         header_text_(header_kind(doc), header_name(doc))
@@ -261,7 +261,7 @@ fn header_text(doc: doc::itemtag) -> ~str {
 }
 
 fn header_text_(kind: ~str, name: ~str) -> ~str {
-    fmt!{"%s `%s`", kind, name}
+    fmt!("%s `%s`", kind, name)
 }
 
 fn write_crate(
@@ -400,10 +400,10 @@ fn write_index(ctxt: ctxt, index: doc::index) {
         let header = header_text_(entry.kind, entry.name);
         let id = entry.link;
         if option::is_some(entry.brief) {
-            ctxt.w.write_line(fmt!{"* [%s](%s) - %s",
-                                   header, id, option::get(entry.brief)});
+            ctxt.w.write_line(fmt!("* [%s](%s) - %s",
+                                   header, id, option::get(entry.brief)));
         } else {
-            ctxt.w.write_line(fmt!{"* [%s](%s)", header, id});
+            ctxt.w.write_line(fmt!("* [%s](%s)", header, id));
         }
     }
     ctxt.w.write_line(~"");
@@ -507,7 +507,7 @@ fn write_sig(ctxt: ctxt, sig: option<~str>) {
 
 fn code_block_indent(s: ~str) -> ~str {
     let lines = str::lines_any(s);
-    let indented = vec::map(lines, |line| fmt!{"    %s", line} );
+    let indented = vec::map(lines, |line| fmt!("    %s", line) );
     str::connect(indented, ~"\n")
 }
 
@@ -619,10 +619,10 @@ fn write_variant(ctxt: ctxt, doc: doc::variantdoc) {
     let sig = option::get(doc.sig);
     match doc.desc {
       some(desc) => {
-        ctxt.w.write_line(fmt!{"* `%s` - %s", sig, desc});
+        ctxt.w.write_line(fmt!("* `%s` - %s", sig, desc));
       }
       none => {
-        ctxt.w.write_line(fmt!{"* `%s`", sig});
+        ctxt.w.write_line(fmt!("* `%s`", sig));
       }
     }
 }
@@ -776,7 +776,7 @@ mod test {
     fn render(source: ~str) -> ~str {
         let (srv, doc) = create_doc_srv(source);
         let markdown = write_markdown_str_srv(srv, doc);
-        debug!{"markdown: %s", markdown};
+        debug!("markdown: %s", markdown);
         markdown
     }
 
@@ -789,23 +789,23 @@ fn create_doc_srv(source: ~str) -> (astsrv::srv, doc::doc) {
             };
 
             let doc = extract::from_srv(srv, ~"");
-            debug!{"doc (extract): %?", doc};
+            debug!("doc (extract): %?", doc);
             let doc = tystr_pass::mk_pass().f(srv, doc);
-            debug!{"doc (tystr): %?", doc};
+            debug!("doc (tystr): %?", doc);
             let doc = path_pass::mk_pass().f(srv, doc);
-            debug!{"doc (path): %?", doc};
+            debug!("doc (path): %?", doc);
             let doc = attr_pass::mk_pass().f(srv, doc);
-            debug!{"doc (attr): %?", doc};
+            debug!("doc (attr): %?", doc);
             let doc = desc_to_brief_pass::mk_pass().f(srv, doc);
-            debug!{"doc (desc_to_brief): %?", doc};
+            debug!("doc (desc_to_brief): %?", doc);
             let doc = unindent_pass::mk_pass().f(srv, doc);
-            debug!{"doc (unindent): %?", doc};
+            debug!("doc (unindent): %?", doc);
             let doc = sectionalize_pass::mk_pass().f(srv, doc);
-            debug!{"doc (trim): %?", doc};
+            debug!("doc (trim): %?", doc);
             let doc = trim_pass::mk_pass().f(srv, doc);
-            debug!{"doc (sectionalize): %?", doc};
+            debug!("doc (sectionalize): %?", doc);
             let doc = markdown_index_pass::mk_pass(config).f(srv, doc);
-            debug!{"doc (index): %?", doc};
+            debug!("doc (index): %?", doc);
             (srv, doc)
         }
     }
index 20435a1cef46d142802d883e21fd716350b24483..74932ca579d44ae86ba03fc23f42a0482a7c47a3 100644 (file)
@@ -90,8 +90,8 @@ fn pandoc_writer(
     do generic_writer |markdown| {
         import io::WriterUtil;
 
-        debug!{"pandoc cmd: %s", pandoc_cmd};
-        debug!{"pandoc args: %s", str::connect(pandoc_args, ~" ")};
+        debug!("pandoc cmd: %s", pandoc_cmd);
+        debug!("pandoc args: %s", str::connect(pandoc_args, ~" "));
 
         let pipe_in = os::pipe();
         let pipe_out = os::pipe();
@@ -123,10 +123,10 @@ fn pandoc_writer(
         let stderr = comm::recv(stderr_po);
 
         let status = run::waitpid(pid);
-        debug!{"pandoc result: %i", status};
+        debug!("pandoc result: %i", status);
         if status != 0 {
-            error!{"pandoc-out: %s", stdout};
-            error!{"pandoc-err: %s", stderr};
+            error!("pandoc-out: %s", stdout);
+            error!("pandoc-err: %s", stderr);
             fail ~"pandoc failed";
         }
     }
index eb6c88c62e795109d97e0cf2a8a961ae2c0cafd5..751e94e8649be6e57cf1e69c124c10358d02fe13 100755 (executable)
@@ -33,7 +33,7 @@ fn run_passes(
 
     let mut passno = 0;
     do vec::foldl(doc, passes) |doc, pass| {
-        log(debug, fmt!{"pass #%d", passno});
+        log(debug, fmt!("pass #%d", passno));
         passno += 1;
         log(debug, doc);
         do time(pass.name) {
@@ -110,7 +110,7 @@ fn main(args: ~[~str]) {
     let config = match config::parse_config(args) {
       result::ok(config) => config,
       result::err(err) => {
-        io::println(fmt!{"error: %s", err});
+        io::println(fmt!("error: %s", err));
         return;
       }
     };
@@ -122,7 +122,7 @@ fn time<T>(what: ~str, f: fn() -> T) -> T {
     let start = std::time::precise_time_s();
     let rv = f();
     let end = std::time::precise_time_s();
-    info!{"time: %3.3f s    %s", end - start, what};
+    info!("time: %3.3f s    %s", end - start, what);
     return rv;
 }
 
index e545870e8cb24f74272ab4d00cd60954fdb65e0a..8c25c83d2ad7cd41f8b92460d2fa4e5336f66555 100644 (file)
@@ -296,12 +296,12 @@ fn fold_type(
                 ident: ident,
                 node: ast::item_ty(ty, params), _
               }, _) => {
-                some(fmt!{
+                some(fmt!(
                     "type %s%s = %s",
                     to_str(ident),
                     pprust::typarams_to_str(params, extract::interner()),
                     pprust::ty_to_str(ty, extract::interner())
-                })
+                ))
               }
               _ => fail ~"expected type"
             }
index 56debd8574846255ae216ad023c3f356eb42e31f..95ca81bf97fd6737e9ffb4315186f3c8cba2bc1b 100644 (file)
@@ -4,7 +4,7 @@ struct cat {
   priv {
     let mut meows : uint;
     fn meow() {
-      error!{"Meow"};
+      error!("Meow");
       self.meows += 1u;
       if self.meows % 5u == 0u {
           self.how_hungry += 1;
@@ -22,12 +22,12 @@ fn meow() {
 
   fn eat() -> bool {
     if self.how_hungry > 0 {
-        error!{"OM NOM NOM"};
+        error!("OM NOM NOM");
         self.how_hungry -= 2;
         return true;
     }
     else {
-        error!{"Not hungry!"};
+        error!("Not hungry!");
         return false;
     }
   }
index fad0197564ca7c984821551ea9defc1854b3eba6..3a914a703e1eda182762438252c26974a9af87ce 100644 (file)
@@ -7,7 +7,7 @@ struct cat : ToStr {
   priv {
     let mut meows : uint;
     fn meow() {
-      error!{"Meow"};
+      error!("Meow");
       self.meows += 1u;
       if self.meows % 5u == 0u {
           self.how_hungry += 1;
@@ -25,12 +25,12 @@ fn meow() {
 
   fn eat() -> bool {
     if self.how_hungry > 0 {
-        error!{"OM NOM NOM"};
+        error!("OM NOM NOM");
         self.how_hungry -= 2;
         return true;
     }
     else {
-        error!{"Not hungry!"};
+        error!("Not hungry!");
         return false;
     }
   }
index bb8dc68d7acec89f898a5aea83157802b14f24c0..f42d65c2436a60559569dcf7818e94d951296312 100644 (file)
@@ -9,7 +9,7 @@ fn rust_dbg_call(cb: *u8,
 }
 
 fn fact(n: uint) -> uint {
-    debug!{"n = %?", n};
+    debug!("n = %?", n);
     rustrt::rust_dbg_call(cb, n)
 }
 
index c8c120416d502e412b6fa5e2707a6cd3a9db7ef7..ae6c2fb571a4e0a0c2b10389ebbd18f6479b4aef 100644 (file)
@@ -5,5 +5,5 @@
 import a::to_strz;
 
 impl int: to_strz {
-    fn to_strz() -> ~str { fmt!{"%?", self} }
+    fn to_strz() -> ~str { fmt!("%?", self) }
 }
index c0f73fdb220a06763d4644f78d2f743c7c0e702f..cd057a09e76197de41becb1d88c19617c757ad01 100644 (file)
@@ -6,5 +6,5 @@
 import a::to_strz;
 
 impl bool: to_strz {
-    fn to_strz() -> ~str { fmt!{"%b", self} }
+    fn to_strz() -> ~str { fmt!("%b", self) }
 }
index dbc59ec0071c1fdb0ec2f3fb9d3df8d1ae981ca8..8c89df79811eb1accd4493c0ee1cf1c86a2fad80 100644 (file)
@@ -30,10 +30,10 @@ fn port<T: send>() -> port<T> {
 struct port_ptr<T:send> {
    let po: *rust_port;
    new(po: *rust_port) {
-    debug!{"in the port_ptr constructor"};
+    debug!("in the port_ptr constructor");
     self.po = po; }
    drop unsafe {
-    debug!{"in the port_ptr destructor"};
+    debug!("in the port_ptr destructor");
        do task::unkillable {
         let yield = 0u;
         let yieldp = ptr::addr_of(yield);
index d58cd1ef4cf0549002264c7716bffedaf92e7206..b912b2cb12d34563d835d2326cf0d88629342402 100644 (file)
@@ -17,12 +17,12 @@ fn main(argv: ~[~str]) {
 
     let tests = vec::view(argv, 1, argv.len());
 
-    bench!{shift_push};
-    bench!{read_line};
-    bench!{str_set};
-    bench!{vec_plus};
-    bench!{vec_append};
-    bench!{vec_push_all};
+    bench!(shift_push);
+    bench!(read_line);
+    bench!(str_set);
+    bench!(vec_plus);
+    bench!(vec_append);
+    bench!(vec_push_all);
 }
 
 fn maybe_run_test(argv: &[~str], name: ~str, test: fn()) {
@@ -39,7 +39,7 @@ fn maybe_run_test(argv: &[~str], name: ~str, test: fn()) {
     test();
     let stop = precise_time_s();
 
-    io::println(fmt!{"%s:\t\t%f ms", name, (stop - start) * 1000f});
+    io::println(fmt!("%s:\t\t%f ms", name, (stop - start) * 1000f));
 }
 
 fn shift_push() {
@@ -53,7 +53,7 @@ fn shift_push() {
 
 fn read_line() {
     let path = path::connect(
-        env!{"CFG_SRC_DIR"},
+        env!("CFG_SRC_DIR"),
         ~"src/test/bench/shootout-k-nucleotide.data"
     );
 
index b480d92a0d849fde2d325299b21b89a2f87acb14..a9641acf45d8e48a3d5f4a39061ce70cab419433 100644 (file)
@@ -48,18 +48,18 @@ fn main(args: ~[~str]) {
     let rawf = raw as float;
     let dvecf = dvec as float;
     
-    io::stdout().write_str(fmt!{"Raw     : %? seconds\n", raw});
-    io::stdout().write_str(fmt!{"        : %f op/sec\n", maxf/rawf});
-    io::stdout().write_str(fmt!{"\n"});
-    io::stdout().write_str(fmt!{"Dvec    : %? seconds\n", dvec});
-    io::stdout().write_str(fmt!{"        : %f op/sec\n", maxf/dvecf});
-    io::stdout().write_str(fmt!{"\n"});
+    io::stdout().write_str(fmt!("Raw     : %? seconds\n", raw));
+    io::stdout().write_str(fmt!("        : %f op/sec\n", maxf/rawf));
+    io::stdout().write_str(fmt!("\n"));
+    io::stdout().write_str(fmt!("Dvec    : %? seconds\n", dvec));
+    io::stdout().write_str(fmt!("        : %f op/sec\n", maxf/dvecf));
+    io::stdout().write_str(fmt!("\n"));
     
     if dvec < raw {
-        io::stdout().write_str(fmt!{"Dvec is %f%% faster than raw\n",
-                                    (rawf - dvecf) / rawf * 100.0});
+        io::stdout().write_str(fmt!("Dvec is %f%% faster than raw\n",
+                                    (rawf - dvecf) / rawf * 100.0));
     } else {
-        io::stdout().write_str(fmt!{"Raw is %f%% faster than dvec\n",
-                                    (dvecf - rawf) / dvecf * 100.0});
+        io::stdout().write_str(fmt!("Raw is %f%% faster than dvec\n",
+                                    (dvecf - rawf) / dvecf * 100.0));
     }
 }
index 35ff2e648c9a6af36f83a3e20150dccdc965a101..78a3dd5ed967f962c63d1133dd2ab6242d398b79 100644 (file)
@@ -167,7 +167,7 @@ fn is_gray(c: color) -> bool {
     let mut i = 0u;
     while vec::any(colors, is_gray) {
         // Do the BFS.
-        log(info, fmt!{"PBFS iteration %?", i});
+        log(info, fmt!("PBFS iteration %?", i));
         i += 1u;
         colors = do colors.mapi() |i, c| {
             let c : color = c;
@@ -237,7 +237,7 @@ fn is_gray(c: color) -> bool {
     let mut i = 0u;
     while par::any(colors, is_gray) {
         // Do the BFS.
-        log(info, fmt!{"PBFS iteration %?", i});
+        log(info, fmt!("PBFS iteration %?", i));
         i += 1u;
         let old_len = colors.len();
 
@@ -397,8 +397,8 @@ fn main(args: ~[~str]) {
     let edges = make_edges(scale, 16u);
     let stop = time::precise_time_s();
 
-    io::stdout().write_line(fmt!{"Generated %? edges in %? seconds.",
-                                 vec::len(edges), stop - start});
+    io::stdout().write_line(fmt!("Generated %? edges in %? seconds.",
+                                 vec::len(edges), stop - start));
 
     let start = time::precise_time_s();
     let graph = make_graph(1u << scale, edges);
@@ -407,9 +407,9 @@ fn main(args: ~[~str]) {
     let mut total_edges = 0u;
     vec::each(graph, |edges| { total_edges += edges.len(); true });
 
-    io::stdout().write_line(fmt!{"Generated graph with %? edges in %? seconds.",
+    io::stdout().write_line(fmt!("Generated graph with %? edges in %? seconds.",
                                  total_edges / 2u,
-                                 stop - start});
+                                 stop - start));
 
     let mut total_seq = 0.0;
     let mut total_par = 0.0;
@@ -418,7 +418,7 @@ fn main(args: ~[~str]) {
 
     do gen_search_keys(graph, num_keys).map() |root| {
         io::stdout().write_line(~"");
-        io::stdout().write_line(fmt!{"Search key: %?", root});
+        io::stdout().write_line(fmt!("Search key: %?", root));
 
         if do_sequential {
             let start = time::precise_time_s();
@@ -428,8 +428,8 @@ fn main(args: ~[~str]) {
             //total_seq += stop - start;
 
             io::stdout().write_line(
-                fmt!{"Sequential BFS completed in %? seconds.",
-                     stop - start});
+                fmt!("Sequential BFS completed in %? seconds.",
+                     stop - start));
             
             if do_validate {
                 let start = time::precise_time_s();
@@ -437,8 +437,8 @@ fn main(args: ~[~str]) {
                 let stop = time::precise_time_s();
                 
                 io::stdout().write_line(
-                    fmt!{"Validation completed in %? seconds.",
-                         stop - start});
+                    fmt!("Validation completed in %? seconds.",
+                         stop - start));
             }
             
             let start = time::precise_time_s();
@@ -448,8 +448,8 @@ fn main(args: ~[~str]) {
             total_seq += stop - start;
             
             io::stdout().write_line(
-                fmt!{"Alternate Sequential BFS completed in %? seconds.",
-                     stop - start});
+                fmt!("Alternate Sequential BFS completed in %? seconds.",
+                     stop - start));
             
             if do_validate {
                 let start = time::precise_time_s();
@@ -457,8 +457,8 @@ fn main(args: ~[~str]) {
                 let stop = time::precise_time_s();
                 
                 io::stdout().write_line(
-                    fmt!{"Validation completed in %? seconds.",
-                         stop - start});
+                    fmt!("Validation completed in %? seconds.",
+                         stop - start));
             }
         }
         
@@ -468,21 +468,21 @@ fn main(args: ~[~str]) {
 
         total_par += stop - start;
 
-        io::stdout().write_line(fmt!{"Parallel BFS completed in %? seconds.",
-                                     stop - start});
+        io::stdout().write_line(fmt!("Parallel BFS completed in %? seconds.",
+                                     stop - start));
 
         if do_validate {
             let start = time::precise_time_s();
             assert(validate(edges, root, bfs_tree));
             let stop = time::precise_time_s();
             
-            io::stdout().write_line(fmt!{"Validation completed in %? seconds.",
-                                         stop - start});
+            io::stdout().write_line(fmt!("Validation completed in %? seconds.",
+                                         stop - start));
         }
     };
 
     io::stdout().write_line(~"");
     io::stdout().write_line(
-        fmt!{"Total sequential: %? \t Total Parallel: %? \t Speedup: %?x",
-             total_seq, total_par, total_seq / total_par});
+        fmt!("Total sequential: %? \t Total Parallel: %? \t Speedup: %?x",
+             total_seq, total_par, total_seq / total_par));
 }
index 26741f6298fe45ca93877a2a5a1cfd93ea83e7ae..0f16bec626e3a1204d7bee9a9fa4366bec6576fb 100644 (file)
@@ -33,7 +33,7 @@ fn server(requests: port<request>, responses: pipes::chan<uint>) {
         match requests.try_recv() {
           some(get_count) => { responses.send(copy count); }
           some(bytes(b)) => {
-            //error!{"server: received %? bytes", b};
+            //error!("server: received %? bytes", b);
             count += b;
           }
           none => { done = true; }
@@ -41,7 +41,7 @@ fn server(requests: port<request>, responses: pipes::chan<uint>) {
         }
     }
     responses.send(count);
-    //error!{"server exiting"};
+    //error!("server exiting");
 }
 
 fn run(args: &[~str]) {
@@ -61,10 +61,10 @@ fn run(args: &[~str]) {
             vec::push(worker_results, r);
         }).spawn {
             for uint::range(0u, size / workers) |_i| {
-                //error!{"worker %?: sending %? bytes", i, num_bytes};
+                //error!("worker %?: sending %? bytes", i, num_bytes);
                 to_child.send(bytes(num_bytes));
             }
-            //error!{"worker %? exiting", i};
+            //error!("worker %? exiting", i);
         };
     }
     do task::spawn {
@@ -72,16 +72,16 @@ fn run(args: &[~str]) {
     }
 
     vec::iter(worker_results, |r| { future::get(&r); } );
-    //error!{"sending stop message"};
+    //error!("sending stop message");
     to_child.send(stop);
-    move_out!{to_child};
+    move_out!(to_child);
     let result = from_child.recv();
     let end = std::time::precise_time_s();
     let elapsed = end - start;
-    io::stdout().write_str(fmt!{"Count is %?\n", result});
-    io::stdout().write_str(fmt!{"Test took %? seconds\n", elapsed});
+    io::stdout().write_str(fmt!("Count is %?\n", result));
+    io::stdout().write_str(fmt!("Test took %? seconds\n", elapsed));
     let thruput = ((size / workers * workers) as float) / (elapsed as float);
-    io::stdout().write_str(fmt!{"Throughput=%f per sec\n", thruput});
+    io::stdout().write_str(fmt!("Throughput=%f per sec\n", thruput));
     assert result == num_bytes * size;
 }
 
@@ -94,6 +94,6 @@ fn main(args: ~[~str]) {
         copy args
     };        
 
-    debug!{"%?", args};
+    debug!("%?", args);
     run(args);
 }
index fc0413827211eceb5feb03df8ecd2ed80576c527..7b2930387f4cce0e38b82e3c26d459fd27753532 100644 (file)
@@ -29,7 +29,7 @@ fn server(requests: PortSet<request>, responses: pipes::chan<uint>) {
         match requests.try_recv() {
           some(get_count) => { responses.send(copy count); }
           some(bytes(b)) => {
-            //error!{"server: received %? bytes", b};
+            //error!("server: received %? bytes", b);
             count += b;
           }
           none => { done = true; }
@@ -37,7 +37,7 @@ fn server(requests: PortSet<request>, responses: pipes::chan<uint>) {
         }
     }
     responses.send(count);
-    //error!{"server exiting"};
+    //error!("server exiting");
 }
 
 fn run(args: &[~str]) {
@@ -58,10 +58,10 @@ fn run(args: &[~str]) {
             vec::push(worker_results, r);
         }).spawn {
             for uint::range(0u, size / workers) |_i| {
-                //error!{"worker %?: sending %? bytes", i, num_bytes};
+                //error!("worker %?: sending %? bytes", i, num_bytes);
                 to_child.send(bytes(num_bytes));
             }
-            //error!{"worker %? exiting", i};
+            //error!("worker %? exiting", i);
         };
     }
     do task::spawn {
@@ -69,16 +69,16 @@ fn run(args: &[~str]) {
     }
 
     vec::iter(worker_results, |r| { future::get(&r); } );
-    //error!{"sending stop message"};
+    //error!("sending stop message");
     to_child.send(stop);
-    move_out!{to_child};
+    move_out!(to_child);
     let result = from_child.recv();
     let end = std::time::precise_time_s();
     let elapsed = end - start;
-    io::stdout().write_str(fmt!{"Count is %?\n", result});
-    io::stdout().write_str(fmt!{"Test took %? seconds\n", elapsed});
+    io::stdout().write_str(fmt!("Count is %?\n", result));
+    io::stdout().write_str(fmt!("Test took %? seconds\n", elapsed));
     let thruput = ((size / workers * workers) as float) / (elapsed as float);
-    io::stdout().write_str(fmt!{"Throughput=%f per sec\n", thruput});
+    io::stdout().write_str(fmt!("Throughput=%f per sec\n", thruput));
     assert result == num_bytes * size;
 }
 
@@ -91,6 +91,6 @@ fn main(args: ~[~str]) {
         copy args
     };        
 
-    debug!{"%?", args};
+    debug!("%?", args);
     run(args);
 }
index 172351e506fbb40fe98d0102fb95e6932f8c74b5..644bb12f0185251fd06fd72ac8293a7a464f4769 100644 (file)
@@ -45,7 +45,7 @@ fn thread_ring(i: uint,
     let mut num_port <- some(num_port);
     // Send/Receive lots of messages.
     for uint::range(0u, count) |j| {
-        //error!{"task %?, iter %?", i, j};
+        //error!("task %?, iter %?", i, j);
         let mut num_chan2 = option::swap_unwrap(&mut num_chan);
         let mut num_port2 = option::swap_unwrap(&mut num_port);
         send(&num_chan2, i * j);
@@ -77,7 +77,7 @@ fn main(args: ~[~str]) {
     let mut futures = ~[];
 
     for uint::range(1u, num_tasks) |i| {
-        //error!{"spawning %?", i};
+        //error!("spawning %?", i);
         let (new_chan, num_port) = init();
         let num_chan2 = ~mut none;
         *num_chan2 <-> num_chan;
@@ -107,8 +107,8 @@ fn main(args: ~[~str]) {
     let elapsed = (stop - start);
     let rate = (num_msgs as float) / elapsed;
 
-    io::println(fmt!{"Sent %? messages in %? seconds",
-                     num_msgs, elapsed});
-    io::println(fmt!{"  %? messages / second", rate});
-    io::println(fmt!{"  %? Î¼s / message", 1000000. / rate});
+    io::println(fmt!("Sent %? messages in %? seconds",
+                     num_msgs, elapsed));
+    io::println(fmt!("  %? messages / second", rate));
+    io::println(fmt!("  %? Î¼s / message", 1000000. / rate));
 }
index 9bf0298ab323e58b0f2e630e34ef839ae828e10a..96f65b3462edf2dafa1df32e98696c79c8d703f0 100644 (file)
@@ -36,7 +36,7 @@ fn thread_ring(i: uint,
     let mut num_port <- some(num_port);
     // Send/Receive lots of messages.
     for uint::range(0u, count) |j| {
-        //error!{"task %?, iter %?", i, j};
+        //error!("task %?, iter %?", i, j);
         let mut num_chan2 = none;
         let mut num_port2 = none;
         num_chan2 <-> num_chan;
@@ -46,7 +46,7 @@ fn thread_ring(i: uint,
         match recv(port) {
           ring::num(_n, p) => {
             //log(error, _n);
-            num_port = some(move_out!{p});
+            num_port = some(move_out!(p));
           }
         }
     };
@@ -73,7 +73,7 @@ fn main(args: ~[~str]) {
     let mut futures = ~[];
 
     for uint::range(1u, num_tasks) |i| {
-        //error!{"spawning %?", i};
+        //error!("spawning %?", i);
         let (new_chan, num_port) = ring::init();
         let num_chan2 = ~mut none;
         *num_chan2 <-> num_chan;
@@ -103,8 +103,8 @@ fn main(args: ~[~str]) {
     let elapsed = (stop - start);
     let rate = (num_msgs as float) / elapsed;
 
-    io::println(fmt!{"Sent %? messages in %? seconds",
-                     num_msgs, elapsed});
-    io::println(fmt!{"  %? messages / second", rate});
-    io::println(fmt!{"  %? Î¼s / message", 1000000. / rate});
+    io::println(fmt!("Sent %? messages in %? seconds",
+                     num_msgs, elapsed));
+    io::println(fmt!("  %? messages / second", rate));
+    io::println(fmt!("  %? Î¼s / message", 1000000. / rate));
 }
index 6dcaabdb56e37fa50116e2ee37957e9f4c2eb47b..619340370147a201059762b650cfb2a065838781 100644 (file)
@@ -46,7 +46,7 @@ fn thread_ring(i: uint,
     let mut num_port <- some(num_port);
     // Send/Receive lots of messages.
     for uint::range(0u, count) |j| {
-        //error!{"task %?, iter %?", i, j};
+        //error!("task %?, iter %?", i, j);
         let mut num_chan2 = option::swap_unwrap(&mut num_chan);
         let mut num_port2 = option::swap_unwrap(&mut num_port);
         send(&num_chan2, i * j);
@@ -78,7 +78,7 @@ fn main(args: ~[~str]) {
     let mut futures = ~[];
 
     for uint::range(1u, num_tasks) |i| {
-        //error!{"spawning %?", i};
+        //error!("spawning %?", i);
         let (new_chan, num_port) = init();
         let num_chan2 = ~mut none;
         *num_chan2 <-> num_chan;
@@ -108,8 +108,8 @@ fn main(args: ~[~str]) {
     let elapsed = (stop - start);
     let rate = (num_msgs as float) / elapsed;
 
-    io::println(fmt!{"Sent %? messages in %? seconds",
-                     num_msgs, elapsed});
-    io::println(fmt!{"  %? messages / second", rate});
-    io::println(fmt!{"  %? Î¼s / message", 1000000. / rate});
+    io::println(fmt!("Sent %? messages in %? seconds",
+                     num_msgs, elapsed));
+    io::println(fmt!("  %? messages / second", rate));
+    io::println(fmt!("  %? Î¼s / message", 1000000. / rate));
 }
index 418ea3e538f242f806a5b20b1981292aed05e88b..d3fdc472b66ae359b83b259deb4d77ea90805b48 100644 (file)
@@ -67,8 +67,8 @@ fn main(args: ~[~str]) {
     let elapsed = (stop - start);
     let rate = (num_msgs as float) / elapsed;
 
-    io::println(fmt!{"Sent %? messages in %? seconds",
-                     num_msgs, elapsed});
-    io::println(fmt!{"  %? messages / second", rate});
-    io::println(fmt!{"  %? Î¼s / message", 1000000. / rate});
+    io::println(fmt!("Sent %? messages in %? seconds",
+                     num_msgs, elapsed));
+    io::println(fmt!("  %? messages / second", rate));
+    io::println(fmt!("  %? Î¼s / message", 1000000. / rate));
 }
index 507515678220baee5f8e0a219f762829b1667b66..d7c8e8436cd62456c2fefa52429958c34b536b2b 100644 (file)
@@ -49,10 +49,10 @@ fn run(args: ~[~str]) {
     let result = comm::recv(from_child);
     let end = std::time::precise_time_s();
     let elapsed = end - start;
-    io::stdout().write_str(fmt!{"Count is %?\n", result});
-    io::stdout().write_str(fmt!{"Test took %? seconds\n", elapsed});
+    io::stdout().write_str(fmt!("Count is %?\n", result));
+    io::stdout().write_str(fmt!("Test took %? seconds\n", elapsed));
     let thruput = ((size / workers * workers) as float) / (elapsed as float);
-    io::stdout().write_str(fmt!{"Throughput=%f per sec\n", thruput});
+    io::stdout().write_str(fmt!("Throughput=%f per sec\n", thruput));
 }
 
 fn main(args: ~[~str]) {
@@ -64,7 +64,7 @@ fn main(args: ~[~str]) {
         args
     };
 
-    debug!{"%?", args};
+    debug!("%?", args);
     run(args);
 }
 
index 17830af6869f6746601ad4d6b02f4d2869f9d855..3cc474df3425e9dafd26f8efa8fc27dc720fd1e8 100644 (file)
@@ -11,7 +11,7 @@
     ping: send {
         ping -> pong
     }
-    
+
     pong: recv {
         pong -> ping
     }
@@ -21,7 +21,7 @@
     ping: send {
         ping -> pong
     }
-    
+
     pong: recv {
         pong -> ping
     }
@@ -37,7 +37,7 @@ macro_rules! move_it {
 }
 
 macro_rules! follow {
-    { 
+    {
         $($message:path($($x: ident),+) -> $next:ident $e:expr)+
     } => (
         |m| match move m {
@@ -50,7 +50,7 @@ macro_rules! follow {
         }
     );
 
-    { 
+    {
         $($message:path -> $next:ident $e:expr)+
     } => (
         |m| match move m {
@@ -78,9 +78,9 @@ fn bounded(count: uint) {
         let mut count = count;
         let mut ch = ch;
         while count > 0 {
-            ch = switch(ch, follow! {
+            ch = switch(ch, follow! (
                 ping -> next { server::pong(next) }
-            });
+            ));
 
             count -= 1;
         }
@@ -90,9 +90,9 @@ fn bounded(count: uint) {
     while count > 0 {
         let ch_ = client::ping(ch);
 
-        ch = switch(ch_, follow! {
+        ch = switch(ch_, follow! (
             pong -> next { next }
-        });
+        ));
 
         count -= 1;
     }
@@ -105,9 +105,9 @@ fn unbounded(count: uint) {
         let mut count = count;
         let mut ch = ch;
         while count > 0 {
-            ch = switch(ch, follow! {
+            ch = switch(ch, follow! (
                 ping -> next { server::pong(next) }
-            });
+            ));
 
             count -= 1;
         }
@@ -117,9 +117,9 @@ fn unbounded(count: uint) {
     while count > 0 {
         let ch_ = client::ping(ch);
 
-        ch = switch(ch_, follow! {
+        ch = switch(ch_, follow! (
             pong -> next { next }
-        });
+        ));
 
         count -= 1;
     }
@@ -141,13 +141,13 @@ fn main() {
     let bounded = do timeit { bounded(count) };
     let unbounded = do timeit { unbounded(count) };
 
-    io::println(fmt!{"count: %?\n", count});
-    io::println(fmt!{"bounded:   %? s\t(%? Î¼s/message)",
-                     bounded, bounded * 1000000. / (count as float)});
-    io::println(fmt!{"unbounded: %? s\t(%? Î¼s/message)",
-                     unbounded, unbounded * 1000000. / (count as float)});
+    io::println(fmt!("count: %?\n", count));
+    io::println(fmt!("bounded:   %? s\t(%? Î¼s/message)",
+                     bounded, bounded * 1000000. / (count as float)));
+    io::println(fmt!("unbounded: %? s\t(%? Î¼s/message)",
+                     unbounded, unbounded * 1000000. / (count as float)));
 
-    io::println(fmt!{"\n\
+    io::println(fmt!("\n\
                       bounded is %?%% faster",
-                     (unbounded - bounded) / bounded * 100.});
+                     (unbounded - bounded) / bounded * 100.));
 }
index 291e7c2dba51639d598ab994e40dc177a8fb23ca..f3a558984ea8e63d41360fccfd9fd3e3b2d780f4 100644 (file)
@@ -21,5 +21,5 @@ fn main(args: ~[~str]) {
         args
     };
     let n = int::from_str(args[1]).get();
-    io::println(fmt!{"Ack(3,%d): %d\n", n, ack(3, n)});
+    io::println(fmt!("Ack(3,%d): %d\n", n, ack(3, n)));
 }
index c9f1ca832a370d391703cd436ad5cb0c2fbedff5..37a5d215a7c3a48d9b61a40686eaeb5d86031708 100644 (file)
@@ -47,9 +47,9 @@ fn main(args: ~[~str]) {
     let stretch_depth = max_depth + 1;
     let stretch_tree = bottom_up_tree(&stretch_arena, 0, stretch_depth);
 
-    io::println(fmt!{"stretch tree of depth %d\t check: %d",
+    io::println(fmt!("stretch tree of depth %d\t check: %d",
                           stretch_depth,
-                          item_check(stretch_tree)});
+                          item_check(stretch_tree)));
 
     let long_lived_arena = arena::arena();
     let long_lived_tree = bottom_up_tree(&long_lived_arena, 0, max_depth);
@@ -65,12 +65,12 @@ fn main(args: ~[~str]) {
             chk += item_check(temp_tree);
             i += 1;
         }
-        io::println(fmt!{"%d\t trees of depth %d\t check: %d",
+        io::println(fmt!("%d\t trees of depth %d\t check: %d",
                          iterations * 2, depth,
-                         chk});
+                         chk));
         depth += 2;
     }
-    io::println(fmt!{"long lived trees of depth %d\t check: %d",
+    io::println(fmt!("long lived trees of depth %d\t check: %d",
                      max_depth,
-                          item_check(long_lived_tree)});
+                          item_check(long_lived_tree)));
 }
index 05fdf0fb709541c5658d3b3f6c932595c0b31c5c..bde2c79e21885c659518398476452ce4187191ad 100644 (file)
@@ -111,7 +111,7 @@ fn creature(
             }
             option::none => {
                 // log creatures met and evil clones of self
-                let report = fmt!{"%u", creatures_met} + ~" " +
+                let report = fmt!("%u", creatures_met) + ~" " +
                              show_number(evil_clones_met);
                 comm::send(to_rendezvous_log, report);
                 break;
index e5eab3b78f47a8d3dbfa6f7ddca0de632abaec8c..330397ddc925c5f555082563ed1f4e471a32434d 100644 (file)
@@ -43,7 +43,7 @@ fn fannkuch(n: int) -> int {
         let mut go = true;
         while go {
             if r == n {
-                io::println(fmt!{"%d", checksum});
+                io::println(fmt!("%d", checksum));
                 return flips;
             }
             let p0 = perm1[0];
@@ -68,5 +68,5 @@ fn main(args: ~[~str]) {
     };
 
     let n = int::from_str(args[1]).get();
-    io::println(fmt!{"Pfannkuchen(%d) = %d", n, fannkuch(n)});
+    io::println(fmt!("Pfannkuchen(%d) = %d", n, fannkuch(n)));
 }
index 4e8cfff4ad2e7af410b97e0535d2c2b5e9c1911a..1bf7c1e47828dc88a24feff22a90357899edc53f 100644 (file)
@@ -17,5 +17,5 @@ fn main(args: ~[~str]) {
         args
     };
     let n = int::from_str(args[1]).get();
-    io::println(fmt!{"%d\n", fib(n)});
+    io::println(fmt!("%d\n", fib(n)));
 }
index d0234022a855d70e1998be3babc9db588e8836b5..e9054195ee49da2ef295997177ba4c4a7bda7627 100644 (file)
@@ -48,7 +48,7 @@ fn sortKV<TT: copy, UU: copy>(orig: ~[(TT,UU)]) -> ~[(TT,UU)] {
 
    pairs_sorted.each(fn&(kv: (~[u8], float)) -> bool unsafe {
       let (k,v) = kv;
-      buffer += (fmt!{"%s %0.3f\n", str::to_upper(str::unsafe::from_bytes(k)), v});
+      buffer += (fmt!("%s %0.3f\n", str::to_upper(str::unsafe::from_bytes(k)), v));
       return true;
    });
 
@@ -111,15 +111,15 @@ fn make_sequence_processor(sz: uint, from_parent: pipes::port<~[u8]>,
    let buffer = match sz { 
        1u => { sort_and_fmt(freqs, total) }
        2u => { sort_and_fmt(freqs, total) }
-       3u => { fmt!{"%u\t%s", find(freqs, ~"GGT"), ~"GGT"} }
-       4u => { fmt!{"%u\t%s", find(freqs, ~"GGTA"), ~"GGTA"} }
-       6u => { fmt!{"%u\t%s", find(freqs, ~"GGTATT"), ~"GGTATT"} }
-      12u => { fmt!{"%u\t%s", find(freqs, ~"GGTATTTTAATT"), ~"GGTATTTTAATT"} }
-      18u => { fmt!{"%u\t%s", find(freqs, ~"GGTATTTTAATTTATAGT"), ~"GGTATTTTAATTTATAGT"} }
+       3u => { fmt!("%u\t%s", find(freqs, ~"GGT"), ~"GGT") }
+       4u => { fmt!("%u\t%s", find(freqs, ~"GGTA"), ~"GGTA") }
+       6u => { fmt!("%u\t%s", find(freqs, ~"GGTATT"), ~"GGTATT") }
+      12u => { fmt!("%u\t%s", find(freqs, ~"GGTATTTTAATT"), ~"GGTATTTTAATT") }
+      18u => { fmt!("%u\t%s", find(freqs, ~"GGTATTTTAATTTATAGT"), ~"GGTATTTTAATTTATAGT") }
         _ => { ~"" }
    };
 
-   //comm::send(to_parent, fmt!{"yay{%u}", sz});
+   //comm::send(to_parent, fmt!("yay{%u}", sz));
     to_parent.send(buffer);
 }
 
@@ -129,7 +129,7 @@ fn main(args: ~[~str]) {
        // FIXME: Using this compile-time env variable is a crummy way to
        // get to this massive data set, but #include_bin chokes on it (#2598)
        let path = path::connect(
-           env!{"CFG_SRC_DIR"},
+           env!("CFG_SRC_DIR"),
            ~"src/test/bench/shootout-k-nucleotide.data"
            );
        result::get(io::file_reader(path))
index 467df1148df27deda3433f87007b52a74f6c2b0d..08b17f0dfb3f405e064f968fa1c3d8e0476c4aa9 100644 (file)
@@ -46,7 +46,7 @@ fn sortKV<TT: copy, UU: copy>(orig: ~[(TT,UU)]) -> ~[(TT,UU)] {
 
    pairs_sorted.each(fn&(kv: (~[u8], float)) -> bool unsafe {
       let (k,v) = kv;
-      buffer += (fmt!{"%s %0.3f\n", str::to_upper(str::unsafe::from_bytes(k)), v});
+      buffer += (fmt!("%s %0.3f\n", str::to_upper(str::unsafe::from_bytes(k)), v));
       return true;
    });
 
@@ -109,15 +109,15 @@ fn make_sequence_processor(sz: uint, from_parent: comm::Port<~[u8]>,
    let buffer = match sz { 
        1u => { sort_and_fmt(freqs, total) }
        2u => { sort_and_fmt(freqs, total) }
-       3u => { fmt!{"%u\t%s", find(freqs, ~"GGT"), ~"GGT"} }
-       4u => { fmt!{"%u\t%s", find(freqs, ~"GGTA"), ~"GGTA"} }
-       6u => { fmt!{"%u\t%s", find(freqs, ~"GGTATT"), ~"GGTATT"} }
-      12u => { fmt!{"%u\t%s", find(freqs, ~"GGTATTTTAATT"), ~"GGTATTTTAATT"} }
-      18u => { fmt!{"%u\t%s", find(freqs, ~"GGTATTTTAATTTATAGT"), ~"GGTATTTTAATTTATAGT"} }
+       3u => { fmt!("%u\t%s", find(freqs, ~"GGT"), ~"GGT") }
+       4u => { fmt!("%u\t%s", find(freqs, ~"GGTA"), ~"GGTA") }
+       6u => { fmt!("%u\t%s", find(freqs, ~"GGTATT"), ~"GGTATT") }
+      12u => { fmt!("%u\t%s", find(freqs, ~"GGTATTTTAATT"), ~"GGTATTTTAATT") }
+      18u => { fmt!("%u\t%s", find(freqs, ~"GGTATTTTAATTTATAGT"), ~"GGTATTTTAATTTATAGT") }
         _ => { ~"" }
    };
 
-   //comm::send(to_parent, fmt!{"yay{%u}", sz});
+   //comm::send(to_parent, fmt!("yay{%u}", sz));
    comm::send(to_parent, buffer);
 }
 
@@ -127,7 +127,7 @@ fn main(args: ~[~str]) {
        // FIXME: Using this compile-time env variable is a crummy way to
        // get to this massive data set, but #include_bin chokes on it (#2598)
        let path = path::connect(
-           env!{"CFG_SRC_DIR"},
+           env!("CFG_SRC_DIR"),
            ~"src/test/bench/shootout-k-nucleotide.data"
            );
        result::get(io::file_reader(path))
index 252832f0cb758ba5895b6097fb275b1ceac03666..1f380d79269b73b95f62d327bf3c3ce0fedc53ba 100644 (file)
@@ -117,20 +117,20 @@ fn writer(path: ~str, writech: comm::Chan<comm::Chan<line>>, size: uint)
         }
     };
     cout.write_line(~"P4");
-    cout.write_line(fmt!{"%u %u", size, size});
+    cout.write_line(fmt!("%u %u", size, size));
     let lines = std::map::uint_hash();
     let mut done = 0_u;
     let mut i = 0_u;
     while i < size {
         let aline = comm::recv(p);
         if aline.i == done {
-            debug!{"W %u", aline.i};
+            debug!("W %u", aline.i);
             cout.write(aline.b);
             done += 1_u;
             let mut prev = done;
             while prev <= i {
                 if lines.contains_key(prev) {
-                    debug!{"WS %u", prev};
+                    debug!("WS %u", prev);
                     // FIXME (#2280): this temporary shouldn't be
                     // necessary, but seems to be, for borrowing.
                     let v : ~[u8] = lines.get(prev);
@@ -145,7 +145,7 @@ fn writer(path: ~str, writech: comm::Chan<comm::Chan<line>>, size: uint)
             };
         }
         else {
-            debug!{"S %u", aline.i};
+            debug!("S %u", aline.i);
             lines.insert(aline.i, aline.b);
         };
         i += 1_u;
@@ -177,7 +177,7 @@ fn main(args: ~[~str]) {
     for uint::range(0_u, size) |j| {
         task::spawn(|| chanmb(j, size, ch) );
         if j % yieldevery == 0_u {
-            debug!{"Y %u", j};
+            debug!("Y %u", j);
             task::yield();
         };
     };
index 0082bc6ad03c60caa2a2792ab29423884847ff47..ef1e6509ee9469bcbab5fc89f4d0cd09674e01fd 100644 (file)
@@ -23,10 +23,10 @@ fn main(args: ~[~str]) {
     };
     let n = int::from_str(args[1]).get();
     let bodies: ~[Body::props] = NBodySystem::make();
-    io::println(fmt!{"%f", NBodySystem::energy(bodies)});
+    io::println(fmt!("%f", NBodySystem::energy(bodies)));
     let mut i = 0;
     while i < n { NBodySystem::advance(bodies, 0.01); i += 1; }
-    io::println(fmt!{"%f", NBodySystem::energy(bodies)});
+    io::println(fmt!("%f", NBodySystem::energy(bodies)));
 }
 
 mod NBodySystem {
index 225f3d98c0e2180065fec68a640244d4e104b18d..588f6bf8ce24ec5e9aed41bdf549da95cd15df6c 100644 (file)
@@ -63,7 +63,7 @@ fn stress_task(&&id: int) {
         let n = 15;
         assert (fib(n) == fib(n));
         i += 1;
-        error!{"%d: Completed %d iterations", id, i};
+        error!("%d: Completed %d iterations", id, i);
     }
 }
 
@@ -108,8 +108,8 @@ fn main(args: ~[~str]) {
 
                 let elapsed = stop - start;
 
-                out.write_line(fmt!{"%d\t%d\t%s", n, fibn,
-                                    u64::str(elapsed)});
+                out.write_line(fmt!("%d\t%d\t%s", n, fibn,
+                                    u64::str(elapsed)));
             }
         }
     }
index 69f31b3907515da93cd7eb722666c8bd3dd73208..95f2b257400fc9e066439b23f9575514b399f8fb 100644 (file)
@@ -69,5 +69,5 @@ fn main(args: ~[~str]) {
         i += 1u;
     }
 
-    io::println(fmt!{"%0.9f\n", float::sqrt(vBv / vv)});
+    io::println(fmt!("%0.9f\n", float::sqrt(vBv / vv)));
 }
index f3b1850c88c39c0593a1269c6e4e857731c3a684..91b2c6e5dc8bb85458632ca49e3e359fa438125d 100644 (file)
@@ -23,11 +23,11 @@ fn roundtrip(id: int, p: comm::Port<int>, ch: comm::Chan<int>) {
     while (true) {
         match comm::recv(p) {
           1 => {
-            io::println(fmt!{"%d\n", id});
+            io::println(fmt!("%d\n", id));
             return;
           }
           token => {
-            debug!{"%d %d", id, token};
+            debug!("%d %d", id, token);
             comm::send(ch, token - 1);
             if token <= n_threads {
                 return;
index a9cab862e2e9ef0ed324c7d862f6474fc8b2c083..7f9a55ab1674a8d431e89844b644171500c5a43c 100644 (file)
@@ -45,8 +45,8 @@ fn main(args: ~[~str]) {
 
     let maxf = max as float;
 
-    io::stdout().write_str(fmt!{"insert(): %? seconds\n", checkf});
-    io::stdout().write_str(fmt!{"        : %f op/sec\n", maxf/checkf});
-    io::stdout().write_str(fmt!{"get()   : %? seconds\n", appendf});
-    io::stdout().write_str(fmt!{"        : %f op/sec\n", maxf/appendf});
+    io::stdout().write_str(fmt!("insert(): %? seconds\n", checkf));
+    io::stdout().write_str(fmt!("        : %f op/sec\n", maxf/checkf));
+    io::stdout().write_str(fmt!("get()   : %? seconds\n", appendf));
+    io::stdout().write_str(fmt!("        : %f op/sec\n", maxf/appendf));
 }
index 7c72244213306d911cba642b38d8fd33c2e2136a..ef7442b22f2cf330480301a300e09fa6585856b4 100644 (file)
@@ -118,9 +118,9 @@ fn drop_color(g: grid, colors: bitv::bitv, row: u8, col: u8) {
 
 fn write_grid(f: io::Writer, g: grid_t) {
     for u8::range(0u8, 9u8) |row| {
-        f.write_str(fmt!{"%u", (*g)[row][0] as uint});
+        f.write_str(fmt!("%u", (*g)[row][0] as uint));
         for u8::range(1u8, 9u8) |col| {
-            f.write_str(fmt!{" %u", (*g)[row][col] as uint});
+            f.write_str(fmt!(" %u", (*g)[row][col] as uint));
         }
         f.write_char('\n');
      }
index 3c2dfec2d7f93c2edc8428438ba73de2a60c20af..992e1557759bf2ab1199ba535177d414778b50fb 100644 (file)
@@ -17,11 +17,11 @@ fn main() {
 
 fn run(repeat: int, depth: int) {
     for iter::repeat(repeat as uint) {
-        debug!{"starting %.4f", precise_time_s()};
+        debug!("starting %.4f", precise_time_s());
         do task::try {
             recurse_or_fail(depth, none)
         };
-        debug!{"stopping %.4f", precise_time_s()};
+        debug!("stopping %.4f", precise_time_s());
     }
 }
 
@@ -48,7 +48,7 @@ struct r {
 
 fn recurse_or_fail(depth: int, st: option<st>) {
     if depth == 0 {
-        debug!{"unwinding %.4f", precise_time_s()};
+        debug!("unwinding %.4f", precise_time_s());
         fail;
     } else {
         let depth = depth - 1;
index 2b854f83b6710af7f054fd589f65e14a60437716..7473132940a801ae9fb42058907c931376ad4ed4 100644 (file)
@@ -68,5 +68,5 @@ fn main(args: ~[~str]) {
     let sum = match check comm::recv(port) {
       done(sum) => { sum }
     };
-    error!{"How many tasks? %d tasks.", sum};
+    error!("How many tasks? %d tasks.", sum);
 }
index 2c45896acd9fb509e3dd17c4d5e75ed6b9c5ad28..1fff4a72ca21c4a577fbfbdc42c95da472f68036 100644 (file)
@@ -82,7 +82,7 @@ fn read_word() -> option<~str> { read_word(self) }
 fn file_word_reader(filename: ~str) -> word_reader {
     match io::file_reader(filename) {
       result::ok(f) => { f as word_reader }
-      result::err(e) => { fail fmt!{"%?", e} }
+      result::err(e) => { fail fmt!("%?", e) }
     }
 }
 
@@ -101,7 +101,7 @@ fn reduce(&&word: ~str, get: map_reduce::getter<int>) {
 
     loop { match get() { some(_) => { count += 1; } none => { break; } } }
     
-    io::println(fmt!{"%s\t%?", word, count});
+    io::println(fmt!("%s\t%?", word, count));
 }
 
 struct box<T> {
@@ -190,7 +190,7 @@ fn map_task<K1: copy send, K2: const copy send hash_key, V: copy send>(
                     match pipes::recv(ctrl) {
                       ctrl_proto::reducer(c_, ctrl) => {
                         c = some(c_);
-                        move_out!{ctrl}
+                        move_out!(ctrl)
                       }
                     }
                 }
@@ -227,11 +227,11 @@ fn get<V: copy send>(p: Port<reduce_proto<V>>,
             while !is_done || ref_count > 0 {
                 match recv(p) {
                   emit_val(v) => {
-                    // error!{"received %d", v};
+                    // error!("received %d", v);
                     return some(v);
                   }
                   done => {
-                    // error!{"all done"};
+                    // error!("all done");
                     is_done = true;
                   }
                   addref => { ref_count += 1; }
@@ -262,7 +262,7 @@ fn map_reduce<K1: copy send, K2: const copy send hash_key, V: copy send>(
             let (_ready, message, ctrls) = pipes::select(ctrl);
             match option::unwrap(message) {
               ctrl_proto::mapper_done => {
-                // error!{"received mapper terminated."};
+                // error!("received mapper terminated.");
                 num_mappers -= 1;
                 ctrl = ctrls;
               }
@@ -288,7 +288,7 @@ fn map_reduce<K1: copy send, K2: const copy send hash_key, V: copy send>(
                 }
                 ctrl = vec::append_one(
                     ctrls,
-                    ctrl_proto::server::reducer(move_out!{cc}, c));
+                    ctrl_proto::server::reducer(move_out!(cc), c));
               }
             }
         }
@@ -303,7 +303,7 @@ fn main(argv: ~[~str]) {
     if vec::len(argv) < 2u && !os::getenv(~"RUST_BENCH").is_some() {
         let out = io::stdout();
 
-        out.write_line(fmt!{"Usage: %s <filename> ...", argv[0]});
+        out.write_line(fmt!("Usage: %s <filename> ...", argv[0]));
 
         return;
     }
index f0e6e1040068e8e6764fcf1f7432b3abb0de8339..db0b14edadc78daeb32c8220c9d459315e2d1177 100644 (file)
@@ -1,9 +1,9 @@
 fn test() {
     let v: int;
     v = 1; //~ NOTE prior assignment occurs here
-    debug!{"v=%d", v};
+    debug!("v=%d", v);
     v = 2; //~ ERROR re-assignment of immutable variable
-    debug!{"v=%d", v};
+    debug!("v=%d", v);
 }
 
 fn main() {
index 42781866f9a1c8444d40a48b5cafb43502b90006..0208b745d49ee5b0aedc27e89bb4a05502ec4385 100644 (file)
@@ -11,5 +11,5 @@ struct cat {
 
 fn main() {
   let nyan : cat = cat(52u, 99);
-  nyan.speak = fn@() { debug!{"meow"}; }; //~ ERROR attempted to take value of method
+  nyan.speak = fn@() { debug!("meow"); }; //~ ERROR attempted to take value of method
 }
index 352189722cfdefa451013219b7bc2699b1af904a..e6bbb50044bd31d50809e292c98721675ccf53b9 100644 (file)
@@ -1,4 +1,4 @@
 fn main() {
     #[attr]
-    debug!{"hi"}; //~ ERROR expected item
+    debug!("hi"); //~ ERROR expected item
 }
\ No newline at end of file
index 06cfb60e1a81ca0ca0886a386d3b7c9d62448700..7f00e26e34bc58dd2a6a2051b7b522dc9c41de13 100644 (file)
@@ -7,8 +7,8 @@ enum color { rgb(int, int, int), rgba(int, int, int, int), }
 fn main() {
     let red: color = rgb(255, 0, 0);
     match red {
-      rgb(r, g, b) => { debug!{"rgb"}; }
-      hsl(h, s, l) => { debug!{"hsl"}; }
+      rgb(r, g, b) => { debug!("rgb"); }
+      hsl(h, s, l) => { debug!("hsl"); }
     }
 }
 
index 6353a470f9a23235c5bd3b8129b85d84caacdbc9..5dbb0b2a33cb2f1e7cf860afe96cb29cc8d15ff1 100644 (file)
@@ -7,14 +7,14 @@ fn box_imm() {
     let _w = &mut v; //~ NOTE loan of mutable local variable granted here
     do task::spawn |move v| {
         //~^ ERROR moving out of mutable local variable prohibited due to outstanding loan
-        debug!{"v=%d", *v};
+        debug!("v=%d", *v);
     }
 
     let mut v = ~3;
     let _w = &mut v; //~ NOTE loan of mutable local variable granted here
     task::spawn(fn~(move v) {
         //~^ ERROR moving out of mutable local variable prohibited due to outstanding loan
-        debug!{"v=%d", *v};
+        debug!("v=%d", *v);
     });
 }
 
index ac4741a0e68443b91036c19b1f102a59b90f4ae8..7a6c85474b58504472cf2651b111eb4bac34b3b5 100644 (file)
@@ -7,7 +7,7 @@ struct cat : noisy {
   priv {
     let mut meows : uint;
     fn meow() {
-      error!{"Meow"};
+      error!("Meow");
       self.meows += 1u;
       if self.meows % 5u == 0u {
           self.how_hungry += 1;
@@ -25,12 +25,12 @@ fn meow() {
 
   fn eat() -> bool {
     if self.how_hungry > 0 {
-        error!{"OM NOM NOM"};
+        error!("OM NOM NOM");
         self.how_hungry -= 2;
         return true;
     }
     else {
-        error!{"Not hungry!"};
+        error!("Not hungry!");
         return false;
     }
   }
index 84cd137f23e51e9c507c678174d74bd4decf8271..57c8ec272e10944eebe832e28c4b2ec453b94be8 100644 (file)
@@ -3,7 +3,7 @@ struct cat {
     let mut meows : uint;
     fn sleep() { loop{} }
     fn meow() {
-      error!{"Meow"};
+      error!("Meow");
       meows += 1u; //~ ERROR unresolved name
       sleep();     //~ ERROR unresolved name
     }
index 2f46bd2d4735d5e5247400b6c534728a84b08656..fcc08a3d1ed44d64aeaf9c7459bc0aac6731b812 100644 (file)
@@ -5,5 +5,5 @@
 
 fn f(caller: str) { log(debug, caller); }
 
-fn main() { return f("main"); debug!{"Paul is dead"}; }
+fn main() { return f("main"); debug!("Paul is dead"); }
 
index b8e724327b07e5d99a125d5ebdd32993d00ca0e6..c6115f408535f3b786834fce33463709e43db9ea 100644 (file)
@@ -1,3 +1,3 @@
 // error-pattern: unresolved name: this_does_nothing_what_the
-fn main() { debug!{"doing"}; this_does_nothing_what_the; debug!{"boing"}; }
+fn main() { debug!("doing"); this_does_nothing_what_the; debug!("boing"); }
 
index ecef4685fd55047adb8165fe43ae9b161e63b10d..cc2fcf31e9e9cabd765d346eb3aba491a1bc92e8 100644 (file)
@@ -9,7 +9,7 @@ mod foo {
 mod bar {
     export y;
 
-    fn x() { debug!{"x"}; }
+    fn x() { debug!("x"); }
 
     fn y() { }
 }
index 4b43dc2183423ec468c18ae089070a13f1f3dec4..5c3ca527068fe0b17e649f53e591b4a5cb529e4e 100644 (file)
@@ -3,5 +3,5 @@
 // Don't know how to deal with a syntax extension appearing after an
 // item attribute. Probably could use a better error message.
 #[foo = "bar"]
-fmt!{"baz"}
+fmt!("baz")
 fn main() { }
\ No newline at end of file
index 94df92825a215057f95e44da4678207defcb32d7..9b0bd51071b423a6a3576d69a541c974b33507a5 100644 (file)
@@ -1,2 +1,2 @@
 // error-pattern:macro undefined
-fn main() { iamnotanextensionthatexists!{""}; }
+fn main() { iamnotanextensionthatexists!(""); }
index 2b28e009b95ff90b6f3bd7ef57aed7ab20a7eb9b..e169db23bf267c996bc3efb79f4b4addcbe28994 100644 (file)
@@ -1,3 +1,3 @@
 // error-pattern:#env takes between 1 and 1 arguments
 
-fn main() { env!{}; }
+fn main() { env!(); }
index 009da5e38df7443cb3cfc96b353a4f8c3c5d847e..f9856f96038d82c554c61ee30560e5abf667a293 100644 (file)
@@ -1,3 +1,3 @@
 // error-pattern:requires a string
 
-fn main() { env!{10}; }
+fn main() { env!(10); }
index 02e6fb2940f3cc9ba7f1fb270cf85a33383d4ae2..ee5b1b4af74e0de7776ebf952e62cc1f00cbb89a 100644 (file)
@@ -1,3 +1,3 @@
 // error-pattern:#env takes between 1 and 1 arguments
 
-fn main() { env!{"one", "two"}; }
+fn main() { env!("one", "two"); }
index 09330d46aacf66bbc33ecfb9bc8ae6e4a47ca799..3737f3097e816a44bbab5ad9f99af281df5631ae 100644 (file)
@@ -1,3 +1,3 @@
 // error-pattern:missing type
 
-fn main() { fmt!{"%+"}; }
+fn main() { fmt!("%+"); }
index 701e5f56827fdf22b799ec4265f5065d615d04ce..b291fbae2256fc9c5e880c4ea6d90e2353819f27 100644 (file)
@@ -1,3 +1,3 @@
 // error-pattern:#fmt needs at least 1 arguments
 
-fn main() { fmt!{}; }
+fn main() { fmt!(); }
index ceae0f62a2406518f8df11f2682599c9826c9213..0e2109fac4f0c0a601f66897808f0a140a0fdf0e 100644 (file)
@@ -4,5 +4,5 @@ fn main() {
     // #fmt's first argument must be a literal.  Hopefully this
     // restriction can be eased eventually to just require a
     // compile-time constant.
-    let x = fmt!{"a" + "b"};
+    let x = fmt!("a" + "b");
 }
index d325b2dbf7c926c01c5e1526f4fb2aa8be4a8480..cc10845fd9f128ad41a4d62d51cb89f397a102be 100644 (file)
@@ -4,5 +4,5 @@ fn main() {
     // #fmt's first argument must be a literal.  Hopefully this
     // restriction can be eased eventually to just require a
     // compile-time constant.
-    let x = fmt!{20};
+    let x = fmt!(20);
 }
index 2804a64c35b6f067a4ef410739960a0654a1f42f..322b0d00b770aac7b075ffa96f6699c099cf50dd 100644 (file)
@@ -2,4 +2,4 @@
 
 use std;
 
-fn main() { let s = fmt!{"%s%s%s", "test", "test"}; }
+fn main() { let s = fmt!("%s%s%s", "test", "test"); }
index 447d84aed808948f0153f7acbd2a6f42ae8f994b..c9b54c9aa94e3ad9a123d629836f4b8816b5c4d4 100644 (file)
@@ -2,4 +2,4 @@
 
 use std;
 
-fn main() { let s = fmt!{"%s", "test", "test"}; }
+fn main() { let s = fmt!("%s", "test", "test"); }
index bfb6c99d351d84094a1a25b93b68a608133dff6d..d08fdf70f5c1187560e6376e218b0409fcb4d789 100644 (file)
@@ -1,3 +1,3 @@
 // error-pattern:unknown type
 
-fn main() { fmt!{"%w"}; }
+fn main() { fmt!("%w"); }
index 0f3781f0438f9e96a06e724513781387c4f1c15b..d8a9f4fa98dff8e18dbaad1386eea4feeabbc08f 100644 (file)
@@ -2,5 +2,5 @@
 
 fn main() {
     // Can't use a sign on unsigned conversions
-    fmt!{"%+u", 10u};
+    fmt!("%+u", 10u);
 }
index d847ff43a6a835c26a34132c2920efdc28674c46..001adb521cc30e8585c5dc4421ec49c34742e1e2 100644 (file)
@@ -2,5 +2,5 @@
 
 fn main() {
     // Can't use a space on unsigned conversions
-    fmt!{"% u", 10u};
+    fmt!("% u", 10u);
 }
index cb12f54c789b9062cdc8772f120dcca77aab0fc4..e8367afbb0d110d4b6411ad429278b535c991bdb 100644 (file)
@@ -1,3 +1,3 @@
 // error-pattern:unterminated conversion
 
-fn main() { fmt!{"%"}; }
+fn main() { fmt!("%"); }
index 697a135d0cc956d3f1d499588262fa23cef0ef74..b8d26822c1ebad59d6ae78ae740387ae7105c359 100644 (file)
@@ -16,4 +16,4 @@ fn bitv_to_str(enclosing: fn_info, v: ~bitv::bitv) -> str {
     return s;
 }
 
-fn main() { debug!{"OK"}; }
+fn main() { debug!("OK"); }
index a1455ffa1f63f2f6332462e6b1560678ad09cdf5..93ad7dcf975c4b7510a7957d46e4ca63996be18a 100644 (file)
@@ -7,10 +7,10 @@ mod module_of_many_things {
     export f2;
     export f4;
 
-    fn f1() { debug!{"f1"}; }
-    fn f2() { debug!{"f2"}; }
-    fn f3() { debug!{"f3"}; }
-    fn f4() { debug!{"f4"}; }
+    fn f1() { debug!("f1"); }
+    fn f2() { debug!("f2"); }
+    fn f3() { debug!("f3"); }
+    fn f4() { debug!("f4"); }
 }
 
 
index a3be8b17604fca95e558d8ab659eb7af7ce353aa..637b78e4eed79c663ed92eeab5a4fefb48f4fe2e 100644 (file)
@@ -5,7 +5,7 @@ mod circ1 {
     export f1;
     export f2;
     export common;
-    fn f1() { debug!{"f1"}; }
+    fn f1() { debug!("f1"); }
     fn common() -> uint { return 0u; }
 }
 
@@ -14,7 +14,7 @@ mod circ2 {
     export f1;
     export f2;
     export common;
-    fn f2() { debug!{"f2"}; }
+    fn f2() { debug!("f2"); }
     fn common() -> uint { return 1u; }
 }
 
index 582096ab31fecc6a8a4cf9de29b75b71ae0a2c7e..f06ff498fccc63f7ce8070fb6aecfd490413a27f 100644 (file)
@@ -3,6 +3,6 @@
 import zed::bar;
 import zed::baz;
 mod zed {
-    fn bar() { debug!{"bar"}; }
+    fn bar() { debug!("bar"); }
 }
 fn main(args: ~[str]) { bar(); }
index 2543db0d059e8cb7337e5b7cc4cdc847123772ed..75493f2a0374514fc29cce6709d3d3967105d7a1 100644 (file)
@@ -2,6 +2,6 @@
 import baz::zed::bar;
 mod baz { }
 mod zed {
-    fn bar() { debug!{"bar3"}; }
+    fn bar() { debug!("bar3"); }
 }
 fn main(args: ~[str]) { bar(); }
index 395e5e8b4127fdae9a7a72623424542c4c580ed9..b825901f4a62ce18b364619230d9fbbb29bbdbfa 100644 (file)
@@ -1,4 +1,4 @@
 // error-pattern: unresolved
 import main::bar;
 
-fn main(args: ~[str]) { debug!{"foo"}; }
+fn main(args: ~[str]) { debug!("foo"); }
index c3ca71c67aa80cc0c3a952a86e02a2ace1cb2eae..6717434273fd730f324986934f77f42008620d98 100644 (file)
@@ -3,4 +3,4 @@
 mod a { import foo = b::foo; export foo; }
 mod b { import foo = a::foo; export foo; }
 
-fn main(args: ~[str]) { debug!{"loop"}; }
+fn main(args: ~[str]) { debug!("loop"); }
index 1da1289f18ea8136da37fe9449a51c68e83db959..ccd13b709a619245b45d4153f1ef133eadba18d5 100644 (file)
@@ -3,5 +3,5 @@
 fn main() {
     #macro[[#apply[f, [x, ...]], f(x, ...)]];
     fn add(a: int, b: int) -> int { return a + b; }
-    assert (apply!{add, [y, 15]} == 16); //~ ERROR unresolved name: y
+    assert (apply!(add, [y, 15]) == 16); //~ ERROR unresolved name: y
 }
index 3b16071da2a95245cd62e34f19fdc15b3d8ccbbf..62cc4d4f5b2aa910fc1fd4041841eb2c5127c6ee 100644 (file)
@@ -1,5 +1,5 @@
 // Regresion test for issue #1448 and #1386
 
 fn main() {
-    debug!{"%u", 10i}; //~ ERROR mismatched types
+    debug!("%u", 10i); //~ ERROR mismatched types
 }
index edfc22f93e950b66522251edba6dd36285bbb5a9..29adc91a4acc305bfd13eb57146e94a505068cfb 100644 (file)
@@ -3,7 +3,7 @@
 fn main() {
     let x: int;
     if 1 > 2 {
-        debug!{"whoops"};
+        debug!("whoops");
     } else {
         x = 10;
     }
index dbfaecf1817f5be4a62529ad77b39313ed9f24b8..c013c1cb380a2d77da5624a1e85da45f9300880f 100644 (file)
@@ -4,7 +4,7 @@ fn test(cond: bool) {
         v = 3;
         break;
     }
-    debug!{"%d", v}; //~ ERROR use of possibly uninitialized variable: `v`
+    debug!("%d", v); //~ ERROR use of possibly uninitialized variable: `v`
 }
 
 fn main() {
index c2c3d0127c523f3d1dd82b0981b5d954bf0c81b7..bb54685f752ff945a7f9159ce4ffffd57f1439b5 100644 (file)
@@ -6,5 +6,5 @@ fn f(x: int) -> int { return body }
                 f
             }]];
 
-    assert (mylambda!{y * 1, y * 2}(8) == 16);
+    assert (mylambda!(y * 1, y * 2)(8) == 16);
 }
index 602f074813b39ea85adda9a9953f64eb851ddae8..477a297c2ab952cff10b91991bbf47895746f02a 100644 (file)
@@ -3,6 +3,6 @@
 fn main() {
     #macro[[#trivial[], 1 * 2 * 4 * 2 * 1]];
 
-    assert (trivial!{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} ==
+    assert (trivial!(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) ==
                 16);
 }
index cbecec982a2bcd5cfae9ab9bbadff45bb883c9d0..98ebec81045f0f9ee18fea68d4b38b0e73fc342c 100644 (file)
@@ -1,5 +1,5 @@
 // error-pattern: is not UTF-8
 
 fn foo() {
-    include!{"not-utf8.bin"}
+    include!("not-utf8.bin")
 }
index 1add6f7f3fe972e91cd40a9d693b912e2eda4605..9737b195cfa2a47ae489aa53ae9cb26f41ae9c99 100644 (file)
@@ -40,7 +40,7 @@
     range(from, to, noop);
 }
 
-fn print(i: uint) { error!{"i=%u", i}; }
+fn print(i: uint) { error!("i=%u", i); }
 
 pure fn noop(_i: uint) {}
 
index ea1181cd94a8d42fa37c5955cc3e4d0480ab6961..9bfc39c32dccd10a22a54dde2d10bad8d374e070 100644 (file)
@@ -19,6 +19,6 @@ fn chase_cat_2() {
 fn main() {
     let d = dog();
     d.chase_cat();
-    debug!{"cats_chased: %u", d.cats_chased};
+    debug!("cats_chased: %u", d.cats_chased);
 }
 
index 58fa6ae4712d87cf9c46b6d733231bc5b798f3cd..9f32434ae1a7b2226a9278ddd15e70b6ef3d72b1 100644 (file)
@@ -21,5 +21,5 @@ fn return_it() -> int {
 
 fn main() {
     let x = return_it();
-    debug!{"foo=%d", x};
+    debug!("foo=%d", x);
 }
index 1b59839f092a6d54234ca6a2a745e243e462b368..c0b87086db8b32d413edfc702e72592b15c14438 100644 (file)
@@ -13,5 +13,5 @@ fn return_it() -> &a/int {
 
 fn main() {
     let x = return_it();
-    debug!{"foo=%d", *x};
+    debug!("foo=%d", *x);
 }
index 557394de741334663d38ffca4b3abe35e5f1a635..9abaa75590ec8de802627a1570628629762d0500 100644 (file)
@@ -16,5 +16,5 @@ fn return_it() -> &int {
 
 fn main() {
     let x = return_it();
-    debug!{"foo=%d", *x};
+    debug!("foo=%d", *x);
 }
index 24ac09a2d417371ece7768b17a907778fd015c37..d1b7a7721f23e50d69ec0bc59a4da1646bd7c65a 100644 (file)
@@ -7,5 +7,5 @@
  */
 
 fn main() {
-  debug!{"hello, world."};
+  debug!("hello, world.");
 }
index ea4563a579c2b4789d69d1fdb514f2082eaf8a5e..4bc01f1c6a9b05159658c78fed8c4b3d4e852dc4 100644 (file)
@@ -2,4 +2,4 @@
 // is probably not necessary anymore (#2882)
 
 fn blk1(b: fn()) -> fn@() { return fn@() { }; }
-fn test1() { (do blk1 { debug!{"hi"}; })(); }
+fn test1() { (do blk1 { debug!("hi"); })(); }
index a5890b39fda54292352f3dc3498c6cf239a924c3..0db43856612ad99e01282d026ddb085dfbb65402 100644 (file)
@@ -10,8 +10,8 @@ fn main() {
     // wrap around to a small number.
 
     let idx = uint::max_value & !(uint::max_value >> 1u);
-    error!{"ov2 idx = 0x%x", idx};
+    error!("ov2 idx = 0x%x", idx);
 
     // This should fail.
-    error!{"ov2 0x%x",  x[idx]};
+    error!("ov2 0x%x",  x[idx]);
 }
\ No newline at end of file
index c87557804084c0669442268577f9429879e21d9b..949d303eb01aad33d411909a29939fb2fee3b9e2 100644 (file)
@@ -12,17 +12,17 @@ fn main() {
     // This test is only meaningful on 32-bit hosts.
 
     let idx = u64::max_value & !(u64::max_value >> 1u);
-    error!{"ov3 idx = 0x%8.8x%8.8x",
+    error!("ov3 idx = 0x%8.8x%8.8x",
            (idx >> 32) as uint,
-           idx as uint};
+           idx as uint);
 
     // This should fail.
-    error!{"ov3 0x%x",  x[idx]};
+    error!("ov3 0x%x",  x[idx]);
 }
 
 #[cfg(target_arch="x86_64")]
 fn main() {
     // This version just fails anyways, for symmetry on 64-bit hosts.
     let x = ~[1u,2u,3u];
-    error!{"ov3 0x%x",  x[200]};
+    error!("ov3 0x%x",  x[200]);
 }
index fdaaf2fe445af041da1035ad9039698d538b1ac0..f35759639623af6cfef4109beca9ea03bc8d550a 100644 (file)
@@ -12,13 +12,13 @@ fn main() {
     do vec::as_buf(x) |p, _len| {
         let base = p as uint;                     // base = 0x1230 say
         let idx = base / sys::size_of::<uint>();  // idx  = 0x0246 say
-        error!{"ov1 base = 0x%x", base};
-        error!{"ov1 idx = 0x%x", idx};
-        error!{"ov1 sizeof::<uint>() = 0x%x", sys::size_of::<uint>()};
-        error!{"ov1 idx * sizeof::<uint>() = 0x%x",
-               idx * sys::size_of::<uint>()};
+        error!("ov1 base = 0x%x", base);
+        error!("ov1 idx = 0x%x", idx);
+        error!("ov1 sizeof::<uint>() = 0x%x", sys::size_of::<uint>());
+        error!("ov1 idx * sizeof::<uint>() = 0x%x",
+               idx * sys::size_of::<uint>());
 
         // This should fail.
-        error!{"ov1 0x%x",  x[idx]};
+        error!("ov1 0x%x",  x[idx]);
     }
 }
\ No newline at end of file
index 4b5a41c6eb2b28fcadf001329e3e31f5cac2c148..71343c6751ecaae3ab481e22892c5ef1ad247acf 100644 (file)
@@ -24,7 +24,7 @@ fn main() {
     for iter::repeat(10u) {
         do task::spawn {
             let result = count(5u);
-            debug!{"result = %?", result};
+            debug!("result = %?", result);
             fail;
         };
     }
index e45207c2ec693d549465693d168bbe1edcb42911..27ece3b45c9624100d82673d5c9a90a8fd62d376 100644 (file)
@@ -1,4 +1,4 @@
 // error-pattern:meh
 use std;
 
-fn main() { let str_var: ~str = ~"meh"; fail fmt!{"%s", str_var}; }
+fn main() { let str_var: ~str = ~"meh"; fail fmt!("%s", str_var); }
index 87bf362fe97ee2ea62c1521bbcb8396298d1dd50..af7c673913ee6bb8edfc99f34df24bf00243213e 100644 (file)
@@ -92,7 +92,7 @@ fn check_pp<T>(cx: fake_ext_ctxt,
     let str = mem_buffer_str(buf);
     stdout().write_line(str);
     if expect != ~"" {
-        error!{"expect: '%s', got: '%s'", expect, str};
+        error!("expect: '%s', got: '%s'", expect, str);
         assert str == expect;
     }
 }
index af2310926f1c6e8b3b559515d8ff56a098121dbb..4def6d7601cafc82bea8209bc252821aa91e0b91 100644 (file)
@@ -17,7 +17,7 @@ fn f(c: comm::_chan<int>) {
 
     loop {
         // spin waiting for the parent to kill us.
-        debug!{"child waiting to die..."};
+        debug!("child waiting to die...");
 
         // while waiting to die, the messages we are
         // sending to the channel are never received
@@ -35,5 +35,5 @@ fn main() {
     // synchronize on event from child.
     i = p.recv();
 
-    debug!{"parent exiting, killing child"};
+    debug!("parent exiting, killing child");
 }
index d2fd007f1a8369061d30be05d56d9e0c4674eece..410bc9b570b6161145fd3d687719e7941a096ca5 100644 (file)
@@ -8,7 +8,7 @@ fn f<A:copy owned>(a: A, b: u16) -> fn@() -> (A, u16) {
 
 fn main() {
     let (a, b) = f(22_u64, 44u16)();
-    debug!{"a=%? b=%?", a, b};
+    debug!("a=%? b=%?", a, b);
     assert a == 22u64;
     assert b == 44u16;
 }
\ No newline at end of file
index 8d4315b8daa07809707cd8361bfa73e690dd3662..1153c801dd98db122c44ca8d14d32e440bf578d6 100644 (file)
@@ -23,7 +23,7 @@ fn main() {
     let z = f(~x, y);
     make_cycle(z);
     let (a, b) = z();
-    debug!{"a=%u b=%u", *a as uint, b as uint};
+    debug!("a=%u b=%u", *a as uint, b as uint);
     assert *a == x;
     assert b == y;
 }
\ No newline at end of file
index 5c51fd0d34da17ecb014c8b475c7a745f045e8dd..c77b0432ad62e63d97ca0cf989fb2d3e9b6c888b 100644 (file)
@@ -19,4 +19,4 @@ fn foo<T>(y: option<T>) {
     return;
 }
 
-fn main() { debug!{"hello"}; foo::<int>(some::<int>(5)); }
+fn main() { debug!("hello"); foo::<int>(some::<int>(5)); }
index ba8bef7e124a0553d79d2d4643215fb6cb5266a8..0e276acb8c39d7b188a76972c3df8412e7374938 100644 (file)
@@ -14,7 +14,7 @@ fn foo(s: @int) {
         log(debug, y); // ref up then down
 
       }
-      _ => { debug!{"?"}; fail; }
+      _ => { debug!("?"); fail; }
     }
     log(debug, sys::refcount(s));
     assert (sys::refcount(s) == count + 1u);
index e5f86159421338efd8e8a992711afe0dfc3dfa2c..8432077cd25ce755a32c8096652edbaa0225f50e 100644 (file)
@@ -2,8 +2,8 @@
 
 fn altlit(f: int) -> int {
     match check f {
-      10 => { debug!{"case 10"}; return 20; }
-      11 => { debug!{"case 11"}; return 22; }
+      10 => { debug!("case 10"); return 20; }
+      11 => { debug!("case 11"); return 22; }
     }
 }
 
index 447fd417e8d3fafb1d3644824dfb7eeee5251214..8a91257271e873b379f4e24dd816cbe5ec6f321c 100644 (file)
@@ -1,7 +1,7 @@
 enum maybe<T> { nothing, just(T), }
 
 fn foo(x: maybe<int>) {
-    match x { nothing => { error!{"A"}; } just(a) => { error!{"B"}; } }
+    match x { nothing => { error!("A"); } just(a) => { error!("B"); } }
 }
 
 fn main() { }
index 0c75cafa204b79e882378016888078b43d5d9c73..9fdbe59780f3e3b0a0de0946847e017c930f410b 100644 (file)
@@ -11,9 +11,9 @@ enum color {
 fn process(c: color) -> int {
     let mut x: int;
     match c {
-      rgb(r, _, _) => { debug!{"rgb"}; log(debug, r); x = r; }
-      rgba(_, _, _, a) => { debug!{"rgba"}; log(debug, a); x = a; }
-      hsl(_, s, _) => { debug!{"hsl"}; log(debug, s); x = s; }
+      rgb(r, _, _) => { debug!("rgb"); log(debug, r); x = r; }
+      rgba(_, _, _, a) => { debug!("rgba"); log(debug, a); x = a; }
+      hsl(_, s, _) => { debug!("hsl"); log(debug, s); x = s; }
     }
     return x;
 }
index 7548d171d1c0d2d248bb35f4a4d50db1b46b257c..4ca0d24b7cff31700f113d14846713c43fb6037e 100644 (file)
@@ -1,7 +1,7 @@
 fn main() {
     match ~100 {
       ~x => {
-        debug!{"%?", x};
+        debug!("%?", x);
         assert x == 100;
       }
     }
index cd7abd4b40049195775a2c85aad75c18c363519c..af3ec0652dd3887f938af5c6d2177f3ad444ba1a 100644 (file)
@@ -16,7 +16,7 @@ fn test_ser_and_deser<A>(a1: A,
     // check the pretty printer:
     io_ser_fn(io::stdout(), a1);
     let s = io::with_str_writer(|w| io_ser_fn(w, a1) );
-    debug!{"s == %?", s};
+    debug!("s == %?", s);
     assert s == expected;
 
     // check the EBML serializer:
index 862020b65548cda7d7acd88318ae407f01228ebd..a3df02fd686a3cd5b41a7def50c90cea62385b6b 100644 (file)
@@ -18,15 +18,15 @@ fn main() {
     let mut n: int = 0;
     n = recv(p);
     n = recv(p);
-    //    debug!{"Finished."};
+    //    debug!("Finished.");
 }
 
 fn b(c: Chan<int>) {
-    //    debug!{"task b0"};
-    //    debug!{"task b1"};
-    //    debug!{"task b2"};
-    //    debug!{"task b3"};
-    //    debug!{"task b4"};
-    //    debug!{"task b5"};
+    //    debug!("task b0");
+    //    debug!("task b1");
+    //    debug!("task b2");
+    //    debug!("task b3");
+    //    debug!("task b4");
+    //    debug!("task b5");
     send(c, 10);
 }
index ae884c9c6d5a6029ea2c6c47a0483208895f7ab9..2f0fe8fe0065847eb1ad5ea4116474672276885d 100644 (file)
@@ -9,7 +9,7 @@
 import comm::recv;
 import task;
 
-fn a(c: Chan<int>) { debug!{"task a0"}; debug!{"task a1"}; send(c, 10); }
+fn a(c: Chan<int>) { debug!("task a0"); debug!("task a1"); send(c, 10); }
 
 fn main() {
     let p = port();
@@ -19,14 +19,14 @@ fn main() {
     let mut n: int = 0;
     n = recv(p);
     n = recv(p);
-    debug!{"Finished."};
+    debug!("Finished.");
 }
 
 fn b(c: Chan<int>) {
-    debug!{"task b0"};
-    debug!{"task b1"};
-    debug!{"task b2"};
-    debug!{"task b2"};
-    debug!{"task b3"};
+    debug!("task b0");
+    debug!("task b1");
+    debug!("task b2");
+    debug!("task b2");
+    debug!("task b3");
     send(c, 10);
 }
index f3ebfa389045e38d80a6de00e032a02ed1c1ff6a..abef48171ab2bc4188c5ee19a0c1589c904d4437 100644 (file)
 
 fn a(c: Chan<int>) {
     if true {
-        debug!{"task a"};
-        debug!{"task a"};
-        debug!{"task a"};
-        debug!{"task a"};
-        debug!{"task a"};
+        debug!("task a");
+        debug!("task a");
+        debug!("task a");
+        debug!("task a");
+        debug!("task a");
     }
     send(c, 10);
 }
@@ -40,17 +40,17 @@ fn main() {
     log(debug, x);
     n = recv(p);
     n = recv(p);
-    debug!{"children finished, root finishing"};
+    debug!("children finished, root finishing");
 }
 
 fn b(c: Chan<int>) {
     if true {
-        debug!{"task b"};
-        debug!{"task b"};
-        debug!{"task b"};
-        debug!{"task b"};
-        debug!{"task b"};
-        debug!{"task b"};
+        debug!("task b");
+        debug!("task b");
+        debug!("task b");
+        debug!("task b");
+        debug!("task b");
+        debug!("task b");
     }
     send(c, 10);
 }
index 9697084fe5cc623012a86be56390b6ade10e75f5..2a2a3c3c612db74335cd33604ffd25bbac82402d 100644 (file)
@@ -136,9 +136,9 @@ fn test_class() {
   let r = p(1, 2);
   
   unsafe {
-  error!{"q = %x, r = %x",
+  error!("q = %x, r = %x",
          (unsafe::reinterpret_cast::<*p, uint>(ptr::addr_of(q))),
-         (unsafe::reinterpret_cast::<*p, uint>(ptr::addr_of(r)))};
+         (unsafe::reinterpret_cast::<*p, uint>(ptr::addr_of(r))));
   }
   assert(q == r);
   r.y = 17;
index f3eed8cc26de8fcb674028be51666eb072b60c9b..6db380735cba75a575b03e46762c559999c69e6e 100644 (file)
@@ -19,8 +19,8 @@ fn main() {
     add_int(ints, 44);
 
     for iter_ints(ints) |i| {
-        error!{"int = %d", *i};
+        error!("int = %d", *i);
     }
 
-    error!{"ints=%?", ints};
+    error!("ints=%?", ints);
 }
index 101f9c787d31205232b4bb60c3d1c3bccab685c9..373830d77afd89125f9da8d4e28c97450f883a3b 100644 (file)
@@ -9,7 +9,7 @@ fn main() {
 
         x = @{f: ~4};
 
-        debug!{"ptr::addr_of(*b_x) = %x", ptr::addr_of(*b_x) as uint};
+        debug!("ptr::addr_of(*b_x) = %x", ptr::addr_of(*b_x) as uint);
         assert *b_x == 3;
         assert ptr::addr_of(*x.f) != ptr::addr_of(*b_x);
       }
index 17831948b54fdf2739e9fa3a718d18b0ec9fc324..7ab2dc4b99da937ed512cda945acb769d2da9b56 100644 (file)
@@ -14,7 +14,7 @@ fn main() {
         assert ptr::addr_of(*x.f) == ptr::addr_of(*b_x);
         x = @{f: ~4};
 
-        debug!{"ptr::addr_of(*b_x) = %x", ptr::addr_of(*b_x) as uint};
+        debug!("ptr::addr_of(*b_x) = %x", ptr::addr_of(*b_x) as uint);
         assert *b_x == 3;
         assert ptr::addr_of(*x.f) != ptr::addr_of(*b_x);
     }
index c5d5fd96673345100d5e60926a63fcee0231c98f..599879f82f1dabb9e185dee55e72e322cb8c248f 100644 (file)
@@ -9,7 +9,7 @@ fn main() {
 
         *x = @{f: ~4};
 
-        debug!{"ptr::addr_of(*b_x) = %x", ptr::addr_of(*b_x) as uint};
+        debug!("ptr::addr_of(*b_x) = %x", ptr::addr_of(*b_x) as uint);
         assert *b_x == 3;
         assert ptr::addr_of(*x.f) != ptr::addr_of(*b_x);
       }
index 05f403425b3fa32bde8713ce3346e37dbb87eab9..bd43ad65cffbd5837fddd3cb3a55bddeed76436a 100644 (file)
@@ -14,7 +14,7 @@ fn main() {
         assert ptr::addr_of(*x.f) == ptr::addr_of(*b_x);
         *x = @{f: ~4};
 
-        debug!{"ptr::addr_of(*b_x) = %x", ptr::addr_of(*b_x) as uint};
+        debug!("ptr::addr_of(*b_x) = %x", ptr::addr_of(*b_x) as uint);
         assert *b_x == 3;
         assert ptr::addr_of(*x.f) != ptr::addr_of(*b_x);
     }
index 886d9172cec7b7d751162bb001499e5cbe93f54e..8d59975204b1a21e7b1d12555cebd5e9fe97bf92 100644 (file)
@@ -14,7 +14,7 @@ fn main() {
         assert ptr::addr_of(*x) == ptr::addr_of(*b_x);
         x = @22;
 
-        debug!{"ptr::addr_of(*b_x) = %x", ptr::addr_of(*b_x) as uint};
+        debug!("ptr::addr_of(*b_x) = %x", ptr::addr_of(*b_x) as uint);
         assert *b_x == 3;
         assert ptr::addr_of(*x) != ptr::addr_of(*b_x);
     }
index c5d815834b2d94b62eacce4aa228f862863f2e73..291ebb085566fb5a956877a5f23abb0226885f55 100644 (file)
@@ -14,13 +14,13 @@ fn testfn(cond: bool) {
         exp = 4;
     }
 
-    debug!{"*r = %d, exp = %d", *r, exp};
+    debug!("*r = %d, exp = %d", *r, exp);
     assert *r == exp;
 
     x = @5;
     y = @6;
 
-    debug!{"*r = %d, exp = %d", *r, exp};
+    debug!("*r = %d, exp = %d", *r, exp);
     assert *r == exp;
 }
 
index 30f33beea4822bbc157795eb94c10f6fff85f81a..e126ecc4340b535f53371d2a2c462ea1450f452c 100644 (file)
@@ -14,7 +14,7 @@ fn main() {
         assert ptr::addr_of(*x.f) == ptr::addr_of(*b_x);
         x = @{f: ~4};
 
-        debug!{"ptr::addr_of(*b_x) = %x", ptr::addr_of(*b_x) as uint};
+        debug!("ptr::addr_of(*b_x) = %x", ptr::addr_of(*b_x) as uint);
         assert *b_x == 3;
         assert ptr::addr_of(*x.f) != ptr::addr_of(*b_x);
     }
index e9f9da8d16f69fda1bb77cf66c313ae48b6976c2..df8539634eb5b3c538ebea4725dd4eea8f9feb73 100644 (file)
@@ -9,7 +9,7 @@
 fn length_is_even(vs: @int) -> bool { return true; }
 
 fn foo(acc: int, n: int) {
-    if is_odd(n) && length_is_even(some_box(1)) { error!{"bloop"}; }
+    if is_odd(n) && length_is_even(some_box(1)) { error!("bloop"); }
 }
 
 fn main() { foo(67, 5); }
index 98ca1bc6370a4c4d6d52c04a9d3fc931c26f862c..6f91206a7f698e992901d704cf7a872261eabcc2 100644 (file)
@@ -9,7 +9,7 @@
 fn length_is_even(vs: @int) -> bool { return true; }
 
 fn foo(acc: int, n: int) {
-    if is_odd(n) || length_is_even(some_box(1)) { error!{"bloop"}; }
+    if is_odd(n) || length_is_even(some_box(1)) { error!("bloop"); }
 }
 
 fn main() { foo(67, 5); }
index e243867b2683b750408f0a8f7632ff5a93be1cc7..e189066c09f2afb979fa3091a4b2528673b38c56 100644 (file)
@@ -7,6 +7,6 @@
 fn main() {
     let foo: int = 17;
     let bfoo: box<int> = {c: @foo};
-    debug!{"see what's in our box"};
+    debug!("see what's in our box");
     assert (unbox::<int>(bfoo) == foo);
 }
index 5a174f4c4aa231a03ed154ce58a03a7716700076..ca181c07bd50d1512058d58c92f9c0623c66a4b5 100644 (file)
@@ -3,7 +3,7 @@
 
 fn it_takes_two(x: @int, -y: @int) -> int {
     free(y);
-    debug!{"about to deref"};
+    debug!("about to deref");
     *x
 }
 
index 72e16d78511c778d9dbf415d9fe6324d611695a7..0a261e8a38f42636e23c9b882267c381b09170ca 100644 (file)
@@ -1,4 +1,4 @@
 fn main() {
     let x = 3;
-    debug!{"&x=%x", ptr::to_uint(&x)};
+    debug!("&x=%x", ptr::to_uint(&x));
 }
\ No newline at end of file
index 95de5dddf6df1b9bded7b57a65fa90651a10d70d..aeeb80f10ccce0d5083eb22aba6998b71cd1f76f 100644 (file)
@@ -7,6 +7,6 @@
 fn main() {
     let p = @22u;
     let r = foo(p);
-    debug!{"r=%u", r};
+    debug!("r=%u", r);
     assert r == 22u;
 }
index fab76a02569b53137b7c5e1ac3fa93f2335a6a77..764208a6608698b5fd72911921d09199e9a3ce65 100644 (file)
@@ -6,13 +6,13 @@
 
 fn main() {
     //let bt0 = sys::frame_address();
-    //debug!{"%?", bt0};
+    //debug!("%?", bt0);
 
     do 3u.to(10u) |i| {
-        io::print(fmt!{"%u\n", i});
+        io::print(fmt!("%u\n", i));
 
         //let bt1 = sys::frame_address();
-        //debug!{"%?", bt1};
+        //debug!("%?", bt1);
         //assert bt0 == bt1;
     }
 }
index 0ba2a2190feb4d332e2e26b3a13f115392fc7704..48cdf2132691b67db30a87c91c30b1d8265101d7 100644 (file)
@@ -5,9 +5,9 @@
 
 fn main() {
     //let bt0 = sys::rusti::frame_address(1u32);
-    //debug!{"%?", bt0};
+    //debug!("%?", bt0);
     do cci_iter_lib::iter(~[1, 2, 3]) |i| {
-        io::print(fmt!{"%d", i});
+        io::print(fmt!("%d", i));
         //assert bt0 == sys::rusti::frame_address(2u32);
     }
 }
index 51bc773b5c878ba62e1233f2b9e8d4e85c9db34d..a29710eff85c7188b176b59683c16632259bfd34 100644 (file)
@@ -11,12 +11,12 @@ fn main() {
     // sys::frame_address() to determine if we are inlining is
     // actually working.
     //let bt0 = sys::frame_address();
-    //debug!{"%?", bt0};
+    //debug!("%?", bt0);
     do iter(~[1u, 2u, 3u]) |i| {
-        io::print(fmt!{"%u\n", i});
+        io::print(fmt!("%u\n", i));
 
         //let bt1 = sys::frame_address();
-        //debug!{"%?", bt1};
+        //debug!("%?", bt1);
 
         //assert bt0 != bt1;
     }
index 0759d3587a998dcbfba67d5ddbaa6fee1f439aca..edc582cb0068bf27571d963c9058b8ca2eb205ee 100644 (file)
@@ -4,7 +4,7 @@ struct cat {
     #[cat_maker]
     new(name: ~str) { self.name = name; }
     #[cat_dropper]
-    drop { error! {"%s landed on hir feet",self.name }; }
+    drop { error!("%s landed on hir feet",self.name); }
     name: ~str;
 }
 
index ff1b85125ea30ff8dd398b09dabd8e6356c52715..772aea9867bc50153c90477ea9c9712c8593a52a 100644 (file)
@@ -9,7 +9,7 @@ struct cat {
   /**
      Actually, cats don't always land on their feet when you drop them.
   */
-  drop { error!{"%s landed on hir feet", self.name}; }
+  drop { error!("%s landed on hir feet", self.name); }
 }
 
 fn main() {
index 73061c85dfb9c9e15c485f1058ae4df70e85e2b4..9206d89394d59c1b60b3c572ff77b9fcc59f243a 100644 (file)
@@ -6,7 +6,7 @@
 
 fn print_out<T: ToStr>(thing: T, expected: ~str) {
   let actual = thing.to_str();
-  debug!{"%s", actual};
+  debug!("%s", actual);
   assert(actual == expected);
 }
 
index deb0462da843dceaca6490d50983fd4ebdc0736a..a10733c79d9b52ff6d33ba3e7a0a1bdf15c20ad2 100644 (file)
@@ -7,7 +7,7 @@
   priv {
     let mut meows : uint;
     fn meow() {
-      error!{"Meow"};
+      error!("Meow");
       self.meows += 1u;
       if self.meows % 5u == 0u {
           self.how_hungry += 1;
@@ -25,12 +25,12 @@ fn meow() {
 
   fn eat() -> bool {
     if self.how_hungry > 0 {
-        error!{"OM NOM NOM"};
+        error!("OM NOM NOM");
         self.how_hungry -= 2;
         return true;
     }
     else {
-        error!{"Not hungry!"};
+        error!("Not hungry!");
         return false;
     }
   }
@@ -40,7 +40,7 @@ fn to_str() -> str { self.name }
 
 fn print_out<T: to_str>(thing: T, expected: str) {
   let actual = thing.to_str();
-  debug!{"%s", actual};
+  debug!("%s", actual);
   assert(actual == expected);
 }
 
index 735426abf2c0867d3a4c14dd208d5299be2b704b..28d96f64be960a9546be12f910563684733d6558 100644 (file)
@@ -6,7 +6,7 @@ struct dog : noisy {
   priv {
     let barks : @mut uint;
     fn bark() -> int {
-      debug!{"Woof %u %d", *self.barks, *self.volume};
+      debug!("Woof %u %d", *self.barks, *self.volume);
       *self.barks += 1u;
       if *self.barks % 3u == 0u {
           *self.volume += 1;
@@ -14,7 +14,7 @@ fn bark() -> int {
       if *self.barks % 10u == 0u {
           *self.volume -= 2;
       }
-      debug!{"Grrr %u %d", *self.barks, *self.volume};
+      debug!("Grrr %u %d", *self.barks, *self.volume);
       *self.volume
     }
   }
@@ -30,7 +30,7 @@ struct cat : noisy {
   priv {
     let meows : @mut uint;
     fn meow() -> uint {
-      debug!{"Meow"};
+      debug!("Meow");
       *self.meows += 1u;
       if *self.meows % 5u == 0u {
           *self.how_hungry += 1;
index 8f5318f2bf15818e9957e1a32332cb16a8d66bcc..3126824c18439ff35a7dd426d7bf1fb36404cbb8 100644 (file)
@@ -6,7 +6,7 @@ struct cat : noisy {
   priv {
     let mut meows : uint;
     fn meow() {
-      error!{"Meow"};
+      error!("Meow");
       self.meows += 1u;
       if self.meows % 5u == 0u {
           self.how_hungry += 1;
@@ -24,12 +24,12 @@ fn meow() {
 
   fn eat() -> bool {
     if self.how_hungry > 0 {
-        error!{"OM NOM NOM"};
+        error!("OM NOM NOM");
         self.how_hungry -= 2;
         return true;
     }
     else {
-        error!{"Not hungry!"};
+        error!("Not hungry!");
         return false;
     }
   }
index 5c109481a9116cdb207db5a2b184d4c36e72af80..91b5886265a5f4549b0b6b79af0361839389b4d2 100644 (file)
@@ -10,7 +10,7 @@
     let mut meows : int;
     fn meow() {
       self.meows += 1;
-      error!{"Meow %d", self.meows};
+      error!("Meow %d", self.meows);
       if self.meows % 5 == 0 {
           self.how_hungry += 1;
       }
@@ -27,12 +27,12 @@ fn meow() {
 
   fn eat() -> bool {
     if self.how_hungry > 0 {
-        error!{"OM NOM NOM"};
+        error!("OM NOM NOM");
         self.how_hungry -= 2;
         return true;
     }
     else {
-        error!{"Not hungry!"};
+        error!("Not hungry!");
         return false;
     }
   }
index 60762ee26b5df07e07f0d4f58d8bbc83b43f9bbb..f24b19882277f556aefb355479b6661ec973b517 100644 (file)
@@ -13,7 +13,7 @@ struct cat<T: copy> : map<int, T> {
     let mut meows : int;
     fn meow() {
       self.meows += 1;
-      error!{"Meow %d", self.meows};
+      error!("Meow %d", self.meows);
       if self.meows % 5 == 0 {
           self.how_hungry += 1;
       }
@@ -30,12 +30,12 @@ fn meow() {
 
   fn eat() -> bool {
     if self.how_hungry > 0 {
-        error!{"OM NOM NOM"};
+        error!("OM NOM NOM");
         self.how_hungry -= 2;
         return true;
     }
     else {
-        error!{"Not hungry!"};
+        error!("Not hungry!");
         return false;
     }
   }
index 2a4c112a3ac945f1646d933dfe03d7395e919170..c1eb20c9d30da44650213f855133163d2aa1dda9 100644 (file)
@@ -7,7 +7,7 @@ struct cat : noisy {
   priv {
     let mut meows : uint;
     fn meow() {
-      error!{"Meow"};
+      error!("Meow");
       self.meows += 1u;
       if self.meows % 5u == 0u {
           self.how_hungry += 1;
@@ -25,12 +25,12 @@ fn meow() {
 
   fn eat() -> bool {
     if self.how_hungry > 0 {
-        error!{"OM NOM NOM"};
+        error!("OM NOM NOM");
         self.how_hungry -= 2;
         return true;
     }
     else {
-        error!{"Not hungry!"};
+        error!("Not hungry!");
         return false;
     }
   }
index f6cc934eb86cd9be805ae63132b88ab610ca0e41..4eead77e8059501a3cba8f4f6240e57fe3e632cc 100644 (file)
@@ -6,7 +6,7 @@ struct cat : noisy {
   priv {
     let mut meows : uint;
     fn meow() {
-      error!{"Meow"};
+      error!("Meow");
       self.meows += 1u;
       if self.meows % 5u == 0u {
           self.how_hungry += 1;
@@ -24,12 +24,12 @@ fn meow() {
 
   fn eat() -> bool {
     if self.how_hungry > 0 {
-        error!{"OM NOM NOM"};
+        error!("OM NOM NOM");
         self.how_hungry -= 2;
         return true;
     }
     else {
-        error!{"Not hungry!"};
+        error!("Not hungry!");
         return false;
     }
   }
index 7f57aac1370e30555e42bbec797d0f12b4911023..3af94a4094896142ec19036a2044d5a1cf59bda8 100644 (file)
@@ -33,7 +33,7 @@ fn vec_includes<T>(xs: ~[T], x: T) -> bool {
     let bite_counts : hashmap<body_part, uint>;
 
     fn meow() -> uint {
-      debug!{"Meow: %u", *self.meows};
+      debug!("Meow: %u", *self.meows);
       *self.meows += 1u;
       if *self.meows % 5u == 0u {
           *self.how_hungry += 1;
@@ -72,16 +72,16 @@ fn scratch() -> option<furniture> {
     rslt
   }
   fn bite() -> body_part {
-    error!{"In bite()"};
+    error!("In bite()");
     let all = ~[toe, nose, ear];
     let mut min = finger;
     do iter(all) |next| {
-      debug!{"min = %?", min};
+      debug!("min = %?", min);
         if self.bite_counts.get(next) < self.bite_counts.get(min) {
             min = next;
           }};
     self.bite_counts.insert(min, self.bite_counts.get(min) + 1u);
-    debug!{"Bit %?", min};
+    debug!("Bit %?", min);
     min
   }
 }
@@ -89,7 +89,7 @@ fn bite() -> body_part {
 fn annoy_neighbors<T: noisy>(critter: T) {
   for uint::range(0u, 10u) |i| {
       let what = critter.speak();
-      debug!{"%u %d", i, what};
+      debug!("%u %d", i, what);
   }
 }
 
@@ -97,7 +97,7 @@ fn bite_everything<T: bitey>(critter: T) -> bool {
   let mut left : ~[body_part] = ~[finger, toe, nose, ear];
   while vec::len(left) > 0u {
     let part = critter.bite();
-    debug!{"%? %?", left, part};
+    debug!("%? %?", left, part);
     if vec_includes(left, part) {
         left = vec::filter(left, |p| p != part );
     }
index af4a37d3c8d9725e1fa786a52df623c06fdf44da..b70b55cc10352ee8d84b97b7c215bc56355d8cc3 100644 (file)
@@ -6,7 +6,7 @@ struct cat {
   priv {
     let mut meows : uint;
     fn meow() {
-      error!{"Meow"};
+      error!("Meow");
       self.meows += 1u;
       if self.meows % 5u == 0u {
           self.how_hungry += 1;
@@ -24,12 +24,12 @@ fn meow() {
 
   fn eat() -> bool {
     if self.how_hungry > 0 {
-        error!{"OM NOM NOM"};
+        error!("OM NOM NOM");
         self.how_hungry -= 2;
         return true;
     }
     else {
-        error!{"Not hungry!"};
+        error!("Not hungry!");
         return false;
     }
   }
@@ -41,7 +41,7 @@ fn to_str() -> ~str { self.name }
 
 fn print_out<T: ToStr>(thing: T, expected: ~str) {
   let actual = thing.to_str();
-  debug!{"%s", actual};
+  debug!("%s", actual);
   assert(actual == expected);
 }
 
index 624c850f6a8e1c7f0640b928edc3a8766aefd5d2..3f0d9ad311ccea23e05b711ff275a519e92136b0 100644 (file)
@@ -2,7 +2,7 @@ struct cat {
   priv {
     let mut meows : uint;
     fn meow() {
-      error!{"Meow"};
+      error!("Meow");
       self.meows += 1u;
       if self.meows % 5u == 0u {
           self.how_hungry += 1;
@@ -20,12 +20,12 @@ fn meow() {
 
   fn eat() -> bool {
     if self.how_hungry > 0 {
-        error!{"OM NOM NOM"};
+        error!("OM NOM NOM");
         self.how_hungry -= 2;
         return true;
     }
     else {
-        error!{"Not hungry!"};
+        error!("Not hungry!");
         return false;
     }
   }
index 6e67451f6d9eb3ce57f1761bc903cd3f66a5a092..ed0388b2bcec670b5189ceb95336a3426540592f 100644 (file)
@@ -12,7 +12,7 @@ fn f<A:copy owned>(a: A, b: u16) -> fn@() -> (A, u16) {
 
 fn main() {
     let (a, b) = f(22_u64, 44u16)();
-    debug!{"a=%? b=%?", a, b};
+    debug!("a=%? b=%?", a, b);
     assert a == 22u64;
     assert b == 44u16;
 }
index e84b844a1ea72b0ec9b11e1a29d1634fc937ec2f..833552ccbf8b9924576a4da7eebec1d8958eb767 100644 (file)
@@ -13,13 +13,13 @@ fn main() {
     let ch = comm::chan(p);
     let t = task::spawn(|| child(ch) );
     let y = recv(p);
-    error!{"received"};
+    error!("received");
     log(error, y);
     assert (y == 10);
 }
 
 fn child(c: Chan<int>) {
-    error!{"sending"};
+    error!("sending");
     send(c, 10);
-    error!{"value sent"};
+    error!("value sent");
 }
index 748423429cca530bb32af7f11eda12180bc2116a..6ccc7b879b37611f84c7b5534a33cd90b3f3c391 100644 (file)
@@ -28,6 +28,6 @@ fn foo(x: int) -> int {
 fn main() {
     let x: int = 2 + 2;
     log(debug, x);
-    debug!{"hello, world"};
+    debug!("hello, world");
     log(debug, 10);
 }
index 1881c771203f85b9325feb427d0f1b2e4c4476e8..c62e0b79d7cb25dcc713512b66cc4894d66afc3a 100644 (file)
@@ -9,5 +9,5 @@
 fn main() {
     let (p, _) = y.x;
     assert p == 0xf0f0f0f0_f0f0f0f0;
-    io::println(fmt!{"0x%x", p as uint});
+    io::println(fmt!("0x%x", p as uint));
 }
index 132ecb935cf80577eae365ab14fef4b585c5195c..07d3357a947cf2abd7e6d1fecb0a9899d4471e69 100644 (file)
@@ -9,6 +9,6 @@ fn main() {
     assert x.b == 2;
     assert x == y;
     assert z.b == 22;
-    io::println(fmt!{"0x%x", x.b as uint});
-    io::println(fmt!{"0x%x", z.c as uint});
+    io::println(fmt!("0x%x", x.b as uint));
+    io::println(fmt!("0x%x", z.c as uint));
 }
index 921a1ac8cc684fc4cf6595f4085eb8f27cbed335..46c7edc63a497f232163a36444a1926b5765932f 100644 (file)
@@ -2,4 +2,4 @@
 
 
 // -*- rust -*-
-fn main() { if 1 == 1 { return; } debug!{"Paul is dead"}; }
+fn main() { if 1 == 1 { return; } debug!("Paul is dead"); }
index a091e975177f282e87d18bc56153d4eb7c62f316..206f8f239e0e65fc902d819ba0f1662dc6907676 100644 (file)
@@ -6,7 +6,7 @@ mod bar {
         fn y() { x(); }
     }
 
-    fn x() { debug!{"x"}; }
+    fn x() { debug!("x"); }
 }
 
 fn main() { foo::bar::y(); }
index 55b45d626e1f40697908f754eba92962159e1cce..41cc6bd7d23fbf975770feb1403fb1739a260818 100644 (file)
@@ -7,7 +7,7 @@ mod foo {
 mod bar {
     export x;
 
-    fn x() { debug!{"x"}; }
+    fn x() { debug!("x"); }
 }
 
 fn main() { foo::x(); }
index 146f371f290a232948705ae0d4f2a300aa04b892..05404032a73f3b41c3a6efce798b8728b88ffe4b 100644 (file)
@@ -12,12 +12,12 @@ fn rust_dbg_call(cb: *u8,
 }
 
 fn count(n: uint) -> uint {
-    debug!{"n = %?", n};
+    debug!("n = %?", n);
     rustrt::rust_dbg_call(cb, n)
 }
 
 fn main() {
     let result = count(1000u);
-    debug!{"result = %?", result};
+    debug!("result = %?", result);
     assert result == 1000u;
 }
\ No newline at end of file
index f9fbc1773bd112fc8edc9e2eff32f127b038733f..23a34a45d8d62135893bcb70105568e3cee14d0c 100644 (file)
@@ -12,7 +12,7 @@ fn rust_dbg_call(cb: *u8,
 }
 
 fn count(n: uint) -> uint {
-    debug!{"n = %?", n};
+    debug!("n = %?", n);
     rustrt::rust_dbg_call(cb, n)
 }
 
@@ -21,7 +21,7 @@ fn main() {
     // has a large stack)
     do task::spawn {
         let result = count(1000u);
-        debug!{"result = %?", result};
+        debug!("result = %?", result);
         assert result == 1000u;
     };
 }
\ No newline at end of file
index 4f7c7e233a78d738d066480e55cbd268fc2f84f7..49e55cca1c80030f56c465afe1c5b1573fcf9cb9 100644 (file)
@@ -16,7 +16,7 @@ fn rust_dbg_call(cb: *u8,
 }
 
 fn count(n: uint) -> uint {
-    debug!{"n = %?", n};
+    debug!("n = %?", n);
     rustrt::rust_dbg_call(cb, n)
 }
 
@@ -25,7 +25,7 @@ fn main() {
     // has a large stack)
     do task::spawn {
         let result = count(12u);
-        debug!{"result = %?", result};
+        debug!("result = %?", result);
         assert result == 2048u;
     };
 }
\ No newline at end of file
index 7634d347cad716674ce2e53075c9e10a1f0dd147..6f8cfc288603e91b21a541d31254a72a07c08a54 100644 (file)
@@ -12,12 +12,12 @@ fn rust_dbg_call(cb: *u8,
 }
 
 fn fact(n: uint) -> uint {
-    debug!{"n = %?", n};
+    debug!("n = %?", n);
     rustrt::rust_dbg_call(cb, n)
 }
 
 fn main() {
     let result = fact(10u);
-    debug!{"result = %?", result};
+    debug!("result = %?", result);
     assert result == 3628800u;
 }
\ No newline at end of file
index 290dc115a0b3254e2404c736f92160fc8311b773..34da3e33e6fd25fc98be8160f777b1086765dd93 100644 (file)
@@ -4,12 +4,12 @@
 use externcallback(vers = "0.1");
 
 fn fact(n: uint) -> uint {
-    debug!{"n = %?", n};
+    debug!("n = %?", n);
     externcallback::rustrt::rust_dbg_call(externcallback::cb, n)
 }
 
 fn main() {
     let result = fact(10u);
-    debug!{"result = %?", result};
+    debug!("result = %?", result);
     assert result == 3628800u;
 }
index 194970789c1d992d8bbb088e9743ad3f80265d75..eff78a6f0ad1bbc04d00dfbfff71187baaefecaf 100644 (file)
@@ -20,7 +20,7 @@ fn main() {
     for iter::repeat(10u) {
         do task::spawn {
             let result = count(5u);
-            debug!{"result = %?", result};
+            debug!("result = %?", result);
             assert result == 16u;
         };
     }
index e682fde8776fab8ce026b89ca18c13e5b89d7241..4d55badaad8d8cdb2b0fca32ed70582e721cb278 100644 (file)
@@ -3,18 +3,18 @@
 
 // -*- rust -*-
 fn f(x: int) -> int {
-    // debug!{"in f:"};
+    // debug!("in f:");
 
     log(debug, x);
     if x == 1 {
-        // debug!{"bottoming out"};
+        // debug!("bottoming out");
 
         return 1;
     } else {
-        // debug!{"recurring"};
+        // debug!("recurring");
 
         let y: int = x * f(x - 1);
-        // debug!{"returned"};
+        // debug!("returned");
 
         log(debug, y);
         return y;
@@ -23,6 +23,6 @@ fn f(x: int) -> int {
 
 fn main() {
     assert (f(5) == 120);
-    // debug!{"all done"};
+    // debug!("all done");
 
 }
index 262ce59ae5826f6a3f1cfb11820260d3deef90db..d71fd80d0abcd8a29bba81808637ac5431d6f7c8 100644 (file)
@@ -5,6 +5,6 @@ fn main() {
     log(debug, -pi * (pi + 2.0 / pi) - pi * 5.0);
     if pi == 5.0 || pi < 10.0 || pi <= 2.0 || pi != 22.0 / 7.0 || pi >= 10.0
            || pi > 1.0 {
-        debug!{"yes"};
+        debug!("yes");
     }
 }
index 6ab3deb74332d52b6866b63a013241841e67b527..e9cdfd224c579d1c269087c180f3aaf80a4e9348 100644 (file)
@@ -1,5 +1,5 @@
 fn f() {
-    debug!{"This is a bare function"};
+    debug!("This is a bare function");
 }
 
 fn main() {
index 442e9eb4e19630324a3d5cd7f0575dd4b89bd6e0..e0e62599145b8a666c48afaf5be486ca628c4330 100644 (file)
@@ -4,13 +4,13 @@
 // -*- rust -*-
 fn main() {
     let mut sum: int = 0;
-    do first_ten |i| { debug!{"main"}; log(debug, i); sum = sum + i; }
-    debug!{"sum"};
+    do first_ten |i| { debug!("main"); log(debug, i); sum = sum + i; }
+    debug!("sum");
     log(debug, sum);
     assert (sum == 45);
 }
 
 fn first_ten(it: fn(int)) {
     let mut i: int = 0;
-    while i < 10 { debug!{"first_ten"}; it(i); i = i + 1; }
+    while i < 10 { debug!("first_ten"); it(i); i = i + 1; }
 }
index fab82aaf7ae57d6a69c9b044ac25fdfdc590d6ff..3b1432258770494b58cc562a52d2f81bdaf329b5 100644 (file)
@@ -4,7 +4,7 @@ enum foo<T> { arm(T), }
 
 fn altfoo<T>(f: foo<T>) {
     let mut hit = false;
-    match f { arm::<T>(x) => { debug!{"in arm"}; hit = true; } }
+    match f { arm::<T>(x) => { debug!("in arm"); hit = true; } }
     assert (hit);
 }
 
index 6d54dd37ef6d187dc6bb2dae4f2ad206b4858e62..015feb47e513dfbf5495e3fc91f309da6a3484c2 100644 (file)
@@ -50,9 +50,9 @@ fn emit(im: map::hashmap<~str, int>, ctrl: Chan<ctrl_proto>, key: ~str,
               some(_c) => { c = _c }
               none => {
                 let p = port();
-                error!{"sending find_reducer"};
+                error!("sending find_reducer");
                 send(ctrl, find_reducer(str::bytes(key), chan(p)));
-                error!{"receiving"};
+                error!("receiving");
                 c = recv(p);
                 log(error, c);
                 im.insert(key, c);
index 35ef6fbf695616f0e256b960346f7e148008d129..5f61c554992d9c13fde2d928f20ab6c0d7c1f7cf 100644 (file)
@@ -2,4 +2,4 @@
 
 
 // -*- rust -*-
-fn main() { debug!{"hello, world."}; }
+fn main() { debug!("hello, world."); }
index ef56998cdd15098b0792072032abb4b5d8470b98..5e935ab17dc670f2236c137add55fcbea3f323ee 100644 (file)
@@ -75,14 +75,14 @@ macro_rules! parse_node {
 }
 
 fn main() {
-    let page = html! {
+    let page = html! (
         <html>
             <head><title>This is the title.</title></head>
             <body>
             <p>This is some text</p>
             </body>
         </html>
-    };
+    );
 }
 
 enum HTMLFragment {
index 0f830727768b65b0139b95f4e73f29310902c738..39abe0c80823c2f685107ba9486407c355444e88 100644 (file)
@@ -5,10 +5,10 @@ mod module_of_many_things {
     export f1;
     export f2;
     export f4;
-    fn f1() { debug!{"f1"}; }
-    fn f2() { debug!{"f2"}; }
-    fn f3() { debug!{"f3"}; }
-    fn f4() { debug!{"f4"}; }
+    fn f1() { debug!("f1"); }
+    fn f2() { debug!("f2"); }
+    fn f3() { debug!("f3"); }
+    fn f4() { debug!("f4"); }
 }
 
 mod dug {
@@ -17,8 +17,8 @@ mod greedily {
             mod and {
                 mod too {
                     mod deep {
-                        fn nameless_fear() { debug!{"Boo!"}; }
-                        fn also_redstone() { debug!{"Whatever."}; }
+                        fn nameless_fear() { debug!("Boo!"); }
+                        fn also_redstone() { debug!("Whatever."); }
                     }
                 }
             }
index 5ca7e028985927960fb2e4711f4800e49b5f7898..09e84cf721623a4740b5a8c177069d54212f14c2 100644 (file)
@@ -32,7 +32,7 @@ mod a2 {
     mod b2 {
         //   |
         fn word_traveler() { //   |
-            debug!{"ahoy!"}; //  -/
+            debug!("ahoy!"); //  -/
         } //
     } //
 }
index 8775f03f2e98e36642c81c3866c283275d70981d..6b4596e2b44162eeaf46f227b543a5de2ed06e61 100644 (file)
@@ -2,7 +2,7 @@
 import zed::bar;
 
 mod zed {
-    fn bar() { debug!{"bar"}; }
+    fn bar() { debug!("bar"); }
 }
 
 fn main() { bar(); }
index 95c68818412cd93502353440056fa69ec8a0a4d3..6b6402cd2dca78b262ba12d8f49b7a4332948335 100644 (file)
@@ -4,7 +4,7 @@
 
 mod baz {
     mod zed {
-        fn bar() { debug!{"bar2"}; }
+        fn bar() { debug!("bar2"); }
     }
 }
 
index 7df4ddbb71bd227f284ffccaa2a5af3327d6f063..21912cf3abd38ec394f242f3cfdad9f59d1ba8a9 100644 (file)
@@ -2,7 +2,7 @@
 import zed::bar;
 
 mod zed {
-    fn bar() { debug!{"bar"}; }
+    fn bar() { debug!("bar"); }
 }
 
 fn main(args: ~[~str]) { let zed = 42; bar(); }
index bce048833c95ce93a461bb45361e6265c65e4540..e4a6b7fb4e2b8a0c8a36e0d685f185c5d8fa00ad 100644 (file)
@@ -3,7 +3,7 @@ mod foo {
     import zed::bar;
     export bar;
     mod zed {
-        fn bar() { debug!{"foo"}; }
+        fn bar() { debug!("foo"); }
     }
 }
 
index 2449b5c7273dda423006b1eb5d0bc19165536416..83fb4d921dc069fc24ee59294a52ea9eee0d2ba3 100644 (file)
@@ -2,7 +2,7 @@
 import bar::baz;
 mod foo {
     mod zed {
-        fn baz() { debug!{"baz"}; }
+        fn baz() { debug!("baz"); }
     }
 }
 mod bar {
index 83923cce64d9f97ab206cd0e60cea242963e96b8..2edd71a5efb49d4605bc12f8ae02407f686c88c7 100644 (file)
@@ -2,7 +2,7 @@
 import bar::baz;
 mod foo {
     mod zed {
-        fn baz() { debug!{"baz"}; }
+        fn baz() { debug!("baz"); }
     }
 }
 mod bar {
index 27a123c0c4e9c5aaa619412615ef33ba06ad3a93..65d9ce269de111d3b8b5c6d7174bed316a63eaeb 100644 (file)
@@ -4,7 +4,7 @@
 // -*- rust -*-
 mod inner {
     mod inner2 {
-        fn hello() { debug!{"hello, modular world"}; }
+        fn hello() { debug!("hello, modular world"); }
     }
     fn hello() { inner2::hello(); }
 }
index d2a9368d9d89e17799fe74c5264e0e8f6f6c1143..0c7a3d312f5566444548bb9c96e28f9491ad4d71 100644 (file)
@@ -2,6 +2,6 @@
 // xfail-test
 
 fn main() {
-    error!{"%?", os::getenv(~"RUST_CC_ZEAL")};
+    error!("%?", os::getenv(~"RUST_CC_ZEAL"));
     let _x = @{a: @10, b: ~true};
 }
index 8017d9da15f70f62fa82ebc2a0f4bc381cb60330..e3e318ac7c6a0db9ef5febc0f015ec9d790b3a54 100644 (file)
@@ -14,7 +14,7 @@ fn main(args: ~[str]) {
     let leak = init(&ar, args[0]);
     match *leak {
         s(astr) {
-            io::println(fmt!{"%?", astr});
+            io::println(fmt!("%?", astr));
         }
     };
 }
index b6529d3b0308a5c5334d443011110cd4a64cf5c3..7bd5dab7d9573ab2f282f9d62b2ad6464f1dd02c 100644 (file)
@@ -44,5 +44,5 @@ fn main() {
         a);
     let sum = foldl(filt, 0u, |accum, &&n: uint| accum + n );
 
-    io::println(fmt!{"%u", sum});
+    io::println(fmt!("%u", sum));
 }
index 0c49fc577452e47656b823d70c21899e9805d7fc..96ac83aeee6b9329475581574a695a399d2e2ddb 100644 (file)
@@ -1,6 +1,6 @@
 struct cat {
     let mut meow: fn@();
-    new() { self.meow = fn@() { error!{"meow"}; };}
+    new() { self.meow = fn@() { error!("meow"); };}
 }
 
 type kitty_info = {kitty: cat};
index da7953a23706819338b5a748bcb4e72eb84d3b53..2db1ba7f75955d3d9a32250c59b8b9d49ee9ee38 100644 (file)
@@ -4,7 +4,7 @@
 import std::map::hashmap;
 
 fn add_interfaces(managed_ip: ~str, device: std::map::hashmap<~str, int>)  {
-     error!{"%s, %?", managed_ip, device[~"interfaces"]};
+     error!("%s, %?", managed_ip, device[~"interfaces"]);
 }
 
 fn main() {}
index e245fba4f66d2eb25cb876a50b817650f211ccab..634c1b26d88ad19bdf43881686009f8f93bae2f3 100644 (file)
@@ -19,7 +19,7 @@ fn lookup(table: std::map::hashmap<~str, std::json::json>, key: ~str, default: ~
         }
         option::some(value) =>
         {
-            error!{"%s was expected to be a string but is a %?", key, value};
+            error!("%s was expected to be a string but is a %?", key, value);
             default
         }
         option::none =>
@@ -36,13 +36,13 @@ fn add_interface(store: int, managed_ip: ~str, data: std::json::json) -> (~str,
         std::json::dict(interface) =>
         {
             let name = lookup(interface, ~"ifDescr", ~"");
-            let label = fmt!{"%s-%s", managed_ip, name};
+            let label = fmt!("%s-%s", managed_ip, name);
 
             (label, bool_value(false))
         }
         _ =>
         {
-            error!{"Expected dict for %s interfaces but found %?", managed_ip, data};
+            error!("Expected dict for %s interfaces but found %?", managed_ip, data);
             (~"gnos:missing-interface", bool_value(true))
         }
     }
@@ -60,7 +60,7 @@ fn add_interfaces(store: int, managed_ip: ~str, device: std::map::hashmap<~str,
         }
         _ =>
         {
-            error!{"Expected list for %s interfaces but found %?", managed_ip, device[~"interfaces"]};
+            error!("Expected list for %s interfaces but found %?", managed_ip, device[~"interfaces"]);
             ~[]
         }
     }
index 6942e585b443af6a9d7483a23721b0cdfe3dcd8e..f65d0a0aa050e06c4b49e2204167ee52952e9ea1 100644 (file)
@@ -12,7 +12,7 @@ fn rendezvous() {
     let (c, s) = streamp::init();
     let streams: ~[streamp::client::open<int>] = ~[c];
 
-    error!{"%?", streams[0]};
+    error!("%?", streams[0]);
 }
 
 fn main(args: ~[str]) {
index 1738f45c6a8fd025d4049fd52eda050a6f1a8d62..ba81a660f7fb4b4718768ac0cd888df1917083a4 100644 (file)
@@ -21,21 +21,21 @@ fn packager(cb: Chan<Chan<~[u8]>>, msg: Chan<msg>) {
     let p: Port<~[u8]> = port();
     send(cb, chan(p));
     loop {
-        debug!{"waiting for bytes"};
+        debug!("waiting for bytes");
         let data = recv(p);
-        debug!{"got bytes"};
+        debug!("got bytes");
         if vec::len(data) == 0u {
-            debug!{"got empty bytes, quitting"};
+            debug!("got empty bytes, quitting");
             break;
         }
-        debug!{"sending non-empty buffer of length"};
+        debug!("sending non-empty buffer of length");
         log(debug, vec::len(data));
         send(msg, received(data));
-        debug!{"sent non-empty buffer"};
+        debug!("sent non-empty buffer");
     }
-    debug!{"sending closed message"};
+    debug!("sending closed message");
     send(msg, closed);
-    debug!{"sent closed message"};
+    debug!("sent closed message");
 }
 
 fn main() {
@@ -51,9 +51,9 @@ fn main() {
     loop {
         let msg = recv(p);
         match msg {
-          closed => { debug!{"Got close message"}; break; }
+          closed => { debug!("Got close message"); break; }
           received(data) => {
-            debug!{"Got data. Length is:"};
+            debug!("Got data. Length is:");
             log(debug, vec::len::<u8>(data));
           }
         }
index e0b7a294a6c82f3bbd99f8cabb8236614b864469..a2346a2eaf97c7c6a29726094e03db8797218029 100644 (file)
@@ -143,7 +143,7 @@ mod test_distinguish_syntax_ext {
     use std;
 
     fn f() {
-        fmt!{"test%s", ~"s"};
+        fmt!("test%s", ~"s");
         #[attr = "val"]
         fn g() { }
     }
index c8c532e1018586827827d4a4dcc65fe05411eb2b..6ee5dc44c96c5fa1201fc582cf4065c4b8016a24 100644 (file)
@@ -11,13 +11,13 @@ fn main() {
 
     task::spawn(|| child(ch) );
     y = recv(p);
-    debug!{"received 1"};
+    debug!("received 1");
     log(debug, y);
     assert (y == 10);
 
     task::spawn(|| child(ch) );
     y = recv(p);
-    debug!{"received 2"};
+    debug!("received 2");
     log(debug, y);
     assert (y == 10);
 }
index fcdafc6d8c12caecd874d9cbed68bd77b2fcd343..8da7c7fdf4d1dc0bb7ac24e43fe9c44a4e36d683 100644 (file)
@@ -10,10 +10,10 @@ fn main() {
       none => {}
       some(_)  =>{
   if test_comm::recv(p) == 0 {
-      error!{"floop"};
+      error!("floop");
   }
   else {
-      error!{"bloop"};
+      error!("bloop");
   }
       }}
 }
\ No newline at end of file
index b66e6aa15e51cf9cca6dae2e33dd46c962b04ec4..c2c4983b7618be030326ace3a9b725cdb0ea9940 100644 (file)
@@ -4,7 +4,7 @@ fn test() {
         v = 3;
         break;
     }
-    debug!{"%d", v};
+    debug!("%d", v);
 }
 
 fn main() {
index 8f24404fed7251c587a12f64b24ecf753e69dc4b..6fa9461a227b5868b45fd9e57fe42e1548916dce 100644 (file)
@@ -7,12 +7,12 @@ enum foo {
 }
 
 fn check_log<T>(exp: ~str, v: T) {
-    assert exp == fmt!{"%?", v};
+    assert exp == fmt!("%?", v);
 }
 
 fn main() {
     let x = list::from_vec(~[a(22u), b(~"hi")]);
     let exp = ~"@cons(a(22), @cons(b(~\"hi\"), @nil))";
-    assert fmt!{"%?", x} == exp;
+    assert fmt!("%?", x) == exp;
     check_log(exp, x);
 }
index bca729e653808482240729415f46004d3a3d1a2d..eaba075793be619be187a7353bf8dd52d1d31c04 100644 (file)
@@ -5,7 +5,7 @@ enum foo {
 }
 
 fn main() {
-    assert ~"a(22)" == fmt!{"%?", a(22u)};
-    assert ~"b(~\"hi\")" == fmt!{"%?", b(~"hi")};
-    assert ~"c" == fmt!{"%?", c};
+    assert ~"a(22)" == fmt!("%?", a(22u));
+    assert ~"b(~\"hi\")" == fmt!("%?", b(~"hi"));
+    assert ~"c" == fmt!("%?", c);
 }
index c5b44343116166078ae4f521a40cbaddb06f154c..e4cafa20d39736e328023e5154edb72dfc508f59 100644 (file)
@@ -1,4 +1,4 @@
 fn main() {
     assert ~"~[1, 2, 3]" == sys::log_str(~[1, 2, 3]);
-    assert fmt!{"%?/%6?", ~[1, 2, 3], ~"hi"} == ~"~[1, 2, 3]/ ~\"hi\"";
+    assert fmt!("%?/%6?", ~[1, 2, 3], ~"hi") == ~"~[1, 2, 3]/ ~\"hi\"";
 }
index b5d3d693f6a89352b43d0eccdd4de537ad309660..e3f9e06efce62fc0251b70efa52986aaebdb5cfa 100644 (file)
@@ -7,7 +7,7 @@ fn main() {
                 f
             }]];
 
-    assert (mylambda!{y, y * 2}(8) == 16);
+    assert (mylambda!(y, y * 2)(8) == 16);
 
     macro_rules! mylambda_tt{
         {$x:ident, $body:expr} => {
@@ -16,5 +16,5 @@ macro_rules! mylambda_tt{
         }
     }
 
-    assert(mylambda_tt!{y, y * 2}(8) == 16)
+    assert(mylambda_tt!(y, y * 2)(8) == 16)
 }
index 63dc2a7a5b09d9745a087e1acb049c9e996abcf4..4a5f7f9093ccc565f6dfad19064b074a8815cb95 100644 (file)
@@ -3,10 +3,10 @@
 fn main() {
     #macro[[#trivial[], 1 * 2 * 4 * 2 * 1]];
 
-    assert (trivial!{} == 16);
+    assert (trivial!() == 16);
 
     macro_rules! trivial_tt{
         {} => {1*2*4*2*1}
     }
-    assert(trivial_tt!{} == 16);
+    assert(trivial_tt!() == 16);
 }
index ba8c8d93a637308e42d13c588d30da71d943d597..64ed3a367ecdcf6f9cdde1bd9ae4f800cb973d2a 100644 (file)
@@ -8,7 +8,7 @@ macro_rules! apply_tt{
 
     fn add(a: int, b: int) -> int { return a + b; }
 
-    assert(apply!{add, [1, 15]} == 16);
-    assert(apply!{add, [1, 15]} == 16);
-    assert(apply_tt!{add, (1, 15)} == 16);
+    assert(apply!(add, [1, 15]) == 16);
+    assert(apply!(add, [1, 15]) == 16);
+    assert(apply_tt!(add, (1, 15)) == 16);
 }
index c0693cd059aad5925b92b1df6a5d999c7c69bf02..17ffc5e05210f09d9dadfb0792416ac8c2352cbe 100644 (file)
@@ -7,22 +7,22 @@ fn main() {
            [#zip_or_unzip[[xx, yy], ...], [[xx, ...], [yy, ...]]]];
 
 
-    assert (zip_or_unzip!{[1, 2, 3, 4], [5, 6, 7, 8]} ==
+    assert (zip_or_unzip!([1, 2, 3, 4], [5, 6, 7, 8]) ==
                 [[1, 5], [2, 6], [3, 7], [4, 8]]);
-    assert (zip_or_unzip!{[1, 5], [2, 6], [3, 7], [4, 8]} ==
+    assert (zip_or_unzip!([1, 5], [2, 6], [3, 7], [4, 8]) ==
                 [[1, 2, 3, 4], [5, 6, 7, 8]]);
 
 
     #macro[[#nested[[[x, ...], ...], [[y, ...], ...]], [[[x, y], ...], ...]]];
-    assert (nested!{[[1, 2, 3, 4, 5], [7, 8, 9, 10, 11, 12]],
-                    [[-1, -2, -3, -4, -5], [-7, -8, -9, -10, -11, -12]]} ==
+    assert (nested!([[1, 2, 3, 4, 5], [7, 8, 9, 10, 11, 12]],
+                    [[-1, -2, -3, -4, -5], [-7, -8, -9, -10, -11, -12]]) ==
                 [[[1, -1], [2, -2], [3, -3], [4, -4], [5, -5]],
                  [[7, -7], [8, -8], [9, -9], [10, -10], [11, -11],
                   [12, -12]]]);
 
     #macro[[#dup[y, [x, ...]], [[y, x], ...]]];
 
-    assert (dup!{1, [1, 2, 3, 4]} == [[1, 1], [1, 2], [1, 3], [1, 4]]);
+    assert (dup!(1, [1, 2, 3, 4]) == [[1, 1], [1, 2], [1, 3], [1, 4]]);
 
 
     #macro[[#lambda[x, #<t>, body, #<s>],
@@ -32,19 +32,19 @@ fn result(x: t) -> s { return body }
             }]];
 
 
-    assert (lambda!{i, #<uint>, i + 4u, #<uint>}(12u) == 16u);
+    assert (lambda!(i, #<uint>, i + 4u, #<uint>)(12u) == 16u);
 
     #macro[[#sum[x, xs, ...], x + #sum[xs, ...]], [#sum[], 0]];
 
-    assert (sum!{1, 2, 3, 4} == 10);
+    assert (sum!(1, 2, 3, 4) == 10);
 
 
     #macro[[#transcr_mixed[a, as, ...], #sum[6, as, ...] * a]];
 
-    assert (transcr_mixed!{10, 5, 4, 3, 2, 1} == 210);
+    assert (transcr_mixed!(10, 5, 4, 3, 2, 1) == 210);
 
     #macro[[#surround[pre, [xs, ...], post], [pre, xs, ..., post]]];
 
-    assert (surround!{1, [2, 3, 4], 5} == [1, 2, 3, 4, 5]);
+    assert (surround!(1, [2, 3, 4], 5) == [1, 2, 3, 4, 5]);
 
 }
index 564af959d89a0def59aa3c697e85b1ae61c568c0..f13b403b26514ae8e4ae7c60b9f8e34a2c772526 100644 (file)
@@ -2,10 +2,10 @@
 
 fn main() {
     #macro[[#m1[a], a * 4]];
-    assert (m1!{2} == 8);
+    assert (m1!(2) == 8);
 
     macro_rules! m1tt {
         {$a:expr} => {$a*4}
     };
-    assert(m1tt!{2} == 8);
+    assert(m1tt!(2) == 8);
 }
index dde39ae37ed3a882375f36549bce772ec4d331f0..0f8fcd0acaf088e7fed0e9788bc73f0ff9744c39 100644 (file)
@@ -21,7 +21,7 @@ fn main() {
     let ch = comm::chan(p);
     let child = task::spawn(|| sub(ch, 200) );
     let y = comm::recv(p);
-    debug!{"transmission complete"};
+    debug!("transmission complete");
     log(debug, y);
     assert (y == 200);
 }
index 939dcbdbb17023de4fd98120f12650c2be2103a9..2062190217320afcba182cf023ddf0c70f7ed537 100644 (file)
@@ -25,6 +25,6 @@ fn Foo(x: int, y: int) -> Foo {
 
 fn main() {
     let foo = Foo(3, 20);
-    io::println(fmt!{"%d %d", foo.sum(), foo.product()});
+    io::println(fmt!("%d %d", foo.sum(), foo.product()));
 }
 
index 54b264dc162db0b7d684e7870f62ef133148dea8..33699ac4f849a91bbdc2bd681df4e5c25b2b4b1c 100644 (file)
@@ -1,3 +1,3 @@
 
 
-fn other() { debug!{"yes"}; }
+fn other() { debug!("yes"); }
index 3ea6f019efa8fa002b4668067e476d1221fa988a..466b6b9be56781f12708ed8e88da95ef7f595291 100644 (file)
@@ -1,3 +1,3 @@
 
 
-fn main() { debug!{"hello, multi-file world."}; bar::other(); }
+fn main() { debug!("hello, multi-file world."); bar::other(); }
index 795a42f979012ac134859d0361c02e3701261b08..bdc623ca2ba5747278b874b6374aec87695fb728 100644 (file)
@@ -8,7 +8,7 @@ fn foo() {
         match none::<int> { none::<int> => { bar = 5; } _ => { baz(); } }
         log(debug, bar);
       }
-      none::<int> => { debug!{"hello"}; }
+      none::<int> => { debug!("hello"); }
     }
 }
 
index a79b084493413523750a4823ced4d26821c664d5..50a1badae33cf861677c8521253bc35b9f2514ff 100644 (file)
@@ -10,8 +10,8 @@ enum t { foo(int, uint), bar(int, option<int>), }
 
 fn nested(o: t) {
     match o {
-      bar(i, some::<int>(_)) => { error!{"wrong pattern matched"}; fail; }
-      _ => { error!{"succeeded"}; }
+      bar(i, some::<int>(_)) => { error!("wrong pattern matched"); fail; }
+      _ => { error!("succeeded"); }
     }
 }
 
index b9ea40b2b52fa077e7e8dbcd8dbb58e5b4577534..c5cb12eac9466944b09fd2ccf12408c9de134acc 100644 (file)
@@ -1,5 +1,5 @@
 fn main() {
     let x = true;
     if x { let mut i = 10; while i > 0 { i -= 1; } }
-    match x { true => { debug!{"right"}; } false => { debug!{"wrong"}; } }
+    match x { true => { debug!("right"); } false => { debug!("wrong"); } }
 }
index 65ea01f9115101098a1ff0b9d78779975aac7478..c5576f2dda7cf0c678ecc1fdf75232446ca7213c 100644 (file)
@@ -44,12 +44,12 @@ fn switch<T: send, U>(+endp: pipes::recv_packet<T>,
 fn move_it<T>(-x: T) -> T { x }
 
 macro_rules! follow {
-    { 
+    {
         $($message:path$(($($x: ident),+))||* -> $next:ident $e:expr)+
     } => (
         |m| match move m {
           $(some($message($($($x,)+)* next)) => {
-            let $next = move_it!{next};
+            let $next = move_it!(next);
             $e })+
           _ => { fail }
         }
@@ -60,21 +60,21 @@ fn client_follow(+bank: bank::client::login) {
     import bank::*;
 
     let bank = client::login(bank, ~"theincredibleholk", ~"1234");
-    let bank = switch(bank, follow! {
+    let bank = switch(bank, follow! (
         ok -> connected { connected }
         invalid -> _next { fail ~"bank closed the connected" }
-    });
+    ));
 
     let bank = client::deposit(bank, 100.00);
     let bank = client::withdrawal(bank, 50.00);
-    switch(bank, follow! {
+    switch(bank, follow! (
         money(m) -> _next {
             io::println(~"Yay! I got money!");
         }
         insufficient_funds -> _next {
             fail ~"someone stole my money"
         }
-    });
+    ));
 }
 
 fn bank_client(+bank: bank::client::login) {
@@ -83,7 +83,7 @@ fn bank_client(+bank: bank::client::login) {
     let bank = client::login(bank, ~"theincredibleholk", ~"1234");
     let bank = match try_recv(bank) {
       some(ok(connected)) => {
-        move_it!{connected}
+        move_it!(connected)
       }
       some(invalid(_)) => { fail ~"login unsuccessful" }
       none => { fail ~"bank closed the connection" }
index 9c99f1dce02cdc8ebbda3bd7e4c5b6f62701e27b..d8acb0c27d56791a038f707f1641627cf4586414 100644 (file)
@@ -38,7 +38,7 @@ fn failtest() {
         fail;
     }
 
-    error!{"%?", recv(p)};
+    error!("%?", recv(p));
     // make sure we get killed if we missed it in the receive.
     loop { task::yield() }
 }
index 949a4a1032e6f9439c4f045c4b001158264f6a3a..39ec905b43e935e7f7a78a0a80c2535b1bbc23ad 100644 (file)
@@ -31,14 +31,14 @@ macro_rules! select_if {
               _ => fail
             }
         } else {
-            select_if!{
+            select_if!(
                 $index,
                 $count + 1,
                 $( $ports => [
                     $($messages$(($($xs),+))dont_type_this*
                       -> $nexts $es),+
                 ], )*
-            }
+            )
         }
     };
 
@@ -58,9 +58,9 @@ macro_rules! select {
         } )+
     } => {
         let index = pipes::selecti([$(($port).header()),+]/_);
-        select_if!{index, 0, $( $port => [
+        select_if!(index, 0, $( $port => [
             $($message$(($($x),+))dont_type_this* -> $next $e),+
-        ], )+}
+        ], )+)
     }
 }
 
@@ -92,62 +92,62 @@ fn render(_buffer: &Buffer) {
 
 fn draw_frame(+channel: double_buffer::client::acquire) {
     let channel = request(channel);
-    select! {
+    select! (
         channel => {
             give_buffer(buffer) -> channel {
                 render(&buffer);
                 release(channel, move buffer)
             }
         }
-    };
+    );
 }
 
 fn draw_two_frames(+channel: double_buffer::client::acquire) {
     let channel = request(channel);
-    let channel = select! {
+    let channel = select! (
         channel => {
             give_buffer(buffer) -> channel {
                 render(&buffer);
                 release(channel, move buffer)
             }
         }
-    };
+    );
     let channel = request(channel);
-    select! {
+    select! (
         channel => {
             give_buffer(buffer) -> channel {
                 render(&buffer);
                 release(channel, move buffer)
             }
         }
-    };
+    );
 }
 
 #[cfg(bad1)]
 fn draw_two_frames_bad1(+channel: double_buffer::client::acquire) {
     let channel = request(channel);
-    select! {
+    select! (
         channel => {
             give_buffer(buffer) -> channel {
                 render(&buffer);
             }
         }
-    };
+    );
     let channel = request(channel);
-    select! {
+    select! (
         channel => {
             give_buffer(buffer) -> channel {
                 render(&buffer);
                 release(channel, move buffer)
             }
         }
-    };
+    );
 }
 
 #[cfg(bad2)]
 fn draw_two_frames_bad2(+channel: double_buffer::client::acquire) {
     let channel = request(channel);
-    select! {
+    select! (
         channel => {
             give_buffer(buffer) -> channel {
                 render(&buffer);
@@ -156,7 +156,7 @@ fn draw_two_frames_bad2(+channel: double_buffer::client::acquire) {
                 release(channel, move buffer);
             }
         }
-    };
+    );
 }
 
 fn main() { }
index 9559d815def5c40b456cfef262e25d9c293bca1d..7f4f0b487e69e0cc73f633d83f6322b907079c19 100644 (file)
@@ -30,7 +30,7 @@ fn macros() {
 fn test(+foo: foo::client::foo, +bar: bar::client::bar) {
     import bar::do_baz;
 
-    select! {
+    select! (
         foo => {
             foo::do_foo -> _next {
             }
@@ -45,7 +45,7 @@ fn test(+foo: foo::client::foo, +bar: bar::client::bar) {
                 if *b { debug!("true") } else { debug!("false") }
             }
         }
-    }
+    )
 }
 
 fn main() {
index 209dc515bd04b4f1610261ec3535acea350575c7..8987b4695f272ddbbca47a503d67f516b7870ee5 100644 (file)
@@ -26,26 +26,26 @@ fn main() {
     let iotask = uv::global_loop::get();
     
     let c = pipes::spawn_service(stream::init, |p| { 
-        error!{"waiting for pipes"};
+        error!("waiting for pipes");
         let stream::send(x, p) = recv(p);
-        error!{"got pipes"};
+        error!("got pipes");
         let (left, right) : (oneshot::server::waiting,
                              oneshot::server::waiting)
             = x;
-        error!{"selecting"};
+        error!("selecting");
         let (i, _, _) = select(~[left, right]);
-        error!{"selected"};
+        error!("selected");
         assert i == 0;
 
-        error!{"waiting for pipes"};
+        error!("waiting for pipes");
         let stream::send(x, _) = recv(p);
-        error!{"got pipes"};
+        error!("got pipes");
         let (left, right) : (oneshot::server::waiting,
                              oneshot::server::waiting)
             = x;
-        error!{"selecting"};
+        error!("selecting");
         let (i, m, _) = select(~[left, right]);
-        error!{"selected %?", i};
+        error!("selected %?", i);
         if m != none {
             assert i == 1;
         }
@@ -85,7 +85,7 @@ fn test_select2() {
 
     stream::client::send(bc, ~"abc");
 
-    error!{"done with first select2"};
+    error!("done with first select2");
 
     let (ac, ap) = stream::init();
     let (bc, bp) = stream::init();
index 60c70bfec3073092707918abada80aa1ec9bf2a4..d02667ba74f0102d5ea128d4386bfd4ed0c1e8c2 100644 (file)
@@ -4,6 +4,6 @@
 fn main() {
     let p = &arena();
     let x = p.alloc(|| 4u);
-    io::print(fmt!{"%u", *x});
+    io::print(fmt!("%u", *x));
     assert *x == 4u;
 }
index 5d53731698e6c6dc4dcd5ce23be3e13c56b29d1e..7bb48aaebb9fc51a4a9e921cda89cc4bec602489 100644 (file)
@@ -2,21 +2,21 @@
 // This checks that preemption works.
 
 fn starve_main(alive: chan<int>) {
-    debug!{"signalling main"};
+    debug!("signalling main");
     alive <| 1;
-    debug!{"starving main"};
+    debug!("starving main");
     let i: int = 0;
     loop { i += 1; }
 }
 
 fn main() {
     let alive: port<int> = port();
-    debug!{"main started"};
+    debug!("main started");
     let s: task = spawn starve_main(chan(alive));
     let i: int;
-    debug!{"main waiting for alive signal"};
+    debug!("main waiting for alive signal");
     alive |> i;
-    debug!{"main got alive signal"};
-    while i < 50 { debug!{"main iterated"}; i += 1; }
-    debug!{"main completed"};
+    debug!("main got alive signal");
+    while i < 50 { debug!("main iterated"); i += 1; }
+    debug!("main completed");
 }
index d5c9b27fdf23bcb175122253935743ca4f0b4e1d..1671c3369fffa9b27fbdf5cfb8228edd05ca24ed 100644 (file)
@@ -9,12 +9,12 @@
         f: 0.0,
         g: true
     };
-    debug!{"test %?", a.b};
-    debug!{"test %u", a.c};
-    debug!{"test %i", a.d};
-    debug!{"test %c", a.e};
-    debug!{"test %f", a.f};
-    debug!{"test %b", a.g};
+    debug!("test %?", a.b);
+    debug!("test %u", a.c);
+    debug!("test %i", a.d);
+    debug!("test %c", a.e);
+    debug!("test %f", a.f);
+    debug!("test %b", a.g);
 }
 
 fn main() {
index cdd79e3c3c2ed11fbf8233c54d43410e9e54cd05..68f4da59bd44b7701cc85d2dde254a9958eed178 100644 (file)
@@ -18,21 +18,21 @@ fn main() {
 
     let x = @6;
     let y = x.get();
-    debug!{"y=%d", y};
+    debug!("y=%d", y);
     assert y == 6;
 
     let x = ~mut 6;
     let y = x.get();
-    debug!{"y=%d", y};
+    debug!("y=%d", y);
     assert y == 6;
 
     let x = ~6;
     let y = x.get();
-    debug!{"y=%d", y};
+    debug!("y=%d", y);
     assert y == 6;
 
     let x = &6;
     let y = x.get();
-    debug!{"y=%d", y};
+    debug!("y=%d", y);
     assert y == 6;
 }
index 2d08d9b6948ac15f06cb0bdb366c6bcb85ee93ad..8ac43d72bafd3f0a9ffacfda7282b5b215632328 100644 (file)
@@ -16,16 +16,16 @@ fn call_sum(x: &[int]) -> int { x.sum() }
 fn main() {
     let x = ~[1, 2, 3];
     let y = call_sum(x);
-    debug!{"y==%d", y};
+    debug!("y==%d", y);
     assert y == 6;
 
     let x = ~[mut 1, 2, 3];
     let y = x.sum();
-    debug!{"y==%d", y};
+    debug!("y==%d", y);
     assert y == 6;
 
     let x = ~[1, 2, 3];
     let y = x.sum();
-    debug!{"y==%d", y};
+    debug!("y==%d", y);
     assert y == 6;
 }
index 8dc326265d901e4845fef9346eea82f8c5ebbcd7..286adb6fd8f1ff151711c2ee8c1e0f1d9fa80927 100644 (file)
@@ -37,11 +37,11 @@ fn main() {
     let x = {c8: 22u8, t: {c64: 44u32}};
 
     // Send it through the shape code
-    let y = fmt!{"%?", x};
+    let y = fmt!("%?", x);
 
-    debug!{"align inner = %?", rusti::min_align_of::<inner>()};
-    debug!{"size outer = %?", sys::size_of::<outer>()};
-    debug!{"y = %s", y};
+    debug!("align inner = %?", rusti::min_align_of::<inner>());
+    debug!("size outer = %?", sys::size_of::<outer>());
+    debug!("y = %s", y);
 
     // per clang/gcc the alignment of `inner` is 4 on x86.
     assert rusti::min_align_of::<inner>() == m::align();
index c4a1b1b6a70c6979e247e72bbe7136a0b5cd8383..9d64d7bbbb8af06b216b2c7c62b6731acc857e57 100644 (file)
@@ -51,11 +51,11 @@ fn main() {
     let x = {c8: 22u8, t: {c64: 44u64}};
 
     // Send it through the shape code
-    let y = fmt!{"%?", x};
+    let y = fmt!("%?", x);
 
-    debug!{"align inner = %?", rusti::min_align_of::<inner>()};
-    debug!{"size outer = %?", sys::size_of::<outer>()};
-    debug!{"y = %s", y};
+    debug!("align inner = %?", rusti::min_align_of::<inner>());
+    debug!("size outer = %?", sys::size_of::<outer>());
+    debug!("y = %s", y);
 
     // per clang/gcc the alignment of `inner` is 4 on x86.
     assert rusti::min_align_of::<inner>() == m::m::align();
index de1e27f24f65bea49662a653cceb6f53f23ea7ea..bd9dc15bbbe9e7f6bb9eb6952cee45f63b37b9e5 100644 (file)
@@ -542,7 +542,7 @@ fn visit_enter_rec(_n_fields: uint,
                        _sz: uint, _align: uint) -> bool { true }
     fn visit_rec_field(_i: uint, _name: &str,
                        _mtbl: uint, inner: *tydesc) -> bool {
-        error!{"rec field!"};
+        error!("rec field!");
         self.visit_inner(inner)
     }
     fn visit_leave_rec(_n_fields: uint,
@@ -560,7 +560,7 @@ fn visit_leave_class(_n_fields: uint,
     fn visit_enter_tup(_n_fields: uint,
                        _sz: uint, _align: uint) -> bool { true }
     fn visit_tup_field(_i: uint, inner: *tydesc) -> bool {
-        error!{"tup field!"};
+        error!("tup field!");
         self.visit_inner(inner)
     }
     fn visit_leave_tup(_n_fields: uint,
@@ -616,14 +616,14 @@ fn main() {
                          mut vals: ~[]});
     let v = ptr_visit_adaptor({inner: u});
     let td = get_tydesc_for(r);
-    unsafe { error!{"tydesc sz: %u, align: %u",
-                    (*td).size, (*td).align}; }
+    unsafe { error!("tydesc sz: %u, align: %u",
+                    (*td).size, (*td).align); }
     let v = v as ty_visitor;
     visit_tydesc(td, v);
 
     for (copy u.vals).each |s| {
-        io::println(fmt!{"val: %s", s});
+        io::println(fmt!("val: %s", s));
     }
-    error!{"%?", copy u.vals};
+    error!("%?", copy u.vals);
     assert u.vals == ~[~"1", ~"2", ~"3", ~"true", ~"false", ~"5", ~"4", ~"3"];
  }
index b0ab99253c165b1fdf0c2b9d5e53369ece0f853e..1d9b782ecd063379fda5eac5f7a5776a43a9df41 100644 (file)
@@ -7,32 +7,32 @@
 impl of ty_visitor for my_visitor {
     fn visit_bot() -> bool {
         self.types += ["bot"];
-        error!{"visited bot type"};
+        error!("visited bot type");
         true
     }
     fn visit_nil() -> bool {
         self.types += ["nil"];
-        error!{"visited nil type"};
+        error!("visited nil type");
         true
     }
     fn visit_bool() -> bool {
         self.types += ["bool"];
-        error!{"visited bool type"};
+        error!("visited bool type");
         true
     }
     fn visit_int() -> bool {
         self.types += ["int"];
-        error!{"visited int type"};
+        error!("visited int type");
         true
     }
     fn visit_i8() -> bool {
         self.types += ["i8"];
-        error!{"visited i8 type"};
+        error!("visited i8 type");
         true
     }
     fn visit_i16() -> bool {
         self.types += ["i16"];
-        error!{"visited i16 type"};
+        error!("visited i16 type");
         true
     }
     fn visit_i32() -> bool { true }
@@ -143,7 +143,7 @@ fn main() {
     visit_ty::<~[int]>(vv);
 
     for (copy v.types).each {|s|
-        io::println(fmt!{"type: %s", s});
+        io::println(fmt!("type: %s", s));
     }
     assert v.types == ["bool", "int", "i8", "i16",
                        "[", "int", "]"];
index 2a78eea2f81e9545b43b6d42d9489892340021be..63d2147dcb44c8cf69d18aad5d439182e41cd5e9 100644 (file)
@@ -4,6 +4,6 @@ fn f(x : &a/int) -> &a/int {
 
 fn main() {
     let three = &3;
-    log(error, fmt!{"%d", *f(three)});
+    log(error, fmt!("%d", *f(three)));
 }
 
index a717f325f6aa81a14f51aa9006785966aa65bb50..a27c321ca5a0603adea777cc6f7979041c315f2e 100644 (file)
@@ -5,6 +5,6 @@ fn foo(x: &uint) -> uint {
 fn main() {
     let p = @22u;
     let r = foo(p);
-    debug!{"r=%u", r};
+    debug!("r=%u", r);
     assert r == 22u;
 }
index 8e8ede16d8c22471213b678023d1bade089059c7..d75f5659c2b304b8a5b93071606828797d6a665c 100644 (file)
@@ -4,16 +4,16 @@ struct r {
   let v: *int;
   new(v: *int) unsafe {
     self.v = v;
-    debug!{"r's ctor: v = %x, self = %x, self.v = %x",
+    debug!("r's ctor: v = %x, self = %x, self.v = %x",
            unsafe::reinterpret_cast::<*int, uint>(v),
            unsafe::reinterpret_cast::<*r, uint>(ptr::addr_of(self)),
-           unsafe::reinterpret_cast::<**int, uint>(ptr::addr_of(self.v))};
+           unsafe::reinterpret_cast::<**int, uint>(ptr::addr_of(self.v)));
      }
   drop unsafe {
-    debug!{"r's dtor: self = %x, self.v = %x, self.v's value = %x",
+    debug!("r's dtor: self = %x, self.v = %x, self.v's value = %x",
            unsafe::reinterpret_cast::<*r, uint>(ptr::addr_of(self)),
            unsafe::reinterpret_cast::<**int, uint>(ptr::addr_of(self.v)),
-           unsafe::reinterpret_cast::<*int, uint>(self.v)};
+           unsafe::reinterpret_cast::<*int, uint>(self.v));
     let v2: ~int = unsafe::reinterpret_cast(self.v); }
 }
 
@@ -34,28 +34,28 @@ fn main() unsafe {
         mut next: none,
           r: {
           let rs = r(i1p);
-          debug!{"r = %x",
-                 unsafe::reinterpret_cast::<*r, uint>(ptr::addr_of(rs))};
+          debug!("r = %x",
+                 unsafe::reinterpret_cast::<*r, uint>(ptr::addr_of(rs)));
           rs }
     });
     
-    debug!{"x1 = %x, x1.r = %x",
+    debug!("x1 = %x, x1.r = %x",
         unsafe::reinterpret_cast::<@t, uint>(x1),
-        unsafe::reinterpret_cast::<*r, uint>(ptr::addr_of(x1.r))};
+        unsafe::reinterpret_cast::<*r, uint>(ptr::addr_of(x1.r)));
 
     let x2 = @t({
         mut next: none,
           r: {
           let rs = r(i2p);
-          debug!{"r2 = %x",
-                 unsafe::reinterpret_cast::<*r, uint>(ptr::addr_of(rs))};
+          debug!("r2 = %x",
+                 unsafe::reinterpret_cast::<*r, uint>(ptr::addr_of(rs)));
           rs
             }
     });
     
-    debug!{"x2 = %x, x2.r = %x",
+    debug!("x2 = %x, x2.r = %x",
            unsafe::reinterpret_cast::<@t, uint>(x2),
-           unsafe::reinterpret_cast::<*r, uint>(ptr::addr_of(x2.r))};
+           unsafe::reinterpret_cast::<*r, uint>(ptr::addr_of(x2.r)));
 
     x1.next = some(x2);
     x2.next = some(x1);
index f6e32650b8ea58fb62054e6a64bdcaba2c5198c1..b935d7f13164086d40b8df4d3fe6a27567c46801 100644 (file)
@@ -8,6 +8,6 @@ struct shrinky_pointer {
 fn main() {
     let my_total = @@mut 10;
     { let pt <- shrinky_pointer(my_total); assert (pt.look_at() == 10); }
-    log(error, fmt!{"my_total = %d", **my_total});
+    log(error, fmt!("my_total = %d", **my_total));
     assert (**my_total == 9);
 }
index fb53463d5be85e58d3f8c85775c53703fda4ba1b..fe6ba4b08f43b9689e1bdeceab02c31bed74bb46 100644 (file)
@@ -19,15 +19,15 @@ fn main() unsafe {
     let po = comm::port();
     let ch = comm::chan(po);
     let parent_sched_id = rustrt::rust_get_sched_id();
-    error!{"parent %?", parent_sched_id};
+    error!("parent %?", parent_sched_id);
     let num_threads = 1u;
     let new_sched_id = rustrt::rust_new_sched(num_threads);
-    error!{"new_sched_id %?", new_sched_id};
+    error!("new_sched_id %?", new_sched_id);
     let new_task_id = rustrt::rust_new_task_in_sched(new_sched_id);
     assert !new_task_id.is_null();
     let f = fn~() {
         let child_sched_id = rustrt::rust_get_sched_id();
-        error!{"child_sched_id %?", child_sched_id};
+        error!("child_sched_id %?", child_sched_id);
         assert child_sched_id != parent_sched_id;
         assert child_sched_id == new_sched_id;
         comm::send(ch, ());
index acaac71cf74b3cb3b2ba7cc0b070b438d1f98164..777920c77e5040924153d8cc03ad0457051978de 100644 (file)
@@ -34,14 +34,14 @@ macro_rules! select_if {
               _ => fail
             }
         } else {
-            select_if!{
+            select_if!(
                 $index,
                 $count + 1
                 $(, $ports => [
                     $(type_this $messages$(($(x $xs),+))dont_type_this*
                       -> $nexts => { $es }),+
                 ])*
-            }
+            )
         }
     };
 }
@@ -54,9 +54,9 @@ macro_rules! select {
         } )+
     } => {
         let index = pipes::selecti([$(($port).header()),+]/_);
-        select_if!{index, 0 $(, $port => [
+        select_if!(index, 0 $(, $port => [
             $(type_this $message$(($(x $x),+))dont_type_this* -> $next => { $e }),+
-        ])+}
+        ])+)
     }
 }
 
index 0fa6e4568d4aecc9e810086c04b718d1d45a3233..a3d57b02ce3b087ffb9ea05dfe4bb693b3ca3753 100644 (file)
@@ -4,5 +4,5 @@ enum opt<T> { none, }
 
 fn main() {
     let x = none::<int>;
-    match x { none::<int> => { debug!{"hello world"}; } }
+    match x { none::<int> => { debug!("hello world"); } }
 }
index 5403d79f4f91bca4089b2a630482b8e662115d5f..992be4165989376086f52722abacbe358ca4a4bc 100644 (file)
@@ -6,8 +6,8 @@ enum clam<T> { a(T, int), b, }
 
 fn uhoh<T>(v: ~[clam<T>]) {
     match v[1] {
-      a::<T>(t, u) => { debug!{"incorrect"}; log(debug, u); fail; }
-      b::<T> => { debug!{"correct"}; }
+      a::<T>(t, u) => { debug!("incorrect"); log(debug, u); fail; }
+      b::<T> => { debug!("correct"); }
     }
 }
 
index c0cbd0a5639f03f7291ddef15494456d5caa9ef7..b05b73d216070a7f9942789feb04947aa71f2cc7 100644 (file)
@@ -14,5 +14,5 @@ fn main() {
     task::spawn(|| x(~"hello from second spawned fn", 66) );
     task::spawn(|| x(~"hello from third spawned fn", 67) );
     let mut i: int = 30;
-    while i > 0 { i = i - 1; debug!{"parent sleeping"}; yield(); }
+    while i > 0 { i = i - 1; debug!("parent sleeping"); yield(); }
 }
index 33579fc3d0455db1d89e06e9dd65104bbd3eb945..3b3a3eae624b62d05dcce49ecde42648060316a7 100644 (file)
@@ -13,10 +13,10 @@ fn test1() {
              c: 0xcccc_cccc_cccc_cccc_u64,
              d: 0xdddd_dddd_dddd_dddd_u64 };
     let qq = rustrt::debug_abi_1(q);
-    error!{"a: %x", qq.a as uint};
-    error!{"b: %x", qq.b as uint};
-    error!{"c: %x", qq.c as uint};
-    error!{"d: %x", qq.d as uint};
+    error!("a: %x", qq.a as uint);
+    error!("b: %x", qq.b as uint);
+    error!("c: %x", qq.c as uint);
+    error!("d: %x", qq.d as uint);
     assert qq.a == q.c + 1u64;
     assert qq.b == q.d - 1u64;
     assert qq.c == q.a + 1u64;
@@ -29,9 +29,9 @@ fn test2() {
              b: 0b_1010_1010_u8,
              c: 1.0987654321e-15_f64 };
     let ff = rustrt::debug_abi_2(f);
-    error!{"a: %f", ff.a as float};
-    error!{"b: %u", ff.b as uint};
-    error!{"c: %f", ff.c as float};
+    error!("a: %f", ff.a as float);
+    error!("b: %u", ff.b as uint);
+    error!("c: %f", ff.c as float);
     assert ff.a == f.c + 1.0f64;
     assert ff.b == 0xff_u8;
     assert ff.c == f.a - 1.0f64;
index bdf839d8b1f8d531c6a79f5b3fa78028aee1844c..48f5aeb2a3fa4d0597c97fb87a9ed17f55312118 100644 (file)
@@ -8,10 +8,10 @@ fn test(actual: ~str, expected: ~str) {
 }
 
 fn main() {
-    test(fmt!{"hello %d friends and %s things", 10, ~"formatted"},
+    test(fmt!("hello %d friends and %s things", 10, ~"formatted"),
          ~"hello 10 friends and formatted things");
 
-    test(fmt!{"test"}, ~"test");
+    test(fmt!("test"), ~"test");
 
     // a quadratic optimization in LLVM (jump-threading) makes this test a
     // bit slow to compile unless we break it up
@@ -28,226 +28,226 @@ fn main() {
 fn part1() {
     // Simple tests for types
 
-    test(fmt!{"%d", 1}, ~"1");
-    test(fmt!{"%i", 2}, ~"2");
-    test(fmt!{"%i", -1}, ~"-1");
-    test(fmt!{"%u", 10u}, ~"10");
-    test(fmt!{"%s", ~"test"}, ~"test");
-    test(fmt!{"%b", true}, ~"true");
-    test(fmt!{"%b", false}, ~"false");
-    test(fmt!{"%c", 'A'}, ~"A");
-    test(fmt!{"%x", 0xff_u}, ~"ff");
-    test(fmt!{"%X", 0x12ab_u}, ~"12AB");
-    test(fmt!{"%o", 10u}, ~"12");
-    test(fmt!{"%t", 0b11010101_u}, ~"11010101");
-    test(fmt!{"%f", 5.82}, ~"5.82");
+    test(fmt!("%d", 1), ~"1");
+    test(fmt!("%i", 2), ~"2");
+    test(fmt!("%i", -1), ~"-1");
+    test(fmt!("%u", 10u), ~"10");
+    test(fmt!("%s", ~"test"), ~"test");
+    test(fmt!("%b", true), ~"true");
+    test(fmt!("%b", false), ~"false");
+    test(fmt!("%c", 'A'), ~"A");
+    test(fmt!("%x", 0xff_u), ~"ff");
+    test(fmt!("%X", 0x12ab_u), ~"12AB");
+    test(fmt!("%o", 10u), ~"12");
+    test(fmt!("%t", 0b11010101_u), ~"11010101");
+    test(fmt!("%f", 5.82), ~"5.82");
     // 32-bit limits
 
-    test(fmt!{"%i", -2147483648}, ~"-2147483648");
-    test(fmt!{"%i", 2147483647}, ~"2147483647");
-    test(fmt!{"%u", 4294967295u}, ~"4294967295");
-    test(fmt!{"%x", 0xffffffff_u}, ~"ffffffff");
-    test(fmt!{"%o", 0xffffffff_u}, ~"37777777777");
-    test(fmt!{"%t", 0xffffffff_u}, ~"11111111111111111111111111111111");
+    test(fmt!("%i", -2147483648), ~"-2147483648");
+    test(fmt!("%i", 2147483647), ~"2147483647");
+    test(fmt!("%u", 4294967295u), ~"4294967295");
+    test(fmt!("%x", 0xffffffff_u), ~"ffffffff");
+    test(fmt!("%o", 0xffffffff_u), ~"37777777777");
+    test(fmt!("%t", 0xffffffff_u), ~"11111111111111111111111111111111");
 }
 fn part2() {
     // Widths
 
-    test(fmt!{"%1d", 500}, ~"500");
-    test(fmt!{"%10d", 500}, ~"       500");
-    test(fmt!{"%10d", -500}, ~"      -500");
-    test(fmt!{"%10u", 500u}, ~"       500");
-    test(fmt!{"%10s", ~"test"}, ~"      test");
-    test(fmt!{"%10b", true}, ~"      true");
-    test(fmt!{"%10x", 0xff_u}, ~"        ff");
-    test(fmt!{"%10X", 0xff_u}, ~"        FF");
-    test(fmt!{"%10o", 10u}, ~"        12");
-    test(fmt!{"%10t", 0xff_u}, ~"  11111111");
-    test(fmt!{"%10c", 'A'}, ~"         A");
-    test(fmt!{"%10f", 5.82}, ~"      5.82");
+    test(fmt!("%1d", 500), ~"500");
+    test(fmt!("%10d", 500), ~"       500");
+    test(fmt!("%10d", -500), ~"      -500");
+    test(fmt!("%10u", 500u), ~"       500");
+    test(fmt!("%10s", ~"test"), ~"      test");
+    test(fmt!("%10b", true), ~"      true");
+    test(fmt!("%10x", 0xff_u), ~"        ff");
+    test(fmt!("%10X", 0xff_u), ~"        FF");
+    test(fmt!("%10o", 10u), ~"        12");
+    test(fmt!("%10t", 0xff_u), ~"  11111111");
+    test(fmt!("%10c", 'A'), ~"         A");
+    test(fmt!("%10f", 5.82), ~"      5.82");
     // Left justify
 
-    test(fmt!{"%-10d", 500}, ~"500       ");
-    test(fmt!{"%-10d", -500}, ~"-500      ");
-    test(fmt!{"%-10u", 500u}, ~"500       ");
-    test(fmt!{"%-10s", ~"test"}, ~"test      ");
-    test(fmt!{"%-10b", true}, ~"true      ");
-    test(fmt!{"%-10x", 0xff_u}, ~"ff        ");
-    test(fmt!{"%-10X", 0xff_u}, ~"FF        ");
-    test(fmt!{"%-10o", 10u}, ~"12        ");
-    test(fmt!{"%-10t", 0xff_u}, ~"11111111  ");
-    test(fmt!{"%-10c", 'A'}, ~"A         ");
-    test(fmt!{"%-10f", 5.82}, ~"5.82      ");
+    test(fmt!("%-10d", 500), ~"500       ");
+    test(fmt!("%-10d", -500), ~"-500      ");
+    test(fmt!("%-10u", 500u), ~"500       ");
+    test(fmt!("%-10s", ~"test"), ~"test      ");
+    test(fmt!("%-10b", true), ~"true      ");
+    test(fmt!("%-10x", 0xff_u), ~"ff        ");
+    test(fmt!("%-10X", 0xff_u), ~"FF        ");
+    test(fmt!("%-10o", 10u), ~"12        ");
+    test(fmt!("%-10t", 0xff_u), ~"11111111  ");
+    test(fmt!("%-10c", 'A'), ~"A         ");
+    test(fmt!("%-10f", 5.82), ~"5.82      ");
 }
 
 fn part3() {
     // Precision
 
-    test(fmt!{"%.d", 0}, ~"");
-    test(fmt!{"%.u", 0u}, ~"");
-    test(fmt!{"%.x", 0u}, ~"");
-    test(fmt!{"%.t", 0u}, ~"");
-    test(fmt!{"%.d", 10}, ~"10");
-    test(fmt!{"%.d", -10}, ~"-10");
-    test(fmt!{"%.u", 10u}, ~"10");
-    test(fmt!{"%.s", ~"test"}, ~"");
-    test(fmt!{"%.x", 127u}, ~"7f");
-    test(fmt!{"%.o", 10u}, ~"12");
-    test(fmt!{"%.t", 3u}, ~"11");
-    test(fmt!{"%.c", 'A'}, ~"A");
-    test(fmt!{"%.f", 5.82}, ~"6");
-    test(fmt!{"%.0d", 0}, ~"");
-    test(fmt!{"%.0u", 0u}, ~"");
-    test(fmt!{"%.0x", 0u}, ~"");
-    test(fmt!{"%.0t", 0u}, ~"");
-    test(fmt!{"%.0d", 10}, ~"10");
-    test(fmt!{"%.0d", -10}, ~"-10");
-    test(fmt!{"%.0u", 10u}, ~"10");
-    test(fmt!{"%.0s", ~"test"}, ~"");
-    test(fmt!{"%.0x", 127u}, ~"7f");
-    test(fmt!{"%.0o", 10u}, ~"12");
-    test(fmt!{"%.0t", 3u}, ~"11");
-    test(fmt!{"%.0c", 'A'}, ~"A");
-    test(fmt!{"%.0f", 5.892}, ~"6");
-    test(fmt!{"%.1d", 0}, ~"0");
-    test(fmt!{"%.1u", 0u}, ~"0");
-    test(fmt!{"%.1x", 0u}, ~"0");
-    test(fmt!{"%.1t", 0u}, ~"0");
-    test(fmt!{"%.1d", 10}, ~"10");
-    test(fmt!{"%.1d", -10}, ~"-10");
-    test(fmt!{"%.1u", 10u}, ~"10");
-    test(fmt!{"%.1s", ~"test"}, ~"t");
-    test(fmt!{"%.1x", 127u}, ~"7f");
-    test(fmt!{"%.1o", 10u}, ~"12");
-    test(fmt!{"%.1t", 3u}, ~"11");
-    test(fmt!{"%.1c", 'A'}, ~"A");
-    test(fmt!{"%.1f", 5.82}, ~"5.8");
+    test(fmt!("%.d", 0), ~"");
+    test(fmt!("%.u", 0u), ~"");
+    test(fmt!("%.x", 0u), ~"");
+    test(fmt!("%.t", 0u), ~"");
+    test(fmt!("%.d", 10), ~"10");
+    test(fmt!("%.d", -10), ~"-10");
+    test(fmt!("%.u", 10u), ~"10");
+    test(fmt!("%.s", ~"test"), ~"");
+    test(fmt!("%.x", 127u), ~"7f");
+    test(fmt!("%.o", 10u), ~"12");
+    test(fmt!("%.t", 3u), ~"11");
+    test(fmt!("%.c", 'A'), ~"A");
+    test(fmt!("%.f", 5.82), ~"6");
+    test(fmt!("%.0d", 0), ~"");
+    test(fmt!("%.0u", 0u), ~"");
+    test(fmt!("%.0x", 0u), ~"");
+    test(fmt!("%.0t", 0u), ~"");
+    test(fmt!("%.0d", 10), ~"10");
+    test(fmt!("%.0d", -10), ~"-10");
+    test(fmt!("%.0u", 10u), ~"10");
+    test(fmt!("%.0s", ~"test"), ~"");
+    test(fmt!("%.0x", 127u), ~"7f");
+    test(fmt!("%.0o", 10u), ~"12");
+    test(fmt!("%.0t", 3u), ~"11");
+    test(fmt!("%.0c", 'A'), ~"A");
+    test(fmt!("%.0f", 5.892), ~"6");
+    test(fmt!("%.1d", 0), ~"0");
+    test(fmt!("%.1u", 0u), ~"0");
+    test(fmt!("%.1x", 0u), ~"0");
+    test(fmt!("%.1t", 0u), ~"0");
+    test(fmt!("%.1d", 10), ~"10");
+    test(fmt!("%.1d", -10), ~"-10");
+    test(fmt!("%.1u", 10u), ~"10");
+    test(fmt!("%.1s", ~"test"), ~"t");
+    test(fmt!("%.1x", 127u), ~"7f");
+    test(fmt!("%.1o", 10u), ~"12");
+    test(fmt!("%.1t", 3u), ~"11");
+    test(fmt!("%.1c", 'A'), ~"A");
+    test(fmt!("%.1f", 5.82), ~"5.8");
 }
 fn part4() {
-    test(fmt!{"%.5d", 0}, ~"00000");
-    test(fmt!{"%.5u", 0u}, ~"00000");
-    test(fmt!{"%.5x", 0u}, ~"00000");
-    test(fmt!{"%.5t", 0u}, ~"00000");
-    test(fmt!{"%.5d", 10}, ~"00010");
-    test(fmt!{"%.5d", -10}, ~"-00010");
-    test(fmt!{"%.5u", 10u}, ~"00010");
-    test(fmt!{"%.5s", ~"test"}, ~"test");
-    test(fmt!{"%.5x", 127u}, ~"0007f");
-    test(fmt!{"%.5o", 10u}, ~"00012");
-    test(fmt!{"%.5t", 3u}, ~"00011");
-    test(fmt!{"%.5c", 'A'}, ~"A");
-    test(fmt!{"%.5f", 5.82}, ~"5.82000");
-    test(fmt!{"%.5f", 5.0}, ~"5.00000");
-    test(fmt!{"%.100f", 1.1}, ~"1.1000000000000000888178419700125232338905334472656250000000000000000000000000000000000000000000000000");
+    test(fmt!("%.5d", 0), ~"00000");
+    test(fmt!("%.5u", 0u), ~"00000");
+    test(fmt!("%.5x", 0u), ~"00000");
+    test(fmt!("%.5t", 0u), ~"00000");
+    test(fmt!("%.5d", 10), ~"00010");
+    test(fmt!("%.5d", -10), ~"-00010");
+    test(fmt!("%.5u", 10u), ~"00010");
+    test(fmt!("%.5s", ~"test"), ~"test");
+    test(fmt!("%.5x", 127u), ~"0007f");
+    test(fmt!("%.5o", 10u), ~"00012");
+    test(fmt!("%.5t", 3u), ~"00011");
+    test(fmt!("%.5c", 'A'), ~"A");
+    test(fmt!("%.5f", 5.82), ~"5.82000");
+    test(fmt!("%.5f", 5.0), ~"5.00000");
+    test(fmt!("%.100f", 1.1), ~"1.1000000000000000888178419700125232338905334472656250000000000000000000000000000000000000000000000000");
 
     // Bool precision. I'm not sure if it's good or bad to have bool
     // conversions support precision - it's not standard printf so we
     // can do whatever. For now I'm making it behave the same as string
     // conversions.
 
-    test(fmt!{"%.b", true}, ~"");
-    test(fmt!{"%.0b", true}, ~"");
-    test(fmt!{"%.1b", true}, ~"t");
+    test(fmt!("%.b", true), ~"");
+    test(fmt!("%.0b", true), ~"");
+    test(fmt!("%.1b", true), ~"t");
 }
 
 fn part5() {
     // Explicit + sign. Only for signed conversions
 
-    test(fmt!{"%+d", 0}, ~"+0");
-    test(fmt!{"%+d", 1}, ~"+1");
-    test(fmt!{"%+d", -1}, ~"-1");
-    test(fmt!{"%+f", 0.0}, ~"+0");
+    test(fmt!("%+d", 0), ~"+0");
+    test(fmt!("%+d", 1), ~"+1");
+    test(fmt!("%+d", -1), ~"-1");
+    test(fmt!("%+f", 0.0), ~"+0");
     // Leave space for sign
 
-    test(fmt!{"% d", 0}, ~" 0");
-    test(fmt!{"% d", 1}, ~" 1");
-    test(fmt!{"% d", -1}, ~"-1");
-    test(fmt!{"% f", 0.0}, ~" 0");
+    test(fmt!("% d", 0), ~" 0");
+    test(fmt!("% d", 1), ~" 1");
+    test(fmt!("% d", -1), ~"-1");
+    test(fmt!("% f", 0.0), ~" 0");
     // Plus overrides space
 
-    test(fmt!{"% +d", 0}, ~"+0");
-    test(fmt!{"%+ d", 0}, ~"+0");
-    test(fmt!{"% +f", 0.0}, ~"+0");
-    test(fmt!{"%+ f", 0.0}, ~"+0");
+    test(fmt!("% +d", 0), ~"+0");
+    test(fmt!("%+ d", 0), ~"+0");
+    test(fmt!("% +f", 0.0), ~"+0");
+    test(fmt!("%+ f", 0.0), ~"+0");
     // 0-padding
 
-    test(fmt!{"%05d", 0}, ~"00000");
-    test(fmt!{"%05d", 1}, ~"00001");
-    test(fmt!{"%05d", -1}, ~"-0001");
-    test(fmt!{"%05u", 1u}, ~"00001");
-    test(fmt!{"%05x", 127u}, ~"0007f");
-    test(fmt!{"%05X", 127u}, ~"0007F");
-    test(fmt!{"%05o", 10u}, ~"00012");
-    test(fmt!{"%05t", 3u}, ~"00011");
-    test(fmt!{"%05f", 5.82}, ~"05.82");
+    test(fmt!("%05d", 0), ~"00000");
+    test(fmt!("%05d", 1), ~"00001");
+    test(fmt!("%05d", -1), ~"-0001");
+    test(fmt!("%05u", 1u), ~"00001");
+    test(fmt!("%05x", 127u), ~"0007f");
+    test(fmt!("%05X", 127u), ~"0007F");
+    test(fmt!("%05o", 10u), ~"00012");
+    test(fmt!("%05t", 3u), ~"00011");
+    test(fmt!("%05f", 5.82), ~"05.82");
     // 0-padding a string is undefined but glibc does this:
 
-    test(fmt!{"%05s", ~"test"}, ~" test");
-    test(fmt!{"%05c", 'A'}, ~"    A");
-    test(fmt!{"%05b", true}, ~" true");
+    test(fmt!("%05s", ~"test"), ~" test");
+    test(fmt!("%05c", 'A'), ~"    A");
+    test(fmt!("%05b", true), ~" true");
     // Left-justify overrides 0-padding
 
-    test(fmt!{"%-05d", 0}, ~"0    ");
-    test(fmt!{"%-05d", 1}, ~"1    ");
-    test(fmt!{"%-05d", -1}, ~"-1   ");
-    test(fmt!{"%-05u", 1u}, ~"1    ");
-    test(fmt!{"%-05x", 127u}, ~"7f   ");
-    test(fmt!{"%-05X", 127u}, ~"7F   ");
-    test(fmt!{"%-05o", 10u}, ~"12   ");
-    test(fmt!{"%-05t", 3u}, ~"11   ");
-    test(fmt!{"%-05s", ~"test"}, ~"test ");
-    test(fmt!{"%-05c", 'A'}, ~"A    ");
-    test(fmt!{"%-05b", true}, ~"true ");
-    test(fmt!{"%-05f", 5.82}, ~"5.82 ");
+    test(fmt!("%-05d", 0), ~"0    ");
+    test(fmt!("%-05d", 1), ~"1    ");
+    test(fmt!("%-05d", -1), ~"-1   ");
+    test(fmt!("%-05u", 1u), ~"1    ");
+    test(fmt!("%-05x", 127u), ~"7f   ");
+    test(fmt!("%-05X", 127u), ~"7F   ");
+    test(fmt!("%-05o", 10u), ~"12   ");
+    test(fmt!("%-05t", 3u), ~"11   ");
+    test(fmt!("%-05s", ~"test"), ~"test ");
+    test(fmt!("%-05c", 'A'), ~"A    ");
+    test(fmt!("%-05b", true), ~"true ");
+    test(fmt!("%-05f", 5.82), ~"5.82 ");
 }
 fn part6() {
     // Precision overrides 0-padding
     // FIXME #2481: Recent gcc's report some of these as warnings
 
-    test(fmt!{"%06.5d", 0}, ~" 00000");
-    test(fmt!{"%06.5u", 0u}, ~" 00000");
-    test(fmt!{"%06.5x", 0u}, ~" 00000");
-    test(fmt!{"%06.5d", 10}, ~" 00010");
-    test(fmt!{"%06.5d", -10}, ~"-00010");
-    test(fmt!{"%06.5u", 10u}, ~" 00010");
-    test(fmt!{"%06.5s", ~"test"}, ~"  test");
-    test(fmt!{"%06.5c", 'A'}, ~"     A");
-    test(fmt!{"%06.5x", 127u}, ~" 0007f");
-    test(fmt!{"%06.5X", 127u}, ~" 0007F");
-    test(fmt!{"%06.5o", 10u}, ~" 00012");
+    test(fmt!("%06.5d", 0), ~" 00000");
+    test(fmt!("%06.5u", 0u), ~" 00000");
+    test(fmt!("%06.5x", 0u), ~" 00000");
+    test(fmt!("%06.5d", 10), ~" 00010");
+    test(fmt!("%06.5d", -10), ~"-00010");
+    test(fmt!("%06.5u", 10u), ~" 00010");
+    test(fmt!("%06.5s", ~"test"), ~"  test");
+    test(fmt!("%06.5c", 'A'), ~"     A");
+    test(fmt!("%06.5x", 127u), ~" 0007f");
+    test(fmt!("%06.5X", 127u), ~" 0007F");
+    test(fmt!("%06.5o", 10u), ~" 00012");
 
     // Precision does not override zero-padding for floats
-    test(fmt!{"%08.5f", 5.82}, ~"05.82000");
+    test(fmt!("%08.5f", 5.82), ~"05.82000");
 
     // Signed combinations
 
-    test(fmt!{"% 5d", 1}, ~"    1");
-    test(fmt!{"% 5d", -1}, ~"   -1");
-    test(fmt!{"%+5d", 1}, ~"   +1");
-    test(fmt!{"%+5d", -1}, ~"   -1");
-    test(fmt!{"% 05d", 1}, ~" 0001");
-    test(fmt!{"% 05d", -1}, ~"-0001");
-    test(fmt!{"%+05d", 1}, ~"+0001");
-    test(fmt!{"%+05d", -1}, ~"-0001");
-    test(fmt!{"%- 5d", 1}, ~" 1   ");
-    test(fmt!{"%- 5d", -1}, ~"-1   ");
-    test(fmt!{"%-+5d", 1}, ~"+1   ");
-    test(fmt!{"%-+5d", -1}, ~"-1   ");
-    test(fmt!{"%- 05d", 1}, ~" 1   ");
-    test(fmt!{"%- 05d", -1}, ~"-1   ");
-    test(fmt!{"%-+05d", 1}, ~"+1   ");
-    test(fmt!{"%-+05d", -1}, ~"-1   ");
+    test(fmt!("% 5d", 1), ~"    1");
+    test(fmt!("% 5d", -1), ~"   -1");
+    test(fmt!("%+5d", 1), ~"   +1");
+    test(fmt!("%+5d", -1), ~"   -1");
+    test(fmt!("% 05d", 1), ~" 0001");
+    test(fmt!("% 05d", -1), ~"-0001");
+    test(fmt!("%+05d", 1), ~"+0001");
+    test(fmt!("%+05d", -1), ~"-0001");
+    test(fmt!("%- 5d", 1), ~" 1   ");
+    test(fmt!("%- 5d", -1), ~"-1   ");
+    test(fmt!("%-+5d", 1), ~"+1   ");
+    test(fmt!("%-+5d", -1), ~"-1   ");
+    test(fmt!("%- 05d", 1), ~" 1   ");
+    test(fmt!("%- 05d", -1), ~"-1   ");
+    test(fmt!("%-+05d", 1), ~"+1   ");
+    test(fmt!("%-+05d", -1), ~"-1   ");
 }
 
 fn percent() {
-    let s = fmt!{"ab%%cd"};
+    let s = fmt!("ab%%cd");
     assert(s == ~"ab%cd");
 }
 
 fn more_floats() {
-    assert ~"3.1416"      == fmt!{"%.4f", 3.14159};
-    assert ~"3"           == fmt!{"%.0f", 3.14159};
-    assert ~"99"          == fmt!{"%.0f", 98.5};
-    assert ~"7.0000"      == fmt!{"%.4f", 6.999999999};
-    assert ~"3.141590000" == fmt!{"%.9f", 3.14159};
+    assert ~"3.1416"      == fmt!("%.4f", 3.14159);
+    assert ~"3"           == fmt!("%.0f", 3.14159);
+    assert ~"99"          == fmt!("%.0f", 98.5);
+    assert ~"7.0000"      == fmt!("%.4f", 6.999999999);
+    assert ~"3.141590000" == fmt!("%.9f", 3.14159);
 }
\ No newline at end of file
index fd1cfc865c44270157ff9f497a4115d780711849..4ef78a1eb98d74e712df01caa110e25465690b1f 100644 (file)
@@ -1,8 +1,8 @@
 
 fn main() {
     let asdf_fdsa = ~"<.<";
-    assert (concat_idents!{asd, f_f, dsa} == ~"<.<");
+    assert (concat_idents!(asd, f_f, dsa) == ~"<.<");
 
-    assert (ident_to_str!{use_mention_distinction} ==
+    assert (ident_to_str!(use_mention_distinction) ==
                 ~"use_mention_distinction");
 }
index 3f7355a131cc1dd2d4f1f2bba720d5cd4b55278e..f20427dec880c0f58ce0834342ab2e5f9b277378 100644 (file)
@@ -3,23 +3,23 @@
 
 mod m1 {
     mod m2 {
-        fn where_am_i() -> ~str { module_path!{} }
+        fn where_am_i() -> ~str { module_path!() }
     }
 }
 
 fn main() {
-    assert(line!{} == 11u);
-    assert(col!{} == 11u);
-    assert(file!{}.ends_with(~"syntax-extension-source-utils.rs"));
-    assert(stringify!{(2*3) + 5} == ~"2 * 3 + 5");
-    assert(include!{"syntax-extension-source-utils-files/includeme.fragment"}
+    assert(line!() == 11u);
+    assert(col!() == 11u);
+    assert(file!().ends_with(~"syntax-extension-source-utils.rs"));
+    assert(stringify!((2*3) + 5) == ~"2 * 3 + 5");
+    assert(include!("syntax-extension-source-utils-files/includeme.fragment")
            == ~"victory robot 6");
 
     assert(
-        include_str!{"syntax-extension-source-utils-files/includeme.fragment"}
+        include_str!("syntax-extension-source-utils-files/includeme.fragment")
         .starts_with(~"/* this is for "));
     assert(
-        include_bin!{"syntax-extension-source-utils-files/includeme.fragment"}
+        include_bin!("syntax-extension-source-utils-files/includeme.fragment")
         [1] == (42 as u8)); // '*'
     // The Windows tests are wrapped in an extra module for some reason
     assert(m1::m2::where_am_i().ends_with(~"m1::m2"));
index 6753dc545906c2472f62081dfe0de271141d51c8..d566755f070f8c8fee5d720647d0068b1aa101b7 100644 (file)
@@ -13,7 +13,7 @@
 
 fn main() {
     let x = {c8: 22u8, t: a_tag(44u64)};
-    let y = fmt!{"%?", x};
-    debug!{"y = %s", y};
+    let y = fmt!("%?", x);
+    debug!("y = %s", y);
     assert y == "(22, a_tag(44))";
 }
index 645a58d33e18b5712f3152f9c08b28fd2653d5fd..86114f3ed8e6bb70a1c507d0a1011661973a9e05 100644 (file)
@@ -2,8 +2,8 @@ enum color { red, green, blue, black, white, }
 
 fn main() {
     // Ideally we would print the name of the variant, not the number
-    assert (uint::to_str(red as uint, 10u) == fmt!{"%?", red});
-    assert (uint::to_str(green as uint, 10u) == fmt!{"%?", green});
-    assert (uint::to_str(white as uint, 10u) == fmt!{"%?", white});
+    assert (uint::to_str(red as uint, 10u) == fmt!("%?", red));
+    assert (uint::to_str(green as uint, 10u) == fmt!("%?", green));
+    assert (uint::to_str(white as uint, 10u) == fmt!("%?", white));
 }
 
index 7957dde5753eef5884e98f224f8e78b11425c65c..8607199e7a1de79d8fd3d37a8b665ed6bfe9507a 100644 (file)
@@ -7,8 +7,8 @@ enum color {
 }
 
 fn main() {
-    assert uint::to_str(red as uint, 10u) == fmt!{"%?", red};
-    assert uint::to_str(green as uint, 10u) == fmt!{"%?", green};
-    assert uint::to_str(white as uint, 10u) == fmt!{"%?", white};
+    assert uint::to_str(red as uint, 10u) == fmt!("%?", red);
+    assert uint::to_str(green as uint, 10u) == fmt!("%?", green);
+    assert uint::to_str(white as uint, 10u) == fmt!("%?", white);
 }
 
index 2b921bd77262a101292629b7f11ea4aefa93a263..53310ae7e0ab8c281a0ab7bb3cb5f696eb7cc1f3 100644 (file)
@@ -7,13 +7,13 @@
 fn main() { let k = checktrue; evenk(42, k); oddk(45, k); }
 
 fn evenk(n: int, k: extern fn(bool) -> bool) -> bool {
-    debug!{"evenk"};
+    debug!("evenk");
     log(debug, n);
     if n == 0 { return k(true); } else { return oddk(n - 1, k); }
 }
 
 fn oddk(n: int, k: extern fn(bool) -> bool) -> bool {
-    debug!{"oddk"};
+    debug!("oddk");
     log(debug, n);
     if n == 0 { return k(false); } else { return evenk(n - 1, k); }
 }
index 94aded889bfdfb844b199de560bdef571bec1788..0b3871b1151b2e52cf119bfd39c17272fabe13b0 100644 (file)
@@ -9,11 +9,11 @@
 
 fn test05_start(ch : chan<int>) {
     ch.send(10);
-    error!{"sent 10"};
+    error!("sent 10");
     ch.send(20);
-    error!{"sent 20"};
+    error!("sent 20");
     ch.send(30);
-    error!{"sent 30"};
+    error!("sent 30");
 }
 
 fn test05() {
index 40ee4753bdd6507ead90fb7d7a84a23ac25f1fb6..3418569412d00eaea5b9adec66769c5c8d0f5a65 100644 (file)
@@ -1,8 +1,8 @@
 fn main() { test00(); }
 
-fn start() { debug!{"Started / Finished task."}; }
+fn start() { debug!("Started / Finished task."); }
 
 fn test00() {
     task::try(|| start() );
-    debug!{"Completing."};
+    debug!("Completing.");
 }
index 9aa68813955b06907efccd687215076074545afa..2a9a5b78b18dee03c21f827b5c23bfcafd156f4c 100644 (file)
@@ -3,7 +3,7 @@
 
 fn main() { test00(); }
 
-fn start(&&task_number: int) { debug!{"Started / Finished task."}; }
+fn start(&&task_number: int) { debug!("Started / Finished task."); }
 
 fn test00() {
     let i: int = 0;
@@ -22,5 +22,5 @@ fn test00() {
     // Try joining tasks that have already finished.
     future::get(&option::unwrap(result));
 
-    debug!{"Joined task."};
+    debug!("Joined task.");
 }
index 394bb2561841688fdd5ac8c5d4a7b55a3d6909ab..20e9dc9657dd99ded84e481b9bbc4a15113790da 100644 (file)
@@ -9,8 +9,8 @@ fn start(c: pipes::chan<int>, start: int, number_of_messages: int) {
 }
 
 fn main() {
-    debug!{"Check that we don't deadlock."};
+    debug!("Check that we don't deadlock.");
     let (ch, p) = pipes::stream();
     task::try(|| start(ch, 0, 10) );
-    debug!{"Joined task"};
+    debug!("Joined task");
 }
index 0b7e939ce313884e7ac11daa3451c40d753f3165..db3aa09090a71190f7fb45ac78fc55467b6c63dd 100644 (file)
@@ -23,7 +23,7 @@ fn main() {
         i = i - 1;
     }
 
-    debug!{"main thread exiting"};
+    debug!("main thread exiting");
 }
 
 fn child(x: int, ch: pipes::chan<int>) {
index 1c116787eafcda03aecebe1688bea41a6c4061f3..3e6e66f5bcd1ea489a28c4034ec3e806547025f9 100644 (file)
@@ -5,24 +5,24 @@
 import pipes::send;
 import pipes::recv;
 
-fn main() { debug!{"===== WITHOUT THREADS ====="}; test00(); }
+fn main() { debug!("===== WITHOUT THREADS ====="); test00(); }
 
 fn test00_start(ch: chan<int>, message: int, count: int) {
-    debug!{"Starting test00_start"};
+    debug!("Starting test00_start");
     let mut i: int = 0;
     while i < count {
-        debug!{"Sending Message"};
+        debug!("Sending Message");
         ch.send(message + 0);
         i = i + 1;
     }
-    debug!{"Ending test00_start"};
+    debug!("Ending test00_start");
 }
 
 fn test00() {
     let number_of_tasks: int = 16;
     let number_of_messages: int = 4;
 
-    debug!{"Creating tasks"};
+    debug!("Creating tasks");
 
     let po = pipes::PortSet();
 
@@ -54,7 +54,7 @@ fn test00() {
     // Join spawned tasks...
     for results.each |r| { future::get(&r); }
 
-    debug!{"Completed: Final number is: "};
+    debug!("Completed: Final number is: ");
     log(error, sum);
     // assert (sum == (((number_of_tasks * (number_of_tasks - 1)) / 2) *
     //       number_of_messages));
index 399ce8e808bbcef0725814c8d5a5361b7c505784..6baca1681d7ee398cd1832986870a3f6511e010a 100644 (file)
@@ -19,20 +19,20 @@ fn main() {
 }
 
 fn test00_start(ch: Chan<int>, message: int, count: int) {
-    debug!{"Starting test00_start"};
+    debug!("Starting test00_start");
     let mut i: int = 0;
     while i < count {
-        debug!{"Sending Message"};
+        debug!("Sending Message");
         send(ch, message + 0);
         i = i + 1;
     }
-    debug!{"Ending test00_start"};
+    debug!("Ending test00_start");
 }
 
 fn test00() {
     let number_of_tasks: int = 1;
     let number_of_messages: int = 4;
-    debug!{"Creating tasks"};
+    debug!("Creating tasks");
 
     let po = port();
     let ch = chan(po);
@@ -56,7 +56,7 @@ fn test00() {
 
     for results.each |r| { future::get(&r); }
 
-    debug!{"Completed: Final number is: "};
+    debug!("Completed: Final number is: ");
     assert (sum ==
                 number_of_messages *
                     (number_of_tasks * number_of_tasks + number_of_tasks) /
@@ -65,7 +65,7 @@ fn test00() {
 
 fn test01() {
     let p = port();
-    debug!{"Reading from a port that is never written to."};
+    debug!("Reading from a port that is never written to.");
     let value: int = recv(p);
     log(debug, value);
 }
@@ -73,25 +73,25 @@ fn test01() {
 fn test02() {
     let p = port();
     let c = chan(p);
-    debug!{"Writing to a local task channel."};
+    debug!("Writing to a local task channel.");
     send(c, 42);
-    debug!{"Reading from a local task port."};
+    debug!("Reading from a local task port.");
     let value: int = recv(p);
     log(debug, value);
 }
 
 fn test04_start() {
-    debug!{"Started task"};
+    debug!("Started task");
     let mut i: int = 1024 * 1024;
     while i > 0 { i = i - 1; }
-    debug!{"Finished task"};
+    debug!("Finished task");
 }
 
 fn test04() {
-    debug!{"Spawning lots of tasks."};
+    debug!("Spawning lots of tasks.");
     let mut i: int = 4;
     while i > 0 { i = i - 1; task::spawn(|| test04_start() ); }
-    debug!{"Finishing up."};
+    debug!("Finishing up.");
 }
 
 fn test05_start(ch: Chan<int>) {
@@ -114,15 +114,15 @@ fn test05() {
 }
 
 fn test06_start(&&task_number: int) {
-    debug!{"Started task."};
+    debug!("Started task.");
     let mut i: int = 0;
     while i < 1000000 { i = i + 1; }
-    debug!{"Finished task."};
+    debug!("Finished task.");
 }
 
 fn test06() {
     let number_of_tasks: int = 4;
-    debug!{"Creating tasks"};
+    debug!("Creating tasks");
 
     let mut i: int = 0;
 
index 85f842a49a9618e5ff05152b5689b293c5a7ab8b..221af971e0dab6b5099f6f921b788542a8f93127 100644 (file)
@@ -10,11 +10,11 @@ struct notify {
     let ch: comm::Chan<bool>; let v: @mut bool;
     new(ch: comm::Chan<bool>, v: @mut bool) { self.ch = ch; self.v = v; }
     drop {
-        error!{"notify: task=%? v=%x unwinding=%b b=%b",
+        error!("notify: task=%? v=%x unwinding=%b b=%b",
                task::get_task(),
                ptr::addr_of(*(self.v)) as uint,
                task::failing(),
-               *(self.v)};
+               *(self.v));
         let b = *(self.v);
         comm::send(self.ch, b);
     }
@@ -23,9 +23,9 @@ struct notify {
 fn joinable(+f: fn~()) -> comm::Port<bool> {
     fn wrapper(+c: comm::Chan<bool>, +f: fn()) {
         let b = @mut false;
-        error!{"wrapper: task=%? allocated v=%x",
+        error!("wrapper: task=%? allocated v=%x",
                task::get_task(),
-               ptr::addr_of(*b) as uint};
+               ptr::addr_of(*b) as uint);
         let _r = notify(c, b);
         f();
         *b = true;
@@ -44,13 +44,13 @@ fn supervised() {
     // Yield to make sure the supervisor joins before we
     // fail. This is currently not needed because the supervisor
     // runs first, but I can imagine that changing.
-    error!{"supervised task=%?", task::get_task};
+    error!("supervised task=%?", task::get_task);
     task::yield();
     fail;
 }
 
 fn supervisor() {
-    error!{"supervisor task=%?", task::get_task()};
+    error!("supervisor task=%?", task::get_task());
     let t = joinable(supervised);
     join(t);
 }
index 928eb301281b8829b859d8b1f11c8c57f079cc46..284a4dfffe71bee90a591674a0018576fefce8cd 100644 (file)
@@ -6,7 +6,7 @@
 fn main() {
     let mut i = 10;
     while i > 0 { task::spawn(|copy i| child(i) ); i = i - 1; }
-    debug!{"main thread exiting"};
+    debug!("main thread exiting");
 }
 
 fn child(&&x: int) { log(debug, x); }
index db15409d7bbbbc342ef2e624b0ac0531f7555c09..f736245f0863dcbf6807f038cf67bb1b0776860b 100644 (file)
@@ -27,8 +27,8 @@ fn to_str() -> ~str { int::str(self) }
 impl Tree: to_str {
     fn to_str() -> ~str {
         let l = self.left, r = self.right;
-        fmt!{"[%s, %s, %s]", self.val.to_str(),
-             l.to_str(), r.to_str()}
+        fmt!("[%s, %s, %s]", self.val.to_str(),
+             l.to_str(), r.to_str())
     }
 }
 
index a821940ee761f9dc5946f198a72c0c1842d39684..7a40e11642e04b8b8d8c368112ab3ffd86dae257 100644 (file)
@@ -7,6 +7,6 @@ fn main() unsafe {
     let rc1 = refcount(*i);
     let j = i;
     let rc2 = refcount(*i);
-    error!{"rc1: %u rc2: %u", rc1, rc2};
+    error!("rc1: %u rc2: %u", rc1, rc2);
     assert rc1 + 1u == rc2;
 }
\ No newline at end of file
index a358f0822253bccd2e9c9a1af2d614d48d01b825..bbb39c601b2e05c23252568bbf63ee5bf86c8cd4 100644 (file)
@@ -6,11 +6,11 @@
 struct complainer {
   let c: comm::Chan<bool>;
   new(c: comm::Chan<bool>) {
-    error!{"Hello!"};
+    error!("Hello!");
     self.c = c; }
-  drop { error!{"About to send!"};
+  drop { error!("About to send!");
     comm::send(self.c, true);
-    error!{"Sent!"}; }
+    error!("Sent!"); }
 }
 
 fn f(c: comm::Chan<bool>) {
@@ -22,6 +22,6 @@ fn main() {
     let p = comm::port();
     let c = comm::chan(p);
     task::spawn_unlinked(|| f(c) );
-    error!{"hiiiiiiiii"};
+    error!("hiiiiiiiii");
     assert comm::recv(p);
 }
index cbd16d00a8f2965f63416dd839f928cb369bdd61..7cb39115779489883c866ef1fa0c946e4187f241 100644 (file)
@@ -62,7 +62,7 @@ fn angrydome() {
     loop { i += 1; if i == 1 { match check again { 1 => { } } } break; }
 }
 
-fn evil_lincoln() { let evil <- debug!{"lincoln"}; }
+fn evil_lincoln() { let evil <- debug!("lincoln"); }
 
 fn main() {
     strange();
index 5c57f91f6bf78082b3692e28c3a578c5676f8796..f0cfb7d60586e678340385e87e2f393c35fec64a 100644 (file)
@@ -11,7 +11,7 @@ fn main() {
             let v: ~[int] =
                 ~[1, 2, 3, 4, 5]; // we check that it is freed by break
 
-            debug!{"breaking"};
+            debug!("breaking");
             break;
         }
     }
index 629833464659358a028015a090ac8edd7bb16ea7..5b9d74df29350d777387203f46be522897598340 100644 (file)
@@ -3,9 +3,9 @@
 fn main() {
     let mut x: int = 10;
     let mut y: int = 0;
-    while y < x { log(debug, y); debug!{"hello"}; y = y + 1; }
+    while y < x { log(debug, y); debug!("hello"); y = y + 1; }
     while x > 0 {
-        debug!{"goodbye"};
+        debug!("goodbye");
         x = x - 1;
         log(debug, x);
     }
index eb6a501e70d2f02418f4892f55f47b9cfd441d41..62346788789f803d635e83fcc054af1921e4e390 100644 (file)
@@ -6,14 +6,14 @@
 fn main() {
     let mut result = none;
     task::task().future_result(|+r| { result = some(r); }).spawn(child);
-    error!{"1"};
+    error!("1");
     yield();
-    error!{"2"};
+    error!("2");
     yield();
-    error!{"3"};
+    error!("3");
     future::get(&option::unwrap(result));
 }
 
 fn child() {
-    error!{"4"}; yield(); error!{"5"}; yield(); error!{"6"};
+    error!("4"); yield(); error!("5"); yield(); error!("6");
 }
index be29ca49307e9aa1c6429511a939d0ceb55a15dd..4e8e63e1deaa7378d7b6e5a47fb47660f6ee67dd 100644 (file)
@@ -6,9 +6,9 @@
 fn main() {
     let mut result = none;
     task::task().future_result(|+r| { result = some(r); }).spawn(child);
-    error!{"1"};
+    error!("1");
     yield();
     future::get(&option::unwrap(result));
 }
 
-fn child() { error!{"2"}; }
+fn child() { error!("2"); }