about summary refs log tree commit diff
path: root/src/rustc
diff options
context:
space:
mode:
authorTim Chevalier <catamorphism@gmail.com>2012-10-12 15:26:33 -0700
committerTim Chevalier <catamorphism@gmail.com>2012-10-12 15:26:33 -0700
commitfe058374a94c511daf63b7d773f3b4c95e368a2a (patch)
treed992d648999c3e5ed947fc1db4b35af08fd2f9f8 /src/rustc
parent45d1cd83ab903d377f3b03fd2dc74da42100e308 (diff)
parent1bede1f5e0012069feaf093a6287256af606ff92 (diff)
Merge pull request #3746 from killerswan/nuke_fmt
Replace several common macros of the form #m[...] with m!(...)
Diffstat (limited to 'src/rustc')
-rw-r--r--src/rustc/driver/session.rs2
-rw-r--r--src/rustc/metadata/decoder.rs4
-rw-r--r--src/rustc/middle/borrowck/gather_loans.rs4
-rw-r--r--src/rustc/middle/borrowck/preserve.rs8
-rw-r--r--src/rustc/middle/check_alt.rs2
-rw-r--r--src/rustc/middle/liveness.rs4
-rw-r--r--src/rustc/middle/resolve.rs4
-rw-r--r--src/rustc/middle/trans/glue.rs2
-rw-r--r--src/rustc/middle/trans/monomorphize.rs4
-rw-r--r--src/rustc/middle/ty.rs4
-rw-r--r--src/rustc/middle/typeck/collect.rs4
11 files changed, 21 insertions, 21 deletions
diff --git a/src/rustc/driver/session.rs b/src/rustc/driver/session.rs
index e6d5c404371..550656c23df 100644
--- a/src/rustc/driver/session.rs
+++ b/src/rustc/driver/session.rs
@@ -216,7 +216,7 @@ impl session {
     // This exists to help with refactoring to eliminate impossible
     // cases later on
     fn impossible_case(sp: span, msg: &str) -> ! {
-        self.span_bug(sp, #fmt("Impossible case reached: %s", msg));
+        self.span_bug(sp, fmt!("Impossible case reached: %s", msg));
     }
     fn verbose() -> bool { self.debugging_opt(verbose) }
     fn time_passes() -> bool { self.debugging_opt(time_passes) }
diff --git a/src/rustc/metadata/decoder.rs b/src/rustc/metadata/decoder.rs
index 689141b6bf3..4c647d41880 100644
--- a/src/rustc/metadata/decoder.rs
+++ b/src/rustc/metadata/decoder.rs
@@ -162,7 +162,7 @@ fn item_family(item: ebml::Doc) -> Family {
       'g' => PublicField,
       'j' => PrivateField,
       'N' => InheritedField,
-       c => fail (#fmt("unexpected family char: %c", c))
+       c => fail (fmt!("unexpected family char: %c", c))
     }
 }
 
@@ -705,7 +705,7 @@ fn get_trait_methods(intr: @ident_interner, cdata: cmd, id: ast::node_id,
                            self_ty: self_ty,
                            vis: ast::public});
     }
-    #debug("get_trait_methods: }");
+    debug!("get_trait_methods: }");
     @result
 }
 
diff --git a/src/rustc/middle/borrowck/gather_loans.rs b/src/rustc/middle/borrowck/gather_loans.rs
index f5ac40ce93d..2030984ae70 100644
--- a/src/rustc/middle/borrowck/gather_loans.rs
+++ b/src/rustc/middle/borrowck/gather_loans.rs
@@ -303,8 +303,8 @@ impl gather_loan_ctxt {
                   _ => {
                     self.bccx.tcx.sess.span_bug(
                         cmt.span,
-                        #fmt["loans required but scope is scope_region is %s",
-                             region_to_str(self.tcx(), scope_r)]);
+                        fmt!("loans required but scope is scope_region is %s",
+                             region_to_str(self.tcx(), scope_r)));
                   }
                 }
               }
diff --git a/src/rustc/middle/borrowck/preserve.rs b/src/rustc/middle/borrowck/preserve.rs
index 6bfb0d091a4..7e1d47eed69 100644
--- a/src/rustc/middle/borrowck/preserve.rs
+++ b/src/rustc/middle/borrowck/preserve.rs
@@ -314,17 +314,17 @@ priv impl &preserve_ctxt {
           // we can only root values if the desired region is some concrete
           // scope within the fn body
           ty::re_scope(scope_id) => {
-            #debug["Considering root map entry for %s: \
+            debug!("Considering root map entry for %s: \
                     node %d:%u -> scope_id %?, root_ub %?",
                    self.bccx.cmt_to_repr(cmt), base.id,
-                   derefs, scope_id, self.root_ub];
+                   derefs, scope_id, self.root_ub);
             if self.bccx.is_subregion_of(self.scope_region, root_region) {
-                #debug["Elected to root"];
+                debug!("Elected to root");
                 let rk = {id: base.id, derefs: derefs};
                 self.bccx.root_map.insert(rk, scope_id);
                 return Ok(pc_ok);
             } else {
-                #debug["Unable to root"];
+                debug!("Unable to root");
                 return Err({cmt:cmt,
                          code:err_out_of_root_scope(root_region,
                                                     self.scope_region)});
diff --git a/src/rustc/middle/check_alt.rs b/src/rustc/middle/check_alt.rs
index f71b82a2be7..aab470f6907 100644
--- a/src/rustc/middle/check_alt.rs
+++ b/src/rustc/middle/check_alt.rs
@@ -33,7 +33,7 @@ fn check_expr(tcx: ty::ctxt, ex: @expr, &&s: (), v: visit::vt<()>) {
        if arms.is_empty() {
            if !type_is_empty(tcx, pat_ty) {
                // We know the type is inhabited, so this must be wrong
-               tcx.sess.span_err(ex.span, #fmt("non-exhaustive patterns: \
+               tcx.sess.span_err(ex.span, fmt!("non-exhaustive patterns: \
                              type %s is non-empty", ty_to_str(tcx, pat_ty)));
            }
            // If the type *is* empty, it's vacuously exhaustive
diff --git a/src/rustc/middle/liveness.rs b/src/rustc/middle/liveness.rs
index 3ae0727de60..9ef54eedcf5 100644
--- a/src/rustc/middle/liveness.rs
+++ b/src/rustc/middle/liveness.rs
@@ -902,11 +902,11 @@ impl Liveness {
                 self.propagate_through_fn_block(decl, body)
             });
 
-        // hack to skip the loop unless #debug is enabled:
+        // hack to skip the loop unless debug! is enabled:
         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(LiveNode(ln_idx))];
+                       debug!("%s", self.ln_str(LiveNode(ln_idx)));
                    }
                    body.node.id
                },
diff --git a/src/rustc/middle/resolve.rs b/src/rustc/middle/resolve.rs
index 5f30346a28e..18880fe917b 100644
--- a/src/rustc/middle/resolve.rs
+++ b/src/rustc/middle/resolve.rs
@@ -918,12 +918,12 @@ impl Resolver {
               match ns.find(|n| child.defined_in_namespace(n)) {
                 Some(ns) => {
                   self.session.span_err(sp,
-                       #fmt("Duplicate definition of %s %s",
+                       fmt!("Duplicate definition of %s %s",
                             namespace_to_str(ns),
                             self.session.str_of(name)));
                   do child.span_for_namespace(ns).iter() |sp| {
                       self.session.span_note(*sp,
-                           #fmt("First definition of %s %s here:",
+                           fmt!("First definition of %s %s here:",
                                 namespace_to_str(ns),
                                 self.session.str_of(name)));
                   }
diff --git a/src/rustc/middle/trans/glue.rs b/src/rustc/middle/trans/glue.rs
index d60a5a0bd7d..af9f2899a54 100644
--- a/src/rustc/middle/trans/glue.rs
+++ b/src/rustc/middle/trans/glue.rs
@@ -745,7 +745,7 @@ fn emit_tydescs(ccx: @crate_ctxt) {
         // Index tydesc by addrspace.
         if ti.addrspace > gc_box_addrspace {
             let llty = T_ptr(ccx.tydesc_type);
-            let addrspace_name = #fmt("_gc_addrspace_metadata_%u",
+            let addrspace_name = fmt!("_gc_addrspace_metadata_%u",
                                       ti.addrspace as uint);
             let addrspace_gvar = str::as_c_str(addrspace_name, |buf| {
                 llvm::LLVMAddGlobal(ccx.llmod, llty, buf)
diff --git a/src/rustc/middle/trans/monomorphize.rs b/src/rustc/middle/trans/monomorphize.rs
index 17eaf591c9f..87c073d567d 100644
--- a/src/rustc/middle/trans/monomorphize.rs
+++ b/src/rustc/middle/trans/monomorphize.rs
@@ -37,11 +37,11 @@ fn monomorphic_fn(ccx: @crate_ctxt,
         must_cast = true;
     }
 
-    #debug["monomorphic_fn(fn_id=%? (%s), real_substs=%?, substs=%?, \
+    debug!("monomorphic_fn(fn_id=%? (%s), real_substs=%?, substs=%?, \
            hash_id = %?",
            fn_id, ty::item_path_str(ccx.tcx, fn_id),
            real_substs.map(|s| ty_to_str(ccx.tcx, *s)),
-           substs.map(|s| ty_to_str(ccx.tcx, *s)), hash_id];
+           substs.map(|s| ty_to_str(ccx.tcx, *s)), hash_id);
 
     match ccx.monomorphized.find(hash_id) {
       Some(val) => {
diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs
index a0366cbc0b3..c1195d473aa 100644
--- a/src/rustc/middle/ty.rs
+++ b/src/rustc/middle/ty.rs
@@ -3020,7 +3020,7 @@ fn get_field(tcx: ctxt, rec_ty: t, id: ast::ident) -> field {
     match vec::find(get_fields(rec_ty), |f| f.ident == id) {
       Some(f) => f,
       // Do we only call this when we know the field is legit?
-      None => fail (#fmt("get_field: ty doesn't have a field %s",
+      None => fail (fmt!("get_field: ty doesn't have a field %s",
                          tcx.sess.str_of(id)))
     }
 }
@@ -3335,7 +3335,7 @@ fn provided_trait_methods(cx: ctxt, id: ast::def_id) -> ~[@ast::method] {
                 match ast_util::split_trait_methods(ms) {
                    (_, p) => p
                 },
-            _ => cx.sess.bug(#fmt("provided_trait_methods: %? is not a trait",
+            _ => cx.sess.bug(fmt!("provided_trait_methods: %? is not a trait",
                                   id))
         }
     }
diff --git a/src/rustc/middle/typeck/collect.rs b/src/rustc/middle/typeck/collect.rs
index 18e29981af3..0a2643f6d0f 100644
--- a/src/rustc/middle/typeck/collect.rs
+++ b/src/rustc/middle/typeck/collect.rs
@@ -266,7 +266,7 @@ fn compare_impl_method(tcx: ty::ctxt, sp: span,
     }
 
     if impl_m.tps.len() != trait_m.tps.len() {
-        tcx.sess.span_err(sp, #fmt("method `%s` \
+        tcx.sess.span_err(sp, fmt!("method `%s` \
            has %u type %s, but its trait declaration has %u type %s",
            tcx.sess.str_of(trait_m.ident), impl_m.tps.len(),
            pluralize(impl_m.tps.len(), ~"parameter"),
@@ -291,7 +291,7 @@ fn compare_impl_method(tcx: ty::ctxt, sp: span,
         // Would be nice to use the ty param names in the error message,
         // but we don't have easy access to them here
         if impl_param_bounds.len() != trait_param_bounds.len() {
-           tcx.sess.span_err(sp, #fmt("in method `%s`, \
+           tcx.sess.span_err(sp, fmt!("in method `%s`, \
              type parameter %u has %u %s, but the same type \
              parameter in its trait declaration has %u %s",
              tcx.sess.str_of(trait_m.ident),