]> git.lizzy.rs Git - rust.git/commitdiff
librustc: Remove all uses of {:?}.
authorLuqman Aden <laden@csclub.uwaterloo.ca>
Wed, 15 Oct 2014 06:25:34 +0000 (02:25 -0400)
committerLuqman Aden <laden@csclub.uwaterloo.ca>
Thu, 16 Oct 2014 15:15:34 +0000 (11:15 -0400)
68 files changed:
src/librustc/driver/pretty.rs
src/librustc/metadata/csearch.rs
src/librustc/metadata/encoder.rs
src/librustc/metadata/filesearch.rs
src/librustc/metadata/tydecode.rs
src/librustc/middle/astencode.rs
src/librustc/middle/borrowck/check_loans.rs
src/librustc/middle/borrowck/gather_loans/mod.rs
src/librustc/middle/borrowck/gather_loans/restrictions.rs
src/librustc/middle/borrowck/mod.rs
src/librustc/middle/borrowck/move_data.rs
src/librustc/middle/cfg/construct.rs
src/librustc/middle/check_const.rs
src/librustc/middle/check_match.rs
src/librustc/middle/check_rvalues.rs
src/librustc/middle/dataflow.rs
src/librustc/middle/effect.rs
src/librustc/middle/expr_use_visitor.rs
src/librustc/middle/graph.rs
src/librustc/middle/liveness.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/privacy.rs
src/librustc/middle/region.rs
src/librustc/middle/resolve.rs
src/librustc/middle/resolve_lifetime.rs
src/librustc/middle/save/mod.rs
src/librustc/middle/trans/_match.rs
src/librustc/middle/trans/adt.rs
src/librustc/middle/trans/asm.rs
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/builder.rs
src/librustc/middle/trans/callee.rs
src/librustc/middle/trans/cleanup.rs
src/librustc/middle/trans/closure.rs
src/librustc/middle/trans/common.rs
src/librustc/middle/trans/consts.rs
src/librustc/middle/trans/controlflow.rs
src/librustc/middle/trans/datum.rs
src/librustc/middle/trans/debuginfo.rs
src/librustc/middle/trans/expr.rs
src/librustc/middle/trans/foreign.rs
src/librustc/middle/trans/meth.rs
src/librustc/middle/trans/monomorphize.rs
src/librustc/middle/trans/tvec.rs
src/librustc/middle/trans/type_of.rs
src/librustc/middle/ty.rs
src/librustc/middle/typeck/astconv.rs
src/librustc/middle/typeck/check/_match.rs
src/librustc/middle/typeck/check/method.rs
src/librustc/middle/typeck/check/mod.rs
src/librustc/middle/typeck/check/regionck.rs
src/librustc/middle/typeck/check/writeback.rs
src/librustc/middle/typeck/coherence/mod.rs
src/librustc/middle/typeck/collect.rs
src/librustc/middle/typeck/infer/coercion.rs
src/librustc/middle/typeck/infer/combine.rs
src/librustc/middle/typeck/infer/error_reporting.rs
src/librustc/middle/typeck/infer/glb.rs
src/librustc/middle/typeck/infer/lattice.rs
src/librustc/middle/typeck/infer/lub.rs
src/librustc/middle/typeck/infer/mod.rs
src/librustc/middle/typeck/infer/region_inference/mod.rs
src/librustc/middle/typeck/infer/sub.rs
src/librustc/middle/typeck/infer/test.rs
src/librustc/middle/typeck/mod.rs
src/librustc/middle/typeck/variance.rs
src/librustc/util/common.rs
src/librustc/util/ppaux.rs

index 9b6d6d4620d364b01e318f314fc1ca971aa95955..75171af741110e191a2e0b6fbf6422d877fa684a 100644 (file)
@@ -518,7 +518,7 @@ pub fn pretty_print_input(sess: Session,
                 }
                 None => {
                     let message = format!("--pretty=flowgraph needs \
-                                           block, fn, or method; got {:?}",
+                                           block, fn, or method; got {}",
                                           node);
 
                     // point to what was found, if there's an
@@ -542,7 +542,6 @@ fn print_flowgraph<W:io::Writer>(variants: Vec<borrowck_dot::Variant>,
         blocks::BlockCode(block) => cfg::CFG::new(ty_cx, &*block),
         blocks::FnLikeCode(fn_like) => cfg::CFG::new(ty_cx, &*fn_like.body()),
     };
-    debug!("cfg: {:?}", cfg);
 
     match code {
         _ if variants.len() == 0 => {
index f0ec5beec460721a247e3aa5049e160f22fb1dd2..b7bd97e021965432e8f17b664a325dd25ae950bc 100644 (file)
@@ -226,13 +226,13 @@ pub fn get_field_type(tcx: &ty::ctxt, class_id: ast::DefId,
     let class_doc = expect(tcx.sess.diagnostic(),
                            decoder::maybe_find_item(class_id.node, all_items),
                            || {
-        (format!("get_field_type: class ID {:?} not found",
+        (format!("get_field_type: class ID {} not found",
                  class_id)).to_string()
     });
     let the_field = expect(tcx.sess.diagnostic(),
         decoder::maybe_find_item(def.node, class_doc),
         || {
-            (format!("get_field_type: in class {:?}, field ID {:?} not found",
+            (format!("get_field_type: in class {}, field ID {} not found",
                     class_id,
                     def)).to_string()
         });
index 009a06f5290f5494327c0242183d90267c5e6265..b9135e974c5d7963c98b2456d0c9103d7892631c 100644 (file)
@@ -256,7 +256,7 @@ fn encode_symbol(ecx: &EncodeContext,
     rbml_w.start_tag(tag_items_data_item_symbol);
     match ecx.item_symbols.borrow().find(&id) {
         Some(x) => {
-            debug!("encode_symbol(id={:?}, str={})", id, *x);
+            debug!("encode_symbol(id={}, str={})", id, *x);
             rbml_w.writer.write(x.as_bytes());
         }
         None => {
@@ -308,7 +308,7 @@ fn encode_enum_variant_info(ecx: &EncodeContext,
                             id: NodeId,
                             variants: &[P<Variant>],
                             index: &mut Vec<entry<i64>>) {
-    debug!("encode_enum_variant_info(id={:?})", id);
+    debug!("encode_enum_variant_info(id={})", id);
 
     let mut disr_val = 0;
     let mut i = 0;
@@ -592,7 +592,7 @@ fn encode_info_for_mod(ecx: &EncodeContext,
             ItemImpl(..) => {
                 let (ident, did) = (item.ident, item.id);
                 debug!("(encoding info for module) ... encoding impl {} \
-                        ({:?}/{:?})",
+                        ({}/{})",
                         token::get_ident(ident),
                         did, ecx.tcx.map.node_to_string(did));
 
@@ -853,7 +853,7 @@ fn encode_info_for_method(ecx: &EncodeContext,
                           parent_id: NodeId,
                           ast_item_opt: Option<&ImplItem>) {
 
-    debug!("encode_info_for_method: {:?} {}", m.def_id,
+    debug!("encode_info_for_method: {} {}", m.def_id,
            token::get_ident(m.ident));
     rbml_w.start_tag(tag_items_data_item);
 
index 553ec096521cd403d59a00ef6e8c6b0bb84c66d9..34aa9310ef236e6f2ead31fa0536b121f8ad5d4f 100644 (file)
@@ -39,7 +39,7 @@ pub fn for_each_lib_search_path(&self, f: |&Path| -> FileMatch) {
         let mut visited_dirs = HashSet::new();
         let mut found = false;
 
-        debug!("filesearch: searching additional lib search paths [{:?}]",
+        debug!("filesearch: searching additional lib search paths [{}]",
                self.addl_lib_search_paths.borrow().len());
         for path in self.addl_lib_search_paths.borrow().iter() {
             match f(path) {
@@ -66,7 +66,7 @@ pub fn for_each_lib_search_path(&self, f: |&Path| -> FileMatch) {
             for path in rustpath.iter() {
                 let tlib_path = make_rustpkg_lib_path(
                     self.sysroot, path, self.triple);
-                debug!("is {} in visited_dirs? {:?}", tlib_path.display(),
+                debug!("is {} in visited_dirs? {}", tlib_path.display(),
                         visited_dirs.contains_equiv(&tlib_path.as_vec().to_vec()));
 
                 if !visited_dirs.contains_equiv(&tlib_path.as_vec()) {
index a07518cf3f2d3ae7538540695d02591230eb09be..c8d56c61d2b9ae7310e32d8339f609c5c99e1e85 100644 (file)
@@ -43,6 +43,7 @@
 // def-id will depend on where it originated from.  Therefore, the conversion
 // function is given an indicator of the source of the def-id.  See
 // astencode.rs for more information.
+#[deriving(Show)]
 pub enum DefIdSource {
     // Identifies a struct, trait, enum, etc.
     NominalType,
@@ -390,7 +391,7 @@ fn parse_ty(st: &mut PState, conv: conv_did) -> ty::t {
       }
       'p' => {
         let did = parse_def(st, TypeParameter, |x,y| conv(x,y));
-        debug!("parsed ty_param: did={:?}", did);
+        debug!("parsed ty_param: did={}", did);
         let index = parse_uint(st);
         assert_eq!(next(st), '|');
         let space = parse_param_space(st);
@@ -603,12 +604,12 @@ pub fn parse_def_id(buf: &[u8]) -> ast::DefId {
 
     let crate_num = match uint::parse_bytes(crate_part, 10u) {
        Some(cn) => cn as ast::CrateNum,
-       None => fail!("internal error: parse_def_id: crate number expected, found {:?}",
+       None => fail!("internal error: parse_def_id: crate number expected, found {}",
                      crate_part)
     };
     let def_num = match uint::parse_bytes(def_part, 10u) {
        Some(dn) => dn as ast::NodeId,
-       None => fail!("internal error: parse_def_id: id expected, found {:?}",
+       None => fail!("internal error: parse_def_id: id expected, found {}",
                      def_part)
     };
     ast::DefId { krate: crate_num, node: def_num }
index 7cadcb745ca13aa2d6f4f53cf017859733b3b849..ec693679b1539d0704cb88a931bc305fc278fb6a 100644 (file)
@@ -1807,7 +1807,7 @@ fn convert_def_id(&mut self,
             NominalType | TypeWithId | RegionParameter => dcx.tr_def_id(did),
             TypeParameter => dcx.tr_intern_def_id(did)
         };
-        debug!("convert_def_id(source={:?}, did={:?})={:?}", source, did, r);
+        debug!("convert_def_id(source={}, did={})={}", source, did, r);
         return r;
     }
 }
@@ -1841,7 +1841,7 @@ fn decode_side_tables(dcx: &DecodeContext,
                     }
                     c::tag_table_node_type => {
                         let ty = val_dsr.read_ty(dcx);
-                        debug!("inserting ty for node {:?}: {}",
+                        debug!("inserting ty for node {}: {}",
                                id, ty_to_string(dcx.tcx, ty));
                         dcx.tcx.node_types.borrow_mut().insert(id as uint, ty);
                     }
index df18ec30f0ee3acde38ed5610d4fe2b65b6892fe..4eba46b469c7d921c74b2cda50d3ca7d682ca999 100644 (file)
@@ -119,7 +119,7 @@ fn borrow(&mut self,
               loan_cause: euv::LoanCause)
     {
         debug!("borrow(borrow_id={}, cmt={}, loan_region={}, \
-               bk={}, loan_cause={:?})",
+               bk={}, loan_cause={})",
                borrow_id, cmt.repr(self.tcx()), loan_region,
                bk, loan_cause);
 
@@ -185,7 +185,7 @@ pub fn check_loans<'a, 'b, 'c, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
                                      all_loans: &[Loan],
                                      decl: &ast::FnDecl,
                                      body: &ast::Block) {
-    debug!("check_loans(body id={:?})", body.id);
+    debug!("check_loans(body id={})", body.id);
 
     let mut clcx = CheckLoanCtxt {
         bccx: bccx,
@@ -336,10 +336,10 @@ pub fn check_for_conflicting_loans(&self, scope_id: ast::NodeId) {
         //! issued when we enter `scope_id` (for example, we do not
         //! permit two `&mut` borrows of the same variable).
 
-        debug!("check_for_conflicting_loans(scope_id={:?})", scope_id);
+        debug!("check_for_conflicting_loans(scope_id={})", scope_id);
 
         let new_loan_indices = self.loans_generated_by(scope_id);
-        debug!("new_loan_indices = {:?}", new_loan_indices);
+        debug!("new_loan_indices = {}", new_loan_indices);
 
         self.each_issued_loan(scope_id, |issued_loan| {
             for &new_loan_index in new_loan_indices.iter() {
@@ -651,7 +651,7 @@ pub fn analyze_restrictions_on_use(&self,
                                        use_path: &LoanPath,
                                        borrow_kind: ty::BorrowKind)
                                        -> UseError {
-        debug!("analyze_restrictions_on_use(expr_id={:?}, use_path={})",
+        debug!("analyze_restrictions_on_use(expr_id={}, use_path={})",
                self.tcx().map.node_to_string(expr_id),
                use_path.repr(self.tcx()));
 
@@ -679,7 +679,7 @@ fn check_if_path_is_moved(&self,
          * is using a moved/uninitialized value
          */
 
-        debug!("check_if_path_is_moved(id={:?}, use_kind={:?}, lp={})",
+        debug!("check_if_path_is_moved(id={}, use_kind={}, lp={})",
                id, use_kind, lp.repr(self.bccx.tcx));
         let base_lp = owned_ptr_base_path_rc(lp);
         self.move_data.each_move_of(id, &base_lp, |the_move, moved_lp| {
index f2ff104ba1d104bb623c4af915fb1faf0b3c2556..d28baf48ddcdf5825043068a26a56dad2e0be9a8 100644 (file)
@@ -112,7 +112,7 @@ fn borrow(&mut self,
               loan_cause: euv::LoanCause)
     {
         debug!("borrow(borrow_id={}, cmt={}, loan_region={}, \
-               bk={}, loan_cause={:?})",
+               bk={}, loan_cause={})",
                borrow_id, cmt.repr(self.tcx()), loan_region,
                bk, loan_cause);
 
@@ -218,8 +218,8 @@ fn guarantee_valid(&mut self,
          * dynamically that they are not freed.
          */
 
-        debug!("guarantee_valid(borrow_id={:?}, cmt={}, \
-                req_mutbl={:?}, loan_region={:?})",
+        debug!("guarantee_valid(borrow_id={}, cmt={}, \
+                req_mutbl={}, loan_region={})",
                borrow_id,
                cmt.repr(self.tcx()),
                req_kind,
@@ -257,7 +257,7 @@ fn guarantee_valid(&mut self,
             self.bccx, borrow_span, cause,
             cmt.clone(), loan_region);
 
-        debug!("guarantee_valid(): restrictions={:?}", restr);
+        debug!("guarantee_valid(): restrictions={}", restr);
 
         // Create the loan record (if needed).
         let loan = match restr {
@@ -289,17 +289,17 @@ fn guarantee_valid(&mut self,
                     ty::ReInfer(..) => {
                         self.tcx().sess.span_bug(
                             cmt.span,
-                            format!("invalid borrow lifetime: {:?}",
+                            format!("invalid borrow lifetime: {}",
                                     loan_region).as_slice());
                     }
                 };
-                debug!("loan_scope = {:?}", loan_scope);
+                debug!("loan_scope = {}", loan_scope);
 
                 let gen_scope = self.compute_gen_scope(borrow_id, loan_scope);
-                debug!("gen_scope = {:?}", gen_scope);
+                debug!("gen_scope = {}", gen_scope);
 
                 let kill_scope = self.compute_kill_scope(loan_scope, &*loan_path);
-                debug!("kill_scope = {:?}", kill_scope);
+                debug!("kill_scope = {}", kill_scope);
 
                 if req_kind == ty::MutBorrow {
                     self.mark_loan_path_as_mutated(&*loan_path);
@@ -318,7 +318,7 @@ fn guarantee_valid(&mut self,
             }
         };
 
-        debug!("guarantee_valid(borrow_id={:?}), loan={}",
+        debug!("guarantee_valid(borrow_id={}), loan={}",
                borrow_id, loan.repr(self.tcx()));
 
         // let loan_path = loan.loan_path;
index f30a370d068526cf5831e9792a8e439321159bf0..bf1b4b7e476ecea82537a2b1d4c0a855052fa2e7 100644 (file)
@@ -21,6 +21,7 @@
 
 use std::rc::Rc;
 
+#[deriving(Show)]
 pub enum RestrictionResult {
     Safe,
     SafeIf(Rc<LoanPath>, Vec<Rc<LoanPath>>)
index 7d0d99443b0d85d5a12801f0705fe637d8bb0ade..ec09e9e72d7ba24be834dce797a7fe0d013c7886 100644 (file)
@@ -264,14 +264,14 @@ pub fn loan_path(&self) -> Rc<LoanPath> {
     }
 }
 
-#[deriving(PartialEq, Eq, Hash)]
+#[deriving(PartialEq, Eq, Hash, Show)]
 pub enum LoanPath {
     LpVar(ast::NodeId),               // `x` in doc.rs
     LpUpvar(ty::UpvarId),             // `x` captured by-value into closure
     LpExtend(Rc<LoanPath>, mc::MutabilityCategory, LoanPathElem)
 }
 
-#[deriving(PartialEq, Eq, Hash)]
+#[deriving(PartialEq, Eq, Hash, Show)]
 pub enum LoanPathElem {
     LpDeref(mc::PointerKind),    // `*LV` in doc.rs
     LpInterior(mc::InteriorKind) // `LV.f` in doc.rs
@@ -421,6 +421,7 @@ pub enum AliasableViolationKind {
     BorrowViolation(euv::LoanCause)
 }
 
+#[deriving(Show)]
 pub enum MovedValueUseKind {
     MovedInUse,
     MovedInCapture,
@@ -530,8 +531,8 @@ pub fn report_use_of_moved_value(&self,
                         (ty::expr_ty_adjusted(self.tcx, &*expr), expr.span)
                     }
                     r => {
-                        self.tcx.sess.bug(format!("MoveExpr({:?}) maps to \
-                                                   {:?}, not Expr",
+                        self.tcx.sess.bug(format!("MoveExpr({}) maps to \
+                                                   {}, not Expr",
                                                   the_move.id,
                                                   r).as_slice())
                     }
@@ -566,8 +567,8 @@ pub fn report_use_of_moved_value(&self,
                         (ty::expr_ty_adjusted(self.tcx, &*expr), expr.span)
                     }
                     r => {
-                        self.tcx.sess.bug(format!("Captured({:?}) maps to \
-                                                   {:?}, not Expr",
+                        self.tcx.sess.bug(format!("Captured({}) maps to \
+                                                   {}, not Expr",
                                                   the_move.id,
                                                   r).as_slice())
                     }
@@ -892,7 +893,7 @@ fn initial_value(&self) -> bool {
 
 impl Repr for Loan {
     fn repr(&self, tcx: &ty::ctxt) -> String {
-        format!("Loan_{:?}({}, {:?}, {:?}-{:?}, {})",
+        format!("Loan_{}({}, {}, {}-{}, {})",
                  self.index,
                  self.loan_path.repr(tcx),
                  self.kind,
index eda145419616ba72416e43bac6d0ae0ccaabe754..4c2ee9fe551c4fbd14ba2053da6505d83a78719d 100644 (file)
@@ -68,7 +68,7 @@ pub struct FlowedMoveData<'a, 'tcx: 'a> {
 }
 
 /// Index into `MoveData.paths`, used like a pointer
-#[deriving(PartialEq)]
+#[deriving(PartialEq, Show)]
 pub struct MovePathIndex(uint);
 
 impl MovePathIndex {
@@ -120,7 +120,7 @@ pub struct MovePath {
     pub next_sibling: MovePathIndex,
 }
 
-#[deriving(PartialEq)]
+#[deriving(PartialEq, Show)]
 pub enum MoveKind {
     Declared,   // When declared, variables start out "moved".
     MoveExpr,   // Expression or binding that moves a variable
@@ -284,7 +284,7 @@ pub fn move_path(&self,
             }
         };
 
-        debug!("move_path(lp={}, index={:?})",
+        debug!("move_path(lp={}, index={})",
                lp.repr(tcx),
                index);
 
@@ -341,7 +341,7 @@ pub fn add_move(&self,
          * location `id` with kind `kind`.
          */
 
-        debug!("add_move(lp={}, id={:?}, kind={:?})",
+        debug!("add_move(lp={}, id={}, kind={})",
                lp.repr(tcx),
                id,
                kind);
@@ -372,7 +372,7 @@ pub fn add_assignment(&self,
          * location `id` with the given `span`.
          */
 
-        debug!("add_assignment(lp={}, assign_id={:?}, assignee_id={:?}",
+        debug!("add_assignment(lp={}, assign_id={}, assignee_id={}",
                lp.repr(tcx), assign_id, assignee_id);
 
         let path_index = self.move_path(tcx, lp.clone());
@@ -391,12 +391,12 @@ pub fn add_assignment(&self,
         };
 
         if self.is_var_path(path_index) {
-            debug!("add_assignment[var](lp={}, assignment={}, path_index={:?})",
+            debug!("add_assignment[var](lp={}, assignment={}, path_index={})",
                    lp.repr(tcx), self.var_assignments.borrow().len(), path_index);
 
             self.var_assignments.borrow_mut().push(assignment);
         } else {
-            debug!("add_assignment[path](lp={}, path_index={:?})",
+            debug!("add_assignment[path](lp={}, path_index={})",
                    lp.repr(tcx), path_index);
 
             self.path_assignments.borrow_mut().push(assignment);
index b573c4e59487a83d35f0ad6af46cbb679a5ad329..fa5a6a2e54aad80c022bd1a9eeb3fc5c0b13cba1 100644 (file)
@@ -483,12 +483,12 @@ fn expr(&mut self, expr: &ast::Expr, pred: CFGIndex) -> CFGIndex {
                 let inputs = inline_asm.inputs.iter();
                 let outputs = inline_asm.outputs.iter();
                 let post_inputs = self.exprs(inputs.map(|a| {
-                    debug!("cfg::construct InlineAsm id:{} input:{:?}", expr.id, a);
+                    debug!("cfg::construct InlineAsm id:{} input:{}", expr.id, a);
                     let &(_, ref expr) = a;
                     &**expr
                 }), pred);
                 let post_outputs = self.exprs(outputs.map(|a| {
-                    debug!("cfg::construct InlineAsm id:{} output:{:?}", expr.id, a);
+                    debug!("cfg::construct InlineAsm id:{} output:{}", expr.id, a);
                     let &(_, ref expr, _) = a;
                     &**expr
                 }), post_inputs);
@@ -616,14 +616,14 @@ fn find_scope(&self,
                         }
                         self.tcx.sess.span_bug(
                             expr.span,
-                            format!("no loop scope for id {:?}",
+                            format!("no loop scope for id {}",
                                     loop_id).as_slice());
                     }
 
                     r => {
                         self.tcx.sess.span_bug(
                             expr.span,
-                            format!("bad entry `{:?}` in def_map for label",
+                            format!("bad entry `{}` in def_map for label",
                                     r).as_slice());
                     }
                 }
index f0455db6e3bb693cdade8cf92ff6a549582291ad..d6b9bbded4ff89e7050b85770ee1e1ad56302523 100644 (file)
@@ -145,7 +145,7 @@ fn check_expr(v: &mut CheckCrateVisitor, e: &Expr) -> bool {
                 Some(&DefStruct(_)) => { }
 
                 Some(&def) => {
-                    debug!("(checking const) found bad def: {:?}", def);
+                    debug!("(checking const) found bad def: {}", def);
                     span_err!(v.tcx.sess, e.span, E0014,
                               "paths in constants may only refer to constants \
                                or functions");
index 3f725b86420cd21160d52fab31f8bb9120f31390..abccc7623a75925fcb1acbe2fe19fcef148cffec 100644 (file)
@@ -987,7 +987,7 @@ fn check_legality_of_move_bindings(cx: &MatchCheckCtxt,
                         cx.tcx.sess.span_bug(
                             p.span,
                             format!("binding pattern {} is not an \
-                                     identifier: {:?}",
+                                     identifier: {}",
                                     p.id,
                                     p.node).as_slice());
                     }
index 2a2655cc49c668eac36a015c8bae267edca380b9..cd7c4b15494a997ed05470e87e274278ba05359c 100644 (file)
@@ -51,7 +51,7 @@ fn consume(&mut self,
                span: Span,
                cmt: mc::cmt,
                _: euv::ConsumeMode) {
-        debug!("consume; cmt: {:?}; type: {}", *cmt, ty_to_string(self.tcx, cmt.ty));
+        debug!("consume; cmt: {}; type: {}", *cmt, ty_to_string(self.tcx, cmt.ty));
         if !ty::type_is_sized(self.tcx, cmt.ty) {
             span_err!(self.tcx.sess, span, E0161,
                 "cannot move a value of type {0}: the size of {0} cannot be statically determined",
index cc1789ec642e27bc1346316481dc4b3b45cad856..a8b8eb2e3394dbe64b67f46733971051dcb890b7 100644 (file)
@@ -193,8 +193,8 @@ pub fn new(tcx: &'a ty::ctxt<'tcx>,
         let words_per_id = (bits_per_id + uint::BITS - 1) / uint::BITS;
         let num_nodes = cfg.graph.all_nodes().len();
 
-        debug!("DataFlowContext::new(analysis_name: {:s}, id_range={:?}, \
-                                     bits_per_id={:?}, words_per_id={:?}) \
+        debug!("DataFlowContext::new(analysis_name: {:s}, id_range={}, \
+                                     bits_per_id={}, words_per_id={}) \
                                      num_nodes: {}",
                analysis_name, id_range, bits_per_id, words_per_id,
                num_nodes);
@@ -222,7 +222,7 @@ pub fn new(tcx: &'a ty::ctxt<'tcx>,
 
     pub fn add_gen(&mut self, id: ast::NodeId, bit: uint) {
         //! Indicates that `id` generates `bit`
-        debug!("{:s} add_gen(id={:?}, bit={:?})",
+        debug!("{:s} add_gen(id={}, bit={})",
                self.analysis_name, id, bit);
         assert!(self.nodeid_to_index.contains_key(&id));
         assert!(self.bits_per_id > 0);
@@ -235,7 +235,7 @@ pub fn add_gen(&mut self, id: ast::NodeId, bit: uint) {
 
     pub fn add_kill(&mut self, id: ast::NodeId, bit: uint) {
         //! Indicates that `id` kills `bit`
-        debug!("{:s} add_kill(id={:?}, bit={:?})",
+        debug!("{:s} add_kill(id={}, bit={})",
                self.analysis_name, id, bit);
         assert!(self.nodeid_to_index.contains_key(&id));
         assert!(self.bits_per_id > 0);
@@ -336,7 +336,7 @@ pub fn each_gen_bit(&self, id: ast::NodeId, f: |uint| -> bool)
         let cfgidx = to_cfgidx_or_die(id, &self.nodeid_to_index);
         let (start, end) = self.compute_id_range(cfgidx);
         let gens = self.gens.slice(start, end);
-        debug!("{:s} each_gen_bit(id={:?}, gens={})",
+        debug!("{:s} each_gen_bit(id={}, gens={})",
                self.analysis_name, id, bits_to_string(gens));
         self.each_bit(gens, f)
     }
@@ -408,7 +408,7 @@ pub fn add_kills_from_flow_exits(&mut self, cfg: &cfg::CFG) {
                     }
                     None => {
                         debug!("{:s} add_kills_from_flow_exits flow_exit={} \
-                                no cfg_idx for exiting_scope={:?}",
+                                no cfg_idx for exiting_scope={}",
                                self.analysis_name, flow_exit, node_id);
                     }
                 }
@@ -529,7 +529,7 @@ fn propagate_bits_into_entry_set_for(&mut self,
             bitwise(on_entry, pred_bits, &self.dfcx.oper)
         };
         if changed {
-            debug!("{:s} changed entry set for {:?} to {}",
+            debug!("{:s} changed entry set for {} to {}",
                    self.dfcx.analysis_name, cfgidx,
                    bits_to_string(self.dfcx.on_entry.slice(start, end)));
             self.changed = true;
index b492203b3521e99e13718763f88b85ca5212b138..bde868cdf6d07ea2022bffc04618b05e506022da 100644 (file)
@@ -55,7 +55,7 @@ fn require_unsafe(&mut self, span: Span, description: &str) {
             }
             UnsafeBlock(block_id) => {
                 // OK, but record this.
-                debug!("effect: recording unsafe block as used: {:?}", block_id);
+                debug!("effect: recording unsafe block as used: {}", block_id);
                 self.tcx.used_unsafe.borrow_mut().insert(block_id);
             }
             UnsafeFn => {}
index 6f179e0624fe21df3d5a56d597b43cf7c1ec2912..65633cfb34cd7f0d31ddc2b996e9616607448a36 100644 (file)
@@ -73,7 +73,7 @@ fn mutate(&mut self,
               mode: MutateMode);
 }
 
-#[deriving(PartialEq)]
+#[deriving(PartialEq, Show)]
 pub enum LoanCause {
     ClosureCapture(Span),
     AddrOf,
@@ -85,7 +85,7 @@ pub enum LoanCause {
     MatchDiscriminant
 }
 
-#[deriving(PartialEq,Show)]
+#[deriving(PartialEq, Show)]
 pub enum ConsumeMode {
     Copy,                // reference to x where x has a type that copies
     Move(MoveReason),    // reference to x where x has a type that moves
@@ -625,7 +625,7 @@ fn walk_block(&mut self, blk: &ast::Block) {
          * meaning either copied or moved depending on its type.
          */
 
-        debug!("walk_block(blk.id={:?})", blk.id);
+        debug!("walk_block(blk.id={})", blk.id);
 
         for stmt in blk.stmts.iter() {
             self.walk_stmt(&**stmt);
index 8484ec9293496da690040f446eeb3310df75a027..463eaa40ae03e30f8f1ac1fd31ad58f8421873d2 100644 (file)
@@ -36,6 +36,7 @@
 
 #![allow(dead_code)] // still WIP
 
+use std::fmt::{Formatter, FormatError, Show};
 use std::uint;
 
 pub struct Graph<N,E> {
@@ -55,12 +56,20 @@ pub struct Edge<E> {
     pub data: E,
 }
 
+impl<E: Show> Show for Edge<E> {
+    fn fmt(&self, f: &mut Formatter) -> Result<(), FormatError> {
+        write!(f, "Edge {{ next_edge: [{}, {}], source: {}, target: {}, data: {} }}",
+               self.next_edge[0], self.next_edge[1], self.source,
+               self.target, self.data)
+    }
+}
+
 #[deriving(Clone, PartialEq, Show)]
 pub struct NodeIndex(pub uint);
 #[allow(non_uppercase_statics)]
 pub const InvalidNodeIndex: NodeIndex = NodeIndex(uint::MAX);
 
-#[deriving(PartialEq)]
+#[deriving(PartialEq, Show)]
 pub struct EdgeIndex(pub uint);
 #[allow(non_uppercase_statics)]
 pub const InvalidEdgeIndex: EdgeIndex = EdgeIndex(uint::MAX);
@@ -307,6 +316,7 @@ pub fn target(&self) -> NodeIndex {
 #[cfg(test)]
 mod test {
     use middle::graph::*;
+    use std::fmt::Show;
 
     type TestNode = Node<&'static str>;
     type TestEdge = Edge<&'static str>;
@@ -361,7 +371,7 @@ fn each_edge() {
         });
     }
 
-    fn test_adjacent_edges<N:PartialEq,E:PartialEq>(graph: &Graph<N,E>,
+    fn test_adjacent_edges<N:PartialEq+Show,E:PartialEq+Show>(graph: &Graph<N,E>,
                                       start_index: NodeIndex,
                                       start_data: N,
                                       expected_incoming: &[(E,N)],
@@ -372,7 +382,7 @@ fn test_adjacent_edges<N:PartialEq,E:PartialEq>(graph: &Graph<N,E>,
         graph.each_incoming_edge(start_index, |edge_index, edge| {
             assert!(graph.edge_data(edge_index) == &edge.data);
             assert!(counter < expected_incoming.len());
-            debug!("counter={:?} expected={:?} edge_index={:?} edge={:?}",
+            debug!("counter={} expected={} edge_index={} edge={}",
                    counter, expected_incoming[counter], edge_index, edge);
             match expected_incoming[counter] {
                 (ref e, ref n) => {
@@ -390,7 +400,7 @@ fn test_adjacent_edges<N:PartialEq,E:PartialEq>(graph: &Graph<N,E>,
         graph.each_outgoing_edge(start_index, |edge_index, edge| {
             assert!(graph.edge_data(edge_index) == &edge.data);
             assert!(counter < expected_outgoing.len());
-            debug!("counter={:?} expected={:?} edge_index={:?} edge={:?}",
+            debug!("counter={} expected={} edge_index={} edge={}",
                    counter, expected_outgoing[counter], edge_index, edge);
             match expected_outgoing[counter] {
                 (ref e, ref n) => {
index ac9df3597705078fe35852f85236cbfcaa3573d6..490e49d051ee58addee73a8e4b87546a665bafff 100644 (file)
@@ -154,7 +154,7 @@ fn clone(&self) -> LiveNode {
     }
 }
 
-#[deriving(PartialEq)]
+#[deriving(PartialEq, Show)]
 enum LiveNodeKind {
     FreeVarNode(Span),
     ExprNode(Span),
@@ -240,11 +240,13 @@ struct CaptureInfo {
     var_nid: NodeId
 }
 
+#[deriving(Show)]
 struct LocalInfo {
     id: NodeId,
     ident: Ident
 }
 
+#[deriving(Show)]
 enum VarKind {
     Arg(NodeId, Ident),
     Local(LocalInfo),
@@ -307,7 +309,7 @@ fn add_variable(&mut self, vk: VarKind) -> Variable {
             ImplicitRet => {}
         }
 
-        debug!("{} is {:?}", v.to_string(), vk);
+        debug!("{} is {}", v.to_string(), vk);
 
         v
     }
@@ -424,7 +426,7 @@ fn visit_local(ir: &mut IrMaps, local: &ast::Local) {
 fn visit_arm(ir: &mut IrMaps, arm: &Arm) {
     for pat in arm.pats.iter() {
         pat_util::pat_bindings(&ir.tcx.def_map, &**pat, |bm, p_id, sp, path1| {
-            debug!("adding local variable {} from match with bm {:?}",
+            debug!("adding local variable {} from match with bm {}",
                    p_id, bm);
             let name = path1.node;
             ir.add_live_node_for_node(p_id, VarDefNode(sp));
@@ -442,7 +444,7 @@ fn visit_expr(ir: &mut IrMaps, expr: &Expr) {
       // live nodes required for uses or definitions of variables:
       ExprPath(_) => {
         let def = ir.tcx.def_map.borrow().get_copy(&expr.id);
-        debug!("expr {}: path that leads to {:?}", expr.id, def);
+        debug!("expr {}: path that leads to {}", expr.id, def);
         match def {
             DefLocal(..) => ir.add_live_node_for_node(expr.id, ExprNode(expr.span)),
             _ => {}
@@ -489,7 +491,7 @@ fn visit_expr(ir: &mut IrMaps, expr: &Expr) {
       }
       ExprForLoop(ref pat, _, _, _) => {
         pat_util::pat_bindings(&ir.tcx.def_map, &**pat, |bm, p_id, sp, path1| {
-            debug!("adding local variable {} from for loop with bm {:?}",
+            debug!("adding local variable {} from for loop with bm {}",
                    p_id, bm);
             let name = path1.node;
             ir.add_live_node_for_node(p_id, VarDefNode(sp));
@@ -733,7 +735,7 @@ fn ln_str(&self, ln: LiveNode) -> String {
         let mut wr = io::MemWriter::new();
         {
             let wr = &mut wr as &mut io::Writer;
-            write!(wr, "[ln({}) of kind {:?} reads", ln.get(), self.ir.lnk(ln));
+            write!(wr, "[ln({}) of kind {} reads", ln.get(), self.ir.lnk(ln));
             self.write_vars(wr, ln, |idx| self.users.get(idx).reader);
             write!(wr, "  writes");
             self.write_vars(wr, ln, |idx| self.users.get(idx).writer);
index 4a1c4aaa89514d826ebbb24e88fd4457ddfde177..c5993dcb39de876696052578e560c7b2727397fa 100644 (file)
@@ -78,7 +78,7 @@
 use std::cell::RefCell;
 use std::rc::Rc;
 
-#[deriving(Clone, PartialEq)]
+#[deriving(Clone, PartialEq, Show)]
 pub enum categorization {
     cat_rvalue(ty::Region),            // temporary val, argument is its scope
     cat_static_item,
@@ -94,7 +94,7 @@ pub enum categorization {
     // (*1) downcast is only required if the enum has more than one variant
 }
 
-#[deriving(Clone, PartialEq)]
+#[deriving(Clone, PartialEq, Show)]
 pub enum CopiedUpvarKind {
     Boxed(ast::Onceness),
     Unboxed(ty::UnboxedClosureKind)
@@ -111,7 +111,7 @@ pub fn onceness(&self) -> ast::Onceness {
     }
 }
 
-#[deriving(Clone, PartialEq)]
+#[deriving(Clone, PartialEq, Show)]
 pub struct CopiedUpvar {
     pub upvar_id: ast::NodeId,
     pub kind: CopiedUpvarKind,
@@ -119,7 +119,7 @@ pub struct CopiedUpvar {
 }
 
 // different kinds of pointers:
-#[deriving(Clone, PartialEq, Eq, Hash)]
+#[deriving(Clone, PartialEq, Eq, Hash, Show)]
 pub enum PointerKind {
     OwnedPtr,
     BorrowedPtr(ty::BorrowKind, ty::Region),
@@ -129,19 +129,19 @@ pub enum PointerKind {
 
 // We use the term "interior" to mean "something reachable from the
 // base without a pointer dereference", e.g. a field
-#[deriving(Clone, PartialEq, Eq, Hash)]
+#[deriving(Clone, PartialEq, Eq, Hash, Show)]
 pub enum InteriorKind {
     InteriorField(FieldName),
     InteriorElement(ElementKind),
 }
 
-#[deriving(Clone, PartialEq, Eq, Hash)]
+#[deriving(Clone, PartialEq, Eq, Hash, Show)]
 pub enum FieldName {
     NamedField(ast::Name),
     PositionalField(uint)
 }
 
-#[deriving(Clone, PartialEq, Eq, Hash)]
+#[deriving(Clone, PartialEq, Eq, Hash, Show)]
 pub enum ElementKind {
     VecElement,
     OtherElement,
@@ -168,7 +168,7 @@ pub enum MutabilityCategory {
 // dereference, but its type is the type *before* the dereference
 // (`@T`). So use `cmt.ty` to find the type of the value in a consistent
 // fashion. For more details, see the method `cat_pattern`
-#[deriving(Clone, PartialEq)]
+#[deriving(Clone, PartialEq, Show)]
 pub struct cmt_ {
     pub id: ast::NodeId,          // id of expr/pat producing this value
     pub span: Span,                // span of same expr/pat
@@ -542,7 +542,7 @@ pub fn cat_def(&self,
                    expr_ty: ty::t,
                    def: def::Def)
                    -> McResult<cmt> {
-        debug!("cat_def: id={} expr={} def={:?}",
+        debug!("cat_def: id={} expr={} def={}",
                id, expr_ty.repr(self.tcx()), def);
 
         match def {
@@ -781,7 +781,7 @@ fn cat_deref<N:ast_node>(&self,
         };
         let method_ty = self.typer.node_method_ty(method_call);
 
-        debug!("cat_deref: method_call={:?} method_ty={}",
+        debug!("cat_deref: method_call={} method_ty={}",
             method_call, method_ty.map(|ty| ty.repr(self.tcx())));
 
         let base_cmt = match method_ty {
@@ -1352,7 +1352,7 @@ pub fn freely_aliasable(&self, ctxt: &ty::ctxt) -> Option<AliasableReason> {
 
 impl Repr for cmt_ {
     fn repr(&self, tcx: &ty::ctxt) -> String {
-        format!("{{{} id:{} m:{:?} ty:{}}}",
+        format!("{{{} id:{} m:{} ty:{}}}",
                 self.cat.repr(tcx),
                 self.id,
                 self.mutbl,
@@ -1368,7 +1368,7 @@ fn repr(&self, tcx: &ty::ctxt) -> String {
             cat_copied_upvar(..) |
             cat_local(..) |
             cat_upvar(..) => {
-                format!("{:?}", *self)
+                format!("{}", *self)
             }
             cat_deref(ref cmt, derefs, ptr) => {
                 format!("{}-{}{}->", cmt.cat.repr(tcx), ptr_sigil(ptr), derefs)
@@ -1405,7 +1405,7 @@ fn repr(&self, _tcx: &ty::ctxt) -> String {
             InteriorField(NamedField(fld)) => {
                 token::get_name(fld).get().to_string()
             }
-            InteriorField(PositionalField(i)) => format!("#{:?}", i),
+            InteriorField(PositionalField(i)) => format!("#{}", i),
             InteriorElement(_) => "[]".to_string(),
         }
     }
index 8b9207134ea2671b4d2a380ac4992273f80717d7..6e430760e368ff347a04d2f10950403d1c026e21 100644 (file)
@@ -347,7 +347,7 @@ fn visit_mod(&mut self, m: &ast::Mod, _sp: Span, id: ast::NodeId) {
         // This code is here instead of in visit_item so that the
         // crate module gets processed as well.
         if self.prev_exported {
-            assert!(self.exp_map2.contains_key(&id), "wut {:?}", id);
+            assert!(self.exp_map2.contains_key(&id), "wut {}", id);
             for export in self.exp_map2.get(&id).iter() {
                 if is_local(export.def_id) {
                     self.reexports.insert(export.def_id.node);
@@ -394,28 +394,28 @@ fn nodestr(&self, id: ast::NodeId) -> String {
     fn def_privacy(&self, did: ast::DefId) -> PrivacyResult {
         if !is_local(did) {
             if self.external_exports.contains(&did) {
-                debug!("privacy - {:?} was externally exported", did);
+                debug!("privacy - {} was externally exported", did);
                 return Allowable;
             }
-            debug!("privacy - is {:?} a public method", did);
+            debug!("privacy - is {} a public method", did);
 
             return match self.tcx.impl_or_trait_items.borrow().find(&did) {
                 Some(&ty::MethodTraitItem(ref meth)) => {
-                    debug!("privacy - well at least it's a method: {:?}",
+                    debug!("privacy - well at least it's a method: {}",
                            *meth);
                     match meth.container {
                         ty::TraitContainer(id) => {
-                            debug!("privacy - recursing on trait {:?}", id);
+                            debug!("privacy - recursing on trait {}", id);
                             self.def_privacy(id)
                         }
                         ty::ImplContainer(id) => {
                             match ty::impl_trait_ref(self.tcx, id) {
                                 Some(t) => {
-                                    debug!("privacy - impl of trait {:?}", id);
+                                    debug!("privacy - impl of trait {}", id);
                                     self.def_privacy(t.def_id)
                                 }
                                 None => {
-                                    debug!("privacy - found a method {:?}",
+                                    debug!("privacy - found a method {}",
                                             meth.vis);
                                     if meth.vis == ast::Public {
                                         Allowable
@@ -430,17 +430,17 @@ fn def_privacy(&self, did: ast::DefId) -> PrivacyResult {
                 Some(&ty::TypeTraitItem(ref typedef)) => {
                     match typedef.container {
                         ty::TraitContainer(id) => {
-                            debug!("privacy - recursing on trait {:?}", id);
+                            debug!("privacy - recursing on trait {}", id);
                             self.def_privacy(id)
                         }
                         ty::ImplContainer(id) => {
                             match ty::impl_trait_ref(self.tcx, id) {
                                 Some(t) => {
-                                    debug!("privacy - impl of trait {:?}", id);
+                                    debug!("privacy - impl of trait {}", id);
                                     self.def_privacy(t.def_id)
                                 }
                                 None => {
-                                    debug!("privacy - found a typedef {:?}",
+                                    debug!("privacy - found a typedef {}",
                                             typedef.vis);
                                     if typedef.vis == ast::Public {
                                         Allowable
@@ -551,7 +551,7 @@ fn private_accessible(&self, id: ast::NodeId) -> bool {
         // members, so that's why we test the parent, and not the did itself.
         let mut cur = self.curitem;
         loop {
-            debug!("privacy - questioning {}, {:?}", self.nodestr(cur), cur);
+            debug!("privacy - questioning {}, {}", self.nodestr(cur), cur);
             match cur {
                 // If the relevant parent is in our history, then we're allowed
                 // to look inside any of our ancestor's immediate private items,
index 4f81aac5eb049e6f1289231bc0d8a5b0951ded69..cf48e1899d18ef8cc369310616d74c66e1346da1 100644 (file)
@@ -113,7 +113,7 @@ pub fn relate_free_regions(&self, sub: FreeRegion, sup: FreeRegion) {
             None => {}
         }
 
-        debug!("relate_free_regions(sub={:?}, sup={:?})", sub, sup);
+        debug!("relate_free_regions(sub={}, sup={})", sub, sup);
         self.free_region_map.borrow_mut().insert(sub, vec!(sup));
     }
 
@@ -211,7 +211,7 @@ pub fn var_region(&self, id: ast::NodeId) -> ty::Region {
         //! Returns the lifetime of the variable `id`.
 
         let scope = ty::ReScope(self.var_scope(id));
-        debug!("var_region({}) = {:?}", id, scope);
+        debug!("var_region({}) = {}", id, scope);
         scope
     }
 
@@ -270,7 +270,7 @@ pub fn is_subregion_of(&self,
          * duplicated with the code in infer.rs.
          */
 
-        debug!("is_subregion_of(sub_region={:?}, super_region={:?})",
+        debug!("is_subregion_of(sub_region={}, super_region={})",
                sub_region, super_region);
 
         sub_region == super_region || {
@@ -802,7 +802,7 @@ fn resolve_fn(visitor: &mut RegionResolutionVisitor,
               sp: Span,
               id: ast::NodeId) {
     debug!("region::resolve_fn(id={}, \
-                               span={:?}, \
+                               span={}, \
                                body.id={}, \
                                cx.parent={})",
            id,
index a53cd52ca8433fe5f1f5386db59a907fb4c5d05e..0aff56ba3cfc5ac0c09992c820313986baab50cb 100644 (file)
@@ -94,6 +94,7 @@ pub struct Export2 {
 // FIXME: dox
 pub type LastPrivateMap = NodeMap<LastPrivate>;
 
+#[deriving(Show)]
 pub enum LastPrivate {
     LastMod(PrivateDep),
     // `use` directives (imports) can refer to two separate definitions in the
@@ -107,13 +108,14 @@ pub enum LastPrivate {
                pub type_used: ImportUse},
 }
 
+#[deriving(Show)]
 pub enum PrivateDep {
     AllPublic,
     DependsOn(DefId),
 }
 
 // How an import is used.
-#[deriving(PartialEq)]
+#[deriving(PartialEq, Show)]
 pub enum ImportUse {
     Unused,       // The import is not used.
     Used,         // The import is used.
@@ -135,7 +137,7 @@ enum PatternBindingMode {
     ArgumentIrrefutableMode,
 }
 
-#[deriving(PartialEq, Eq, Hash)]
+#[deriving(PartialEq, Eq, Hash, Show)]
 enum Namespace {
     TypeNS,
     ValueNS
@@ -576,7 +578,7 @@ struct TypeNsDef {
 }
 
 // Records a possibly-private value definition.
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 struct ValueNsDef {
     is_public: bool, // see note in ImportResolution about how to use this
     def: Def,
@@ -1761,7 +1763,7 @@ fn handle_external_def(&mut self,
                            ident: Ident,
                            new_parent: ReducedGraphParent) {
         debug!("(building reduced graph for \
-                external crate) building external def, priv {:?}",
+                external crate) building external def, priv {}",
                vis);
         let is_public = vis == ast::Public;
         let is_exported = is_public && match new_parent {
@@ -1900,13 +1902,13 @@ fn handle_external_def(&mut self,
           }
           DefMethod(..) => {
               debug!("(building reduced graph for external crate) \
-                      ignoring {:?}", def);
+                      ignoring {}", def);
               // Ignored; handled elsewhere.
           }
           DefLocal(..) | DefPrimTy(..) | DefTyParam(..) |
           DefUse(..) | DefUpvar(..) | DefRegion(..) |
           DefTyParamBinder(..) | DefLabel(..) | DefSelfTy(..) => {
-            fail!("didn't expect `{:?}`", def);
+            fail!("didn't expect `{}`", def);
           }
         }
     }
@@ -2420,7 +2422,7 @@ fn resolve_single_import(&mut self,
                              lp: LastPrivate)
                                  -> ResolveResult<()> {
         debug!("(resolving single import) resolving `{}` = `{}::{}` from \
-                `{}` id {}, last private {:?}",
+                `{}` id {}, last private {}",
                token::get_ident(target),
                self.module_to_string(&*containing_module),
                token::get_ident(source),
@@ -2522,7 +2524,7 @@ fn get_binding(this: &mut Resolver,
                                     shadowable: _
                                 }) => {
                                     debug!("(resolving single import) found \
-                                            import in ns {:?}", namespace);
+                                            import in ns {}", namespace);
                                     let id = import_resolution.id(namespace);
                                     // track used imports and extern crates as well
                                     this.used_imports.insert((id, namespace));
@@ -2596,7 +2598,7 @@ fn get_binding(this: &mut Resolver,
 
         match value_result {
             BoundResult(ref target_module, ref name_bindings) => {
-                debug!("(resolving single import) found value target: {:?}",
+                debug!("(resolving single import) found value target: {}",
                        { name_bindings.value_def.borrow().clone().unwrap().def });
                 self.check_for_conflicting_import(
                     &import_resolution.value_target,
@@ -2619,7 +2621,7 @@ fn get_binding(this: &mut Resolver,
         }
         match type_result {
             BoundResult(ref target_module, ref name_bindings) => {
-                debug!("(resolving single import) found type target: {:?}",
+                debug!("(resolving single import) found type target: {}",
                        { name_bindings.type_def.borrow().clone().unwrap().type_def });
                 self.check_for_conflicting_import(
                     &import_resolution.type_target,
@@ -2724,7 +2726,7 @@ fn resolve_glob_import(&mut self,
                                                   .borrow();
         for (ident, target_import_resolution) in import_resolutions.iter() {
             debug!("(resolving glob import) writing module resolution \
-                    {:?} into `{}`",
+                    {} into `{}`",
                    target_import_resolution.type_target.is_none(),
                    self.module_to_string(module_));
 
@@ -3305,7 +3307,7 @@ fn resolve_item_in_lexical_scope(&mut self,
                                      namespace: Namespace)
                                     -> ResolveResult<(Target, bool)> {
         debug!("(resolving item in lexical scope) resolving `{}` in \
-                namespace {:?} in `{}`",
+                namespace {} in `{}`",
                token::get_ident(name),
                namespace,
                self.module_to_string(&*module_));
@@ -3339,7 +3341,7 @@ fn resolve_item_in_lexical_scope(&mut self,
                     None => {
                         // Not found; continue.
                         debug!("(resolving item in lexical scope) found \
-                                import resolution, but not in namespace {:?}",
+                                import resolution, but not in namespace {}",
                                namespace);
                     }
                     Some(target) => {
@@ -3620,7 +3622,7 @@ fn resolve_name_in_module(&mut self,
                 match import_resolution.target_for_namespace(namespace) {
                     None => {
                         debug!("(resolving name in module) name found, \
-                                but not in namespace {:?}",
+                                but not in namespace {}",
                                namespace);
                     }
                     Some(target) => {
@@ -3780,7 +3782,7 @@ fn add_exports_of_namebindings(&mut self,
         match namebindings.def_for_namespace(ns) {
             Some(d) => {
                 let name = token::get_name(name);
-                debug!("(computing exports) YES: export '{}' => {:?}",
+                debug!("(computing exports) YES: export '{}' => {}",
                        name, d.def_id());
                 exports2.push(Export2 {
                     name: name.get().to_string(),
@@ -3788,7 +3790,7 @@ fn add_exports_of_namebindings(&mut self,
                 });
             }
             d_opt => {
-                debug!("(computing exports) NO: {:?}", d_opt);
+                debug!("(computing exports) NO: {}", d_opt);
             }
         }
     }
@@ -4447,7 +4449,7 @@ fn resolve_trait_reference(&mut self,
             Some(def) => {
                 match def {
                     (DefTrait(_), _) => {
-                        debug!("(resolving trait) found trait def: {:?}", def);
+                        debug!("(resolving trait) found trait def: {}", def);
                         self.record_def(trait_reference.ref_id, def);
                     }
                     (def, _) => {
@@ -4840,7 +4842,7 @@ fn resolve_type(&mut self, ty: &Ty) {
                         match self.resolve_path(ty.id, path, TypeNS, true) {
                             Some(def) => {
                                 debug!("(resolving type) resolved `{}` to \
-                                        type {:?}",
+                                        type {}",
                                        token::get_ident(path.segments
                                                             .last().unwrap()
                                                             .identifier),
@@ -5124,7 +5126,7 @@ struct or enum variant",
                         }
                         result => {
                             debug!("(resolving pattern) didn't find struct \
-                                    def: {:?}", result);
+                                    def: {}", result);
                             let msg = format!("`{}` does not name a structure",
                                               self.path_idents_to_string(path));
                             self.resolve_error(path.span, msg.as_slice());
@@ -5148,7 +5150,7 @@ fn resolve_bare_identifier_pattern(&mut self, name: Ident, span: Span)
                                                  ValueNS) {
             Success((target, _)) => {
                 debug!("(resolve bare identifier pattern) succeeded in \
-                         finding {} at {:?}",
+                         finding {} at {}",
                         token::get_ident(name),
                         target.bindings.value_def.borrow());
                 match *target.bindings.value_def.borrow() {
@@ -5489,7 +5491,7 @@ fn resolve_identifier_in_local_ribs(&mut self,
         match search_result {
             Some(DlDef(def)) => {
                 debug!("(resolving path in local ribs) resolved `{}` to \
-                        local: {:?}",
+                        local: {}",
                        token::get_ident(ident),
                        def);
                 return Some(def);
@@ -5840,7 +5842,7 @@ fn resolve_expr(&mut self, expr: &Expr) {
                     Some(definition) => self.record_def(expr.id, definition),
                     result => {
                         debug!("(resolving expression) didn't find struct \
-                                def: {:?}", result);
+                                def: {}", result);
                         let msg = format!("`{}` does not name a structure",
                                           self.path_idents_to_string(path));
                         self.resolve_error(path.span, msg.as_slice());
@@ -6026,7 +6028,7 @@ fn add_trait_info(found_traits: &mut Vec<DefId>,
     }
 
     fn record_def(&mut self, node_id: NodeId, (def, lp): (Def, LastPrivate)) {
-        debug!("(recording def) recording {:?} for {:?}, last private {:?}",
+        debug!("(recording def) recording {} for {}, last private {}",
                 def, node_id, lp);
         assert!(match lp {LastImport{..} => false, _ => true},
                 "Import should only be used for `use` directives");
@@ -6038,8 +6040,8 @@ fn record_def(&mut self, node_id: NodeId, (def, lp): (Def, LastPrivate)) {
             // the same conclusion! - nmatsakis
             Occupied(entry) => if def != *entry.get() {
                 self.session
-                    .bug(format!("node_id {:?} resolved first to {:?} and \
-                                  then {:?}",
+                    .bug(format!("node_id {} resolved first to {} and \
+                                  then {}",
                                  node_id,
                                  *entry.get(),
                                  def).as_slice());
index 6d84b8cb49dd2319809190e8886a13f09779fce1..6f517f1f166b9a4be37e441e946cb5ef106c0088 100644 (file)
@@ -57,6 +57,7 @@ struct LifetimeContext<'a> {
     scope: Scope<'a>
 }
 
+#[deriving(Show)]
 enum ScopeChain<'a> {
     /// EarlyScope(i, ['a, 'b, ...], s) extends s with early-bound
     /// lifetimes, assigning indexes 'a => i, 'b => i+1, ... etc.
@@ -118,10 +119,10 @@ fn visit_item(&mut self, item: &ast::Item) {
         };
 
         self.with(|_, f| f(EarlyScope(subst::TypeSpace, lifetimes, &ROOT_SCOPE)), |v| {
-            debug!("entering scope {:?}", v.scope);
+            debug!("entering scope {}", v.scope);
             v.check_lifetime_defs(lifetimes);
             visit::walk_item(v, item);
-            debug!("exiting scope {:?}", v.scope);
+            debug!("exiting scope {}", v.scope);
         });
     }
 
@@ -268,7 +269,7 @@ fn visit_fn_decl(&mut self,
 
         let referenced_idents = early_bound_lifetime_names(generics);
         debug!("pushing fn scope id={} due to fn item/method\
-               referenced_idents={:?}",
+               referenced_idents={}",
                n,
                referenced_idents.iter().map(lifetime_show).collect::<Vec<token::InternedString>>());
         let lifetimes = &generics.lifetimes;
@@ -439,7 +440,7 @@ fn insert_lifetime(&mut self,
                                probably a bug in syntax::fold");
         }
 
-        debug!("lifetime_ref={} id={} resolved to {:?}",
+        debug!("lifetime_ref={} id={} resolved to {}",
                 lifetime_to_string(lifetime_ref),
                 lifetime_ref.id,
                 def);
index 21810b608b4d3890c4d428c40eff8b31fb69e7d7..9dfde7ec08415ab337f40b78edf4318153dd1752 100644 (file)
@@ -246,7 +246,7 @@ fn lookup_def_kind(&self, ref_id: NodeId, span: Span) -> Option<recorder::Row> {
             def::DefUse(_) |
             def::DefMethod(..) |
             def::DefPrimTy(_) => {
-                self.sess.span_bug(span, format!("lookup_def_kind for unexpected item: {:?}",
+                self.sess.span_bug(span, format!("lookup_def_kind for unexpected item: {}",
                                                  def).as_slice());
             },
         }
@@ -313,7 +313,7 @@ fn process_method(&mut self, method: &ast::Method) {
                 },
                 _ => {
                     self.sess.span_bug(method.span,
-                                       format!("Container {} for method {} is not a node item {:?}",
+                                       format!("Container {} for method {} is not a node item {}",
                                                impl_id.node,
                                                method.id,
                                                self.analysis.ty_cx.map.get(impl_id.node)
@@ -1415,7 +1415,7 @@ fn visit_arm(&mut self, arm: &ast::Arm) {
                 // FIXME(nrc) what is this doing here?
                 def::DefStatic(_, _) => {}
                 def::DefConst(..) => {}
-                _ => error!("unexpected definition kind when processing collected paths: {:?}",
+                _ => error!("unexpected definition kind when processing collected paths: {}",
                             *def)
             }
         }
index 3a1058c009f6c6075b3b8444620b43633192ecbe..c31a3730a7c36969b834367cc078bb084cbdd234 100644 (file)
 use syntax::fold::Folder;
 use syntax::ptr::P;
 
+#[deriving(Show)]
 struct ConstantExpr<'a>(&'a ast::Expr);
 
 impl<'a> ConstantExpr<'a> {
@@ -240,6 +241,7 @@ fn eq(self, other: ConstantExpr<'a>, tcx: &ty::ctxt) -> bool {
 }
 
 // An option identifying a branch (either a literal, an enum variant or a range)
+#[deriving(Show)]
 enum Opt<'a> {
     ConstantValue(ConstantExpr<'a>),
     ConstantRange(ConstantExpr<'a>, ConstantExpr<'a>),
@@ -519,7 +521,7 @@ fn enter_opt<'a, 'p, 'blk, 'tcx>(
              variant_size: uint,
              val: ValueRef)
              -> Vec<Match<'a, 'p, 'blk, 'tcx>> {
-    debug!("enter_opt(bcx={}, m={}, opt={:?}, col={}, val={})",
+    debug!("enter_opt(bcx={}, m={}, opt={}, col={}, val={})",
            bcx.to_str(),
            m.repr(bcx.tcx()),
            *opt,
@@ -863,7 +865,7 @@ fn insert_lllocals<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
             _ => {}
         }
 
-        debug!("binding {:?} to {}",
+        debug!("binding {} to {}",
                binding_info.id,
                bcx.val_to_string(llval));
         bcx.fcx.lllocals.borrow_mut().insert(binding_info.id, datum);
@@ -1048,7 +1050,7 @@ fn compile_submatch_continue<'a, 'p, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
 
     // Decide what kind of branch we need
     let opts = get_branches(bcx, m, col);
-    debug!("options={:?}", opts);
+    debug!("options={}", opts);
     let mut kind = NoBranch;
     let mut test_val = val;
     debug!("test_val={}", bcx.val_to_string(test_val));
index f88b010c28a357d2b0d70a6189b03fd112ddb144..2f06f16ace1311cefea3e752e579e4bf4a8a07a9 100644 (file)
@@ -74,7 +74,7 @@
 
 
 /// Representations.
-#[deriving(Eq, PartialEq)]
+#[deriving(Eq, PartialEq, Show)]
 pub enum Repr {
     /// C-like enums; basically an int.
     CEnum(IntType, Disr, Disr), // discriminant range (signedness based on the IntType)
@@ -127,7 +127,7 @@ pub enum Repr {
 }
 
 /// For structs, and struct-like parts of anything fancier.
-#[deriving(Eq, PartialEq)]
+#[deriving(Eq, PartialEq, Show)]
 pub struct Struct {
     // If the struct is DST, then the size and alignment do not take into
     // account the unsized fields of the struct.
@@ -156,7 +156,7 @@ pub fn represent_type(cx: &CrateContext, t: ty::t) -> Rc<Repr> {
     }
 
     let repr = Rc::new(represent_type_uncached(cx, t));
-    debug!("Represented as: {:?}", repr)
+    debug!("Represented as: {}", repr)
     cx.adt_reprs().borrow_mut().insert(t, repr.clone());
     repr
 }
@@ -371,6 +371,7 @@ fn mk_struct(cx: &CrateContext, tys: &[ty::t], packed: bool) -> Struct {
     }
 }
 
+#[deriving(Show)]
 struct IntBounds {
     slo: i64,
     shi: i64,
@@ -387,7 +388,7 @@ fn mk_cenum(cx: &CrateContext, hint: Hint, bounds: &IntBounds) -> Repr {
 }
 
 fn range_to_inttype(cx: &CrateContext, hint: Hint, bounds: &IntBounds) -> IntType {
-    debug!("range_to_inttype: {:?} {:?}", hint, bounds);
+    debug!("range_to_inttype: {} {}", hint, bounds);
     // Lists of sizes to try.  u64 is always allowed as a fallback.
     #[allow(non_uppercase_statics)]
     static choose_shortest: &'static[IntType] = &[
@@ -440,7 +441,7 @@ pub fn ll_inttype(cx: &CrateContext, ity: IntType) -> Type {
 }
 
 fn bounds_usable(cx: &CrateContext, ity: IntType, bounds: &IntBounds) -> bool {
-    debug!("bounds_usable: {:?} {:?}", ity, bounds);
+    debug!("bounds_usable: {} {}", ity, bounds);
     match ity {
         attr::SignedInt(_) => {
             let lllo = C_integral(ll_inttype(cx, ity), bounds.slo as u64, true);
@@ -538,7 +539,7 @@ fn generic_type_of(cx: &CrateContext,
                                  Type::array(&Type::i64(cx), align_units),
                 a if a.count_ones() == 1 => Type::array(&Type::vector(&Type::i32(cx), a / 4),
                                                               align_units),
-                _ => fail!("unsupported enum alignment: {:?}", align)
+                _ => fail!("unsupported enum alignment: {}", align)
             };
             assert_eq!(machine::llalign_of_min(cx, pad_ty) as u64, align);
             assert_eq!(align % discr_size, 0);
index d898931cb330b64307761b0b943a4e7179dbde2c..f4586fca52fd6abd9cdbe95cf0d8b25d20f69ee3 100644 (file)
@@ -101,7 +101,7 @@ pub fn trans_inline_asm<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, ia: &ast::InlineAsm)
         constraints.push_str(clobbers.as_slice());
     }
 
-    debug!("Asm Constraints: {:?}", constraints.as_slice());
+    debug!("Asm Constraints: {}", constraints.as_slice());
 
     let num_outputs = outputs.len();
 
index ebc46bb2bfc945d39370d1ac12fd66fb1078d7f1..c5b0e10f0936994651d3b0c57603ec063ef6f07c 100644 (file)
@@ -1088,7 +1088,7 @@ pub fn ignore_lhs(_bcx: Block, local: &ast::Local) -> bool {
 
 pub fn init_local<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, local: &ast::Local)
                               -> Block<'blk, 'tcx> {
-    debug!("init_local(bcx={}, local.id={:?})", bcx.to_str(), local.id);
+    debug!("init_local(bcx={}, local.id={})", bcx.to_str(), local.id);
     let _indenter = indenter();
     let _icx = push_ctxt("init_local");
     _match::store_local(bcx, local)
@@ -2672,7 +2672,7 @@ fn contains_null(s: &str) -> bool {
 }
 
 pub fn get_item_val(ccx: &CrateContext, id: ast::NodeId) -> ValueRef {
-    debug!("get_item_val(id=`{:?}`)", id);
+    debug!("get_item_val(id=`{}`)", id);
 
     match ccx.item_vals().borrow().find_copy(&id) {
         Some(v) => return v,
@@ -2857,7 +2857,7 @@ pub fn get_item_val(ccx: &CrateContext, id: ast::NodeId) -> ValueRef {
         }
 
         ref variant => {
-            ccx.sess().bug(format!("get_item_val(): unexpected variant: {:?}",
+            ccx.sess().bug(format!("get_item_val(): unexpected variant: {}",
                                    variant).as_slice())
         }
     };
index 11cf24027825b50e1c8f0b43643008fb649eea8e..dbc668a04bac9798a7459de86c957420d8ad8dae 100644 (file)
@@ -795,11 +795,11 @@ pub fn inline_asm_call(&self, asm: *const c_char, cons: *const c_char,
                          else          { llvm::False };
 
         let argtys = inputs.iter().map(|v| {
-            debug!("Asm Input Type: {:?}", self.ccx.tn().val_to_string(*v));
+            debug!("Asm Input Type: {}", self.ccx.tn().val_to_string(*v));
             val_ty(*v)
         }).collect::<Vec<_>>();
 
-        debug!("Asm Output Type: {:?}", self.ccx.tn().type_to_string(output));
+        debug!("Asm Output Type: {}", self.ccx.tn().type_to_string(output));
         let fty = Type::func(argtys.as_slice(), &output);
         unsafe {
             let v = llvm::LLVMInlineAsm(
index bb32fdcea7ef68bbc6aeb6feb838625ff26a06f4..f607dfdd17f49b3881938f620fbac7664e74005a 100644 (file)
@@ -209,7 +209,7 @@ fn trans_def<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
             def::DefSelfTy(..) => {
                 bcx.tcx().sess.span_bug(
                     ref_expr.span,
-                    format!("cannot translate def {:?} \
+                    format!("cannot translate def {} \
                              to a callable thing!", def).as_slice());
             }
         }
@@ -226,7 +226,7 @@ pub fn trans_fn_ref(bcx: Block, def_id: ast::DefId, node: ExprOrMethodCall) -> V
     let _icx = push_ctxt("trans_fn_ref");
 
     let substs = node_id_substs(bcx, node);
-    debug!("trans_fn_ref(def_id={}, node={:?}, substs={})",
+    debug!("trans_fn_ref(def_id={}, node={}, substs={})",
            def_id.repr(bcx.tcx()),
            node,
            substs.repr(bcx.tcx()));
@@ -398,7 +398,7 @@ pub fn trans_fn_ref_with_substs(
     let ccx = bcx.ccx();
     let tcx = bcx.tcx();
 
-    debug!("trans_fn_ref_with_substs(bcx={}, def_id={}, node={:?}, \
+    debug!("trans_fn_ref_with_substs(bcx={}, def_id={}, node={}, \
             substs={})",
            bcx.to_str(),
            def_id.repr(tcx),
index f3844a956faddece67bfd56cc71390bdc38681b8..9edca215aef8df1773a75d878f2f7c84e39a5240 100644 (file)
@@ -23,6 +23,7 @@
 use middle::trans::glue;
 use middle::trans::type_::Type;
 use middle::ty;
+use std::fmt;
 use syntax::ast;
 use util::ppaux::Repr;
 
@@ -45,6 +46,7 @@ pub struct CleanupScope<'blk, 'tcx: 'blk> {
     cached_landing_pad: Option<BasicBlockRef>,
 }
 
+#[deriving(Show)]
 pub struct CustomScopeIndex {
     index: uint
 }
@@ -59,7 +61,23 @@ pub enum CleanupScopeKind<'blk, 'tcx: 'blk> {
     LoopScopeKind(ast::NodeId, [Block<'blk, 'tcx>, ..EXIT_MAX])
 }
 
-#[deriving(PartialEq)]
+impl<'blk, 'tcx: 'blk> fmt::Show for CleanupScopeKind<'blk, 'tcx> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::FormatError> {
+        match *self {
+            CustomScopeKind => write!(f, "CustomScopeKind"),
+            AstScopeKind(nid) => write!(f, "AstScopeKind({})", nid),
+            LoopScopeKind(nid, ref blks) => {
+                try!(write!(f, "LoopScopeKind({}, [", nid));
+                for blk in blks.iter() {
+                    try!(write!(f, "{:p}, ", blk));
+                }
+                write!(f, "])")
+            }
+        }
+    }
+}
+
+#[deriving(PartialEq, Show)]
 pub enum EarlyExitLabel {
     UnwindExit,
     ReturnExit,
@@ -83,6 +101,7 @@ fn trans<'blk, 'tcx>(&self,
 
 pub type CleanupObj = Box<Cleanup+'static>;
 
+#[deriving(Show)]
 pub enum ScopeId {
     AstScope(ast::NodeId),
     CustomScope(CustomScopeIndex)
@@ -222,7 +241,7 @@ fn pop_and_trans_custom_cleanup_scope(&self,
          * cleanups for normal exit.
          */
 
-        debug!("pop_and_trans_custom_cleanup_scope({:?})", custom_scope);
+        debug!("pop_and_trans_custom_cleanup_scope({})", custom_scope);
         assert!(self.is_valid_to_pop_custom_scope(custom_scope));
 
         let scope = self.pop_scope();
@@ -273,7 +292,7 @@ fn schedule_lifetime_end(&self,
             ptr: val,
         };
 
-        debug!("schedule_lifetime_end({:?}, val={})",
+        debug!("schedule_lifetime_end({}, val={})",
                cleanup_scope,
                self.ccx.tn().val_to_string(val));
 
@@ -298,7 +317,7 @@ fn schedule_drop_mem(&self,
             zero: false
         };
 
-        debug!("schedule_drop_mem({:?}, val={}, ty={})",
+        debug!("schedule_drop_mem({}, val={}, ty={})",
                cleanup_scope,
                self.ccx.tn().val_to_string(val),
                ty.repr(self.ccx.tcx()));
@@ -324,7 +343,7 @@ fn schedule_drop_and_zero_mem(&self,
             zero: true
         };
 
-        debug!("schedule_drop_and_zero_mem({:?}, val={}, ty={}, zero={})",
+        debug!("schedule_drop_and_zero_mem({}, val={}, ty={}, zero={})",
                cleanup_scope,
                self.ccx.tn().val_to_string(val),
                ty.repr(self.ccx.tcx()),
@@ -350,7 +369,7 @@ fn schedule_drop_immediate(&self,
             zero: false
         };
 
-        debug!("schedule_drop_immediate({:?}, val={}, ty={})",
+        debug!("schedule_drop_immediate({}, val={}, ty={})",
                cleanup_scope,
                self.ccx.tn().val_to_string(val),
                ty.repr(self.ccx.tcx()));
@@ -370,7 +389,7 @@ fn schedule_free_value(&self,
 
         let drop = box FreeValue { ptr: val, heap: heap, content_ty: content_ty };
 
-        debug!("schedule_free_value({:?}, val={}, heap={:?})",
+        debug!("schedule_free_value({}, val={}, heap={})",
                cleanup_scope,
                self.ccx.tn().val_to_string(val),
                heap);
@@ -391,7 +410,7 @@ fn schedule_free_slice(&self,
 
         let drop = box FreeSlice { ptr: val, size: size, align: align, heap: heap };
 
-        debug!("schedule_free_slice({:?}, val={}, heap={:?})",
+        debug!("schedule_free_slice({}, val={}, heap={})",
                cleanup_scope,
                self.ccx.tn().val_to_string(val),
                heap);
@@ -417,7 +436,7 @@ fn schedule_clean_in_ast_scope(&self,
          * in the topmost scope, which must be a temporary scope.
          */
 
-        debug!("schedule_clean_in_ast_scope(cleanup_scope={:?})",
+        debug!("schedule_clean_in_ast_scope(cleanup_scope={})",
                cleanup_scope);
 
         for scope in self.scopes.borrow_mut().iter_mut().rev() {
@@ -598,7 +617,7 @@ fn trans_cleanups_to_exit_scope(&'blk self,
          * perform all cleanups and finally branch to the `break_blk`.
          */
 
-        debug!("trans_cleanups_to_exit_scope label={:?} scopes={}",
+        debug!("trans_cleanups_to_exit_scope label={} scopes={}",
                label, self.scopes_len());
 
         let orig_scopes_len = self.scopes_len();
@@ -634,7 +653,7 @@ fn trans_cleanups_to_exit_scope(&'blk self,
 
                     LoopExit(id, _) => {
                         self.ccx.sess().bug(format!(
-                                "cannot exit from scope {:?}, \
+                                "cannot exit from scope {}, \
                                 not in scope", id).as_slice());
                     }
                 }
@@ -968,6 +987,7 @@ fn trans<'blk, 'tcx>(&self,
     }
 }
 
+#[deriving(Show)]
 pub enum Heap {
     HeapExchange
 }
@@ -1072,7 +1092,7 @@ pub fn temporary_scope(tcx: &ty::ctxt,
     match tcx.region_maps.temporary_scope(id) {
         Some(scope) => {
             let r = AstScope(scope);
-            debug!("temporary_scope({}) = {:?}", id, r);
+            debug!("temporary_scope({}) = {}", id, r);
             r
         }
         None => {
@@ -1086,7 +1106,7 @@ pub fn var_scope(tcx: &ty::ctxt,
                  id: ast::NodeId)
                  -> ScopeId {
     let r = AstScope(tcx.region_maps.var_scope(id));
-    debug!("var_scope({}) = {:?}", id, r);
+    debug!("var_scope({}) = {}", id, r);
     r
 }
 
index 1e2e8c589c66345f0092303fc7824846e32c4f3b..8f877f981c8d920f19866ea16f88dde23ab9890e 100644 (file)
@@ -550,7 +550,7 @@ pub fn get_wrapper_for_bare_fn(ccx: &CrateContext,
         _ => {
             ccx.sess().bug(format!("get_wrapper_for_bare_fn: \
                                     expected a statically resolved fn, got \
-                                    {:?}",
+                                    {}",
                                     def).as_slice());
         }
     };
index 9c1fcaa9ce8231d3d9fc6a576f29024009b94389..8f0ea7a85d433d5f496a09d838112849a32c1b4e 100644 (file)
@@ -468,7 +468,7 @@ pub fn def(&self, nid: ast::NodeId) -> def::Def {
             Some(v) => v.clone(),
             None => {
                 self.tcx().sess.bug(format!(
-                    "no def associated with node id {:?}", nid).as_slice());
+                    "no def associated with node id {}", nid).as_slice());
             }
         }
     }
@@ -704,7 +704,7 @@ pub fn const_get_elt(cx: &CrateContext, v: ValueRef, us: &[c_uint])
     unsafe {
         let r = llvm::LLVMConstExtractValue(v, us.as_ptr(), us.len() as c_uint);
 
-        debug!("const_get_elt(v={}, us={:?}, r={})",
+        debug!("const_get_elt(v={}, us={}, r={})",
                cx.tn().val_to_string(v), us, cx.tn().val_to_string(r));
 
         return r;
@@ -865,7 +865,7 @@ pub fn fulfill_obligation(ccx: &CrateContext,
 }
 
 // Key used to lookup values supplied for type parameters in an expr.
-#[deriving(PartialEq)]
+#[deriving(PartialEq, Show)]
 pub enum ExprOrMethodCall {
     // Type parameters for a path like `None::<int>`
     ExprId(ast::NodeId),
@@ -891,7 +891,7 @@ pub fn node_id_substs(bcx: Block,
 
     if substs.types.any(|t| ty::type_needs_infer(*t)) {
         bcx.sess().bug(
-            format!("type parameters for node {:?} include inference types: \
+            format!("type parameters for node {} include inference types: \
                      {}",
                     node,
                     substs.repr(bcx.tcx())).as_slice());
index ec357f7bfd7c68573758e677e2c2722173e45b55..d83c46be14ab8aa8820498dd94e14d7f0ea3e6e0 100644 (file)
@@ -210,7 +210,7 @@ pub fn const_expr(cx: &CrateContext, e: &ast::Expr) -> (ValueRef, ty::t) {
                 ty::AdjustAddEnv(store) => {
                     cx.sess()
                       .span_bug(e.span,
-                                format!("unexpected static function: {:?}",
+                                format!("unexpected static function: {}",
                                         store).as_slice())
                 }
                 ty::AdjustDerefRef(ref adj) => {
@@ -279,7 +279,7 @@ pub fn const_expr(cx: &CrateContext, e: &ast::Expr) -> (ValueRef, ty::t) {
                                     cx.sess()
                                       .span_bug(e.span,
                                                 format!("unimplemented const \
-                                                         autoref {:?}",
+                                                         autoref {}",
                                                         autoref).as_slice())
                                 }
                             }
index 424007519af1ad93feb0cb6aa12b40f52c7571dc..fe9f832e44a186914fe862326174e39bb2544570 100644 (file)
@@ -138,7 +138,7 @@ pub fn trans_if<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                             els: Option<&ast::Expr>,
                             dest: expr::Dest)
                             -> Block<'blk, 'tcx> {
-    debug!("trans_if(bcx={}, if_id={}, cond={}, thn={:?}, dest={})",
+    debug!("trans_if(bcx={}, if_id={}, cond={}, thn={}, dest={})",
            bcx.to_str(), if_id, bcx.expr_to_string(cond), thn.id,
            dest.to_string(bcx.ccx()));
     let _icx = push_ctxt("trans_if");
@@ -429,7 +429,7 @@ pub fn trans_break_cont<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
             match bcx.tcx().def_map.borrow().find(&expr_id) {
                 Some(&def::DefLabel(loop_id)) => loop_id,
                 ref r => {
-                    bcx.tcx().sess.bug(format!("{:?} in def-map for label",
+                    bcx.tcx().sess.bug(format!("{} in def-map for label",
                                                r).as_slice())
                 }
             }
index 260bde0f07f5d55eea35a4ad550275d6b15889a4..ea6d9e1dd8c48a61a93ae7618934948e66aa5cd9 100644 (file)
@@ -25,6 +25,7 @@
 use middle::ty;
 use util::ppaux::{ty_to_string};
 
+use std::fmt;
 use syntax::ast;
 
 /**
@@ -51,6 +52,7 @@ pub struct DatumBlock<'blk, 'tcx: 'blk, K> {
     pub datum: Datum<K>,
 }
 
+#[deriving(Show)]
 pub enum Expr {
     /// a fresh value that was produced and which has no cleanup yet
     /// because it has not yet "landed" into its permanent home
@@ -62,9 +64,10 @@ pub enum Expr {
     LvalueExpr,
 }
 
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 pub struct Lvalue;
 
+#[deriving(Show)]
 pub struct Rvalue {
     pub mode: RvalueMode
 }
@@ -80,7 +83,7 @@ impl Drop for Rvalue {
     fn drop(&mut self) { }
 }
 
-#[deriving(PartialEq, Eq, Hash)]
+#[deriving(PartialEq, Eq, Hash, Show)]
 pub enum RvalueMode {
     /// `val` is a pointer to the actual value (and thus has type *T)
     ByRef,
@@ -539,7 +542,7 @@ pub fn get_vec_base_and_len(&self, bcx: Block) -> (ValueRef, ValueRef) {
 /**
  * Generic methods applicable to any sort of datum.
  */
-impl<K:KindOps> Datum<K> {
+impl<K: KindOps + fmt::Show> Datum<K> {
     pub fn new(val: ValueRef, ty: ty::t, kind: K) -> Datum<K> {
         Datum { val: val, ty: ty, kind: kind }
     }
@@ -615,7 +618,7 @@ pub fn shallow_copy<'blk, 'tcx>(&self,
 
     #[allow(dead_code)] // useful for debugging
     pub fn to_string(&self, ccx: &CrateContext) -> String {
-        format!("Datum({}, {}, {:?})",
+        format!("Datum({}, {}, {})",
                 ccx.tn().val_to_string(self.val),
                 ty_to_string(ccx.tcx(), self.ty),
                 self.kind)
@@ -658,7 +661,7 @@ pub fn new(bcx: Block<'blk, 'tcx>, datum: Datum<K>) -> DatumBlock<'blk, 'tcx, K>
     }
 }
 
-impl<'blk, 'tcx, K:KindOps> DatumBlock<'blk, 'tcx, K> {
+impl<'blk, 'tcx, K: KindOps + fmt::Show> DatumBlock<'blk, 'tcx, K> {
     pub fn to_expr_datumblock(self) -> DatumBlock<'blk, 'tcx, Expr> {
         DatumBlock::new(self.bcx, self.datum.to_expr_datum())
     }
index d81f78f23ffaf4671f5e21821577245de36315de..4e3eaf26f42e8993bfb163cc5ded32cb70cc02c8 100644 (file)
@@ -468,7 +468,7 @@ fn get_unique_type_id_of_type(&mut self, cx: &CrateContext, type_: ty::t) -> Uni
                                                         &mut unique_type_id);
             },
             _ => {
-                cx.sess().bug(format!("get_unique_type_id_of_type() - unexpected type: {}, {:?}",
+                cx.sess().bug(format!("get_unique_type_id_of_type() - unexpected type: {}, {}",
                                       ppaux::ty_to_string(cx.tcx(), type_).as_slice(),
                                       ty::get(type_).sty).as_slice())
             }
@@ -783,14 +783,14 @@ pub fn create_global_var_metadata(cx: &CrateContext,
                                 format!("debuginfo::\
                                          create_global_var_metadata() -
                                          Captured var-id refers to \
-                                         unexpected ast_item variant: {:?}",
+                                         unexpected ast_item variant: {}",
                                         var_item).as_slice())
                 }
             }
         },
         _ => cx.sess().bug(format!("debuginfo::create_global_var_metadata() \
                                     - Captured var-id refers to unexpected \
-                                    ast_map variant: {:?}",
+                                    ast_map variant: {}",
                                    var_item).as_slice())
     };
 
@@ -846,7 +846,7 @@ pub fn create_local_var_metadata(bcx: Block, local: &ast::Local) {
             Some(datum) => datum,
             None => {
                 bcx.sess().span_bug(span,
-                    format!("no entry in lllocals table for {:?}",
+                    format!("no entry in lllocals table for {}",
                             node_id).as_slice());
             }
         };
@@ -896,7 +896,7 @@ pub fn create_captured_var_metadata(bcx: Block,
                                 format!(
                                 "debuginfo::create_captured_var_metadata() - \
                                  Captured var-id refers to unexpected \
-                                 ast_map variant: {:?}",
+                                 ast_map variant: {}",
                                  ast_item).as_slice());
                 }
             }
@@ -906,7 +906,7 @@ pub fn create_captured_var_metadata(bcx: Block,
               .span_bug(span,
                         format!("debuginfo::create_captured_var_metadata() - \
                                  Captured var-id refers to unexpected \
-                                 ast_map variant: {:?}",
+                                 ast_map variant: {}",
                                 ast_item).as_slice());
         }
     };
@@ -1009,7 +1009,7 @@ pub fn create_argument_metadata(bcx: Block, arg: &ast::Arg) {
             Some(v) => v,
             None => {
                 bcx.sess().span_bug(span,
-                    format!("no entry in lllocals table for {:?}",
+                    format!("no entry in lllocals table for {}",
                             node_id).as_slice());
             }
         };
@@ -1250,7 +1250,7 @@ pub fn create_function_debug_context(cx: &CrateContext,
                 _ => {
                     cx.sess()
                       .bug(format!("create_function_debug_context: \
-                                    unexpected sort of node: {:?}",
+                                    unexpected sort of node: {}",
                                     fnitem).as_slice())
                 }
             }
@@ -1261,7 +1261,7 @@ pub fn create_function_debug_context(cx: &CrateContext,
             return FunctionDebugContext { repr: FunctionWithoutDebugInfo };
         }
         _ => cx.sess().bug(format!("create_function_debug_context: \
-                                    unexpected sort of node: {:?}",
+                                    unexpected sort of node: {}",
                                    fnitem).as_slice())
     };
 
@@ -1542,7 +1542,7 @@ fn compile_unit_metadata(cx: &CrateContext) {
         }
     };
 
-    debug!("compile_unit_metadata: {:?}", compile_unit_name);
+    debug!("compile_unit_metadata: {}", compile_unit_name);
     let producer = format!("rustc version {}",
                            (option_env!("CFG_VERSION")).expect("CFG_VERSION"));
 
@@ -1703,7 +1703,7 @@ fn scope_metadata(fcx: &FunctionContext,
             let node = fcx.ccx.tcx().map.get(node_id);
 
             fcx.ccx.sess().span_bug(error_reporting_span,
-                format!("debuginfo: Could not find scope info for node {:?}",
+                format!("debuginfo: Could not find scope info for node {}",
                         node).as_slice());
         }
     }
@@ -1711,7 +1711,7 @@ fn scope_metadata(fcx: &FunctionContext,
 
 fn basic_type_metadata(cx: &CrateContext, t: ty::t) -> DIType {
 
-    debug!("basic_type_metadata: {:?}", ty::get(t));
+    debug!("basic_type_metadata: {}", ty::get(t));
 
     let (name, encoding) = match ty::get(t).sty {
         ty::ty_nil => ("()".to_string(), DW_ATE_unsigned),
@@ -2855,7 +2855,7 @@ fn type_metadata(cx: &CrateContext,
         }
     };
 
-    debug!("type_metadata: {:?}", ty::get(t));
+    debug!("type_metadata: {}", ty::get(t));
 
     let sty = &ty::get(t).sty;
     let MetadataCreationResult { metadata, already_stored_in_typemap } = match *sty {
@@ -2937,7 +2937,7 @@ fn type_metadata(cx: &CrateContext,
                                    usage_site_span).finalize(cx)
         }
         _ => {
-            cx.sess().bug(format!("debuginfo: unexpected type in type_metadata: {:?}",
+            cx.sess().bug(format!("debuginfo: unexpected type in type_metadata: {}",
                                   sty).as_slice())
         }
     };
@@ -3991,7 +3991,7 @@ fn namespace_for_item(cx: &CrateContext, def_id: ast::DefId) -> Rc<NamespaceTree
             Some(node) => node,
             None => {
                 cx.sess().bug(format!("debuginfo::namespace_for_item(): \
-                                       path too short for {:?}",
+                                       path too short for {}",
                                       def_id).as_slice());
             }
         }
index 19c9c5e0119d2aafa255870b74be6a9fe2d0a999..bcbc9fff834da2eb5dabe4401da8b843faea295e 100644 (file)
@@ -666,7 +666,7 @@ fn trans_datum_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
             bcx.tcx().sess.span_bug(
                 expr.span,
                 format!("trans_rvalue_datum_unadjusted reached \
-                         fall-through case: {:?}",
+                         fall-through case: {}",
                         expr.node).as_slice());
         }
     }
@@ -982,7 +982,7 @@ fn trans_rvalue_stmt_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
             bcx.tcx().sess.span_bug(
                 expr.span,
                 format!("trans_rvalue_stmt_unadjusted reached \
-                         fall-through case: {:?}",
+                         fall-through case: {}",
                         expr.node).as_slice());
         }
     }
@@ -1128,7 +1128,7 @@ fn trans_rvalue_dps_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
             bcx.tcx().sess.span_bug(
                 expr.span,
                 format!("trans_rvalue_dps_unadjusted reached fall-through \
-                         case: {:?}",
+                         case: {}",
                         expr.node).as_slice());
         }
     }
@@ -1176,7 +1176,7 @@ fn trans_def_dps_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
         }
         _ => {
             bcx.tcx().sess.span_bug(ref_expr.span, format!(
-                "Non-DPS def {:?} referened by {}",
+                "Non-DPS def {} referened by {}",
                 def, bcx.node_id_to_string(ref_expr.id)).as_slice());
         }
     }
@@ -1200,7 +1200,7 @@ fn trans_def_fn_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
         }
         _ => {
             bcx.tcx().sess.span_bug(ref_expr.span, format!(
-                    "trans_def_fn_unadjusted invoked on: {:?} for {}",
+                    "trans_def_fn_unadjusted invoked on: {} for {}",
                     def,
                     ref_expr.repr(bcx.tcx())).as_slice());
         }
@@ -1228,7 +1228,7 @@ pub fn trans_local_var<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                 Some(&val) => Datum::new(val, local_ty, Lvalue),
                 None => {
                     bcx.sess().bug(format!(
-                        "trans_local_var: no llval for upvar {:?} found",
+                        "trans_local_var: no llval for upvar {} found",
                         nid).as_slice());
                 }
             }
@@ -1238,17 +1238,17 @@ pub fn trans_local_var<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                 Some(&v) => v,
                 None => {
                     bcx.sess().bug(format!(
-                        "trans_local_var: no datum for local/arg {:?} found",
+                        "trans_local_var: no datum for local/arg {} found",
                         nid).as_slice());
                 }
             };
-            debug!("take_local(nid={:?}, v={}, ty={})",
+            debug!("take_local(nid={}, v={}, ty={})",
                    nid, bcx.val_to_string(datum.val), bcx.ty_to_string(datum.ty));
             datum
         }
         _ => {
             bcx.sess().unimpl(format!(
-                "unsupported def type in trans_local_var: {:?}",
+                "unsupported def type in trans_local_var: {}",
                 def).as_slice());
         }
     }
@@ -1869,7 +1869,7 @@ fn float_cast(bcx: Block,
     } else { llsrc };
 }
 
-#[deriving(PartialEq)]
+#[deriving(PartialEq, Show)]
 pub enum cast_kind {
     cast_pointer,
     cast_integral,
@@ -1981,7 +1981,7 @@ fn trans_imm_cast<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                 cast_float => SIToFP(bcx, lldiscrim_a, ll_t_out),
                 _ => {
                     ccx.sess().bug(format!("translating unsupported cast: \
-                                            {} ({:?}) -> {} ({:?})",
+                                            {} ({}) -> {} ({})",
                                             t_in.repr(bcx.tcx()),
                                             k_in,
                                             t_out.repr(bcx.tcx()),
@@ -1990,7 +1990,7 @@ fn trans_imm_cast<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
             }
         }
         _ => ccx.sess().bug(format!("translating unsupported cast: \
-                                    {} ({:?}) -> {} ({:?})",
+                                    {} ({}) -> {} ({})",
                                     t_in.repr(bcx.tcx()),
                                     k_in,
                                     t_out.repr(bcx.tcx()),
index e47adb6bc0e0352777a819dd7b01703b3057cd6d..cc28b8032087f004b09e0c54d6019a9265add49d 100644 (file)
@@ -474,7 +474,7 @@ pub fn trans_native_call<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
             let llforeign_align = machine::llalign_of_min(ccx, llforeign_ret_ty);
             let llrust_align = machine::llalign_of_min(ccx, llrust_ret_ty);
             let llalign = cmp::min(llforeign_align, llrust_align);
-            debug!("llrust_size={:?}", llrust_size);
+            debug!("llrust_size={}", llrust_size);
             base::call_memcpy(bcx, llretptr_i8, llscratch_i8,
                               C_uint(ccx, llrust_size as uint), llalign as u32);
         }
@@ -576,7 +576,7 @@ pub fn register_rust_fn_with_foreign_abi(ccx: &CrateContext,
     };
     let llfn = base::register_fn_llvmty(ccx, sp, sym, node_id, cconv, llfn_ty);
     add_argument_attributes(&tys, llfn);
-    debug!("register_rust_fn_with_foreign_abi(node_id={:?}, llfn_ty={}, llfn={})",
+    debug!("register_rust_fn_with_foreign_abi(node_id={}, llfn_ty={}, llfn={})",
            node_id, ccx.tn().type_to_string(llfn_ty), ccx.tn().val_to_string(llfn));
     llfn
 }
index eb53fe2d67314f086c5739b85d8ea057f0388b53..0b3f1c9840c4ad2b193eda0a01f5ac78cb284b1a 100644 (file)
@@ -60,7 +60,7 @@ pub fn trans_impl(ccx: &CrateContext,
     let _icx = push_ctxt("meth::trans_impl");
     let tcx = ccx.tcx();
 
-    debug!("trans_impl(name={}, id={:?})", name.repr(tcx), id);
+    debug!("trans_impl(name={}, id={})", name.repr(tcx), id);
 
     // Both here and below with generic methods, be sure to recurse and look for
     // items that we need to translate.
@@ -174,8 +174,8 @@ pub fn trans_static_method_callee(bcx: Block,
     let _icx = push_ctxt("meth::trans_static_method_callee");
     let ccx = bcx.ccx();
 
-    debug!("trans_static_method_callee(method_id={:?}, trait_id={}, \
-            expr_id={:?})",
+    debug!("trans_static_method_callee(method_id={}, trait_id={}, \
+            expr_id={})",
            method_id,
            ty::item_path_str(bcx.tcx(), trait_id),
            expr_id);
index e2c1bf1d8d1a5a45465105538a71642533889fe3..258d12e631f2fb1a8f741b4d86c56df542476bb9 100644 (file)
@@ -38,7 +38,7 @@ pub fn monomorphic_fn(ccx: &CrateContext,
     debug!("monomorphic_fn(\
             fn_id={}, \
             real_substs={}, \
-            ref_id={:?})",
+            ref_id={})",
            fn_id.repr(ccx.tcx()),
            real_substs.repr(ccx.tcx()),
            ref_id);
@@ -70,7 +70,7 @@ pub fn monomorphic_fn(ccx: &CrateContext,
     debug!("monomorphic_fn(\
             fn_id={}, \
             psubsts={}, \
-            hash_id={:?})",
+            hash_id={})",
            fn_id.repr(ccx.tcx()),
            psubsts.repr(ccx.tcx()),
            hash_id);
@@ -82,7 +82,7 @@ pub fn monomorphic_fn(ccx: &CrateContext,
         ccx.sess(),
         ccx.tcx().map.find(fn_id.node),
         || {
-            format!("while monomorphizing {:?}, couldn't find it in \
+            format!("while monomorphizing {}, couldn't find it in \
                      the item map (may have attempted to monomorphize \
                      an item defined in a different crate?)",
                     fn_id)
@@ -247,7 +247,7 @@ pub fn monomorphic_fn(ccx: &CrateContext,
                     d
                 }
                 _ => {
-                    ccx.sess().bug(format!("can't monomorphize a {:?}",
+                    ccx.sess().bug(format!("can't monomorphize a {}",
                                            map_node).as_slice())
                 }
             }
@@ -273,7 +273,7 @@ pub fn monomorphic_fn(ccx: &CrateContext,
         ast_map::NodeBlock(..) |
         ast_map::NodePat(..) |
         ast_map::NodeLocal(..) => {
-            ccx.sess().bug(format!("can't monomorphize a {:?}",
+            ccx.sess().bug(format!("can't monomorphize a {}",
                                    map_node).as_slice())
         }
     };
@@ -284,7 +284,7 @@ pub fn monomorphic_fn(ccx: &CrateContext,
     (lldecl, true)
 }
 
-#[deriving(PartialEq, Eq, Hash)]
+#[deriving(PartialEq, Eq, Hash, Show)]
 pub struct MonoId {
     pub def: ast::DefId,
     pub params: subst::VecPerParamSpace<ty::t>
index fac0ef2014ec66501499dd3c895630c6a0ad8134..a404d9d221ec1f6ce5c34cd1956a15b9cabb300e 100644 (file)
@@ -118,7 +118,7 @@ pub fn trans_fixed_vstore<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
     // to store the array of the suitable size, so all we have to do is
     // generate the content.
 
-    debug!("trans_fixed_vstore(expr={}, dest={:?})",
+    debug!("trans_fixed_vstore(expr={}, dest={})",
            bcx.expr_to_string(expr), dest.to_string(bcx.ccx()));
 
     let vt = vec_types_from_expr(bcx, expr);
@@ -175,7 +175,7 @@ pub fn trans_slice_vec<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
     // Handle the &[...] case:
     let vt = vec_types_from_expr(bcx, content_expr);
     let count = elements_required(bcx, content_expr);
-    debug!("    vt={}, count={:?}", vt.to_string(ccx), count);
+    debug!("    vt={}, count={}", vt.to_string(ccx), count);
     let llcount = C_uint(ccx, count);
 
     let fixed_ty = ty::mk_vec(bcx.tcx(),
@@ -249,7 +249,7 @@ pub fn write_content<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
     let fcx = bcx.fcx;
     let mut bcx = bcx;
 
-    debug!("write_content(vt={}, dest={}, vstore_expr={:?})",
+    debug!("write_content(vt={}, dest={}, vstore_expr={})",
            vt.to_string(bcx.ccx()),
            dest.to_string(bcx.ccx()),
            bcx.expr_to_string(vstore_expr));
@@ -291,7 +291,7 @@ pub fn write_content<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                     let temp_scope = fcx.push_custom_cleanup_scope();
                     for (i, element) in elements.iter().enumerate() {
                         let lleltptr = GEPi(bcx, lldest, [i]);
-                        debug!("writing index {:?} with lleltptr={:?}",
+                        debug!("writing index {} with lleltptr={}",
                                i, bcx.val_to_string(lleltptr));
                         bcx = expr::trans_into(bcx, &**element,
                                                SaveIn(lleltptr));
index d41cd7ed9e5d4aa2b141f9c45069ce85be196cf4..e723d5af89cc4a0ca5a2e331dcae9338d57d3992 100644 (file)
@@ -253,7 +253,7 @@ fn type_of_unsize_info(cx: &CrateContext, t: ty::t) -> Type {
         None => ()
     }
 
-    debug!("type_of {} {:?}", t.repr(cx.tcx()), ty::get(t).sty);
+    debug!("type_of {} {}", t.repr(cx.tcx()), ty::get(t).sty);
 
     // Replace any typedef'd types with their equivalent non-typedef
     // type. This ensures that all LLVM nominal types that contain
@@ -264,7 +264,7 @@ fn type_of_unsize_info(cx: &CrateContext, t: ty::t) -> Type {
 
     if t != t_norm {
         let llty = type_of(cx, t_norm);
-        debug!("--> normalized {} {:?} to {} {:?} llty={}",
+        debug!("--> normalized {} {} to {} {} llty={}",
                 t.repr(cx.tcx()),
                 t,
                 t_norm.repr(cx.tcx()),
@@ -378,7 +378,7 @@ fn type_of_unsize_info(cx: &CrateContext, t: ty::t) -> Type {
       ty::ty_err(..) => cx.sess().bug("type_of with ty_err"),
     };
 
-    debug!("--> mapped t={} {:?} to llty={}",
+    debug!("--> mapped t={} {} to llty={}",
             t.repr(cx.tcx()),
             t,
             cx.tn().type_to_string(llty));
index 06d3623006813e227f58263a1457ba839eafa173..d026b31b914f07ae59ce14ffc8453986bd45418a 100644 (file)
@@ -70,7 +70,7 @@ pub struct field {
     pub mt: mt
 }
 
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 pub enum ImplOrTraitItemContainer {
     TraitContainer(ast::DefId),
     ImplContainer(ast::DefId),
@@ -138,7 +138,7 @@ pub fn def_id(&self) -> ast::DefId {
     }
 }
 
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 pub struct Method {
     pub ident: ast::Ident,
     pub generics: ty::Generics,
@@ -268,13 +268,13 @@ pub enum Variance {
     Bivariant,      // T<A> <: T<B>            -- e.g., unused type parameter
 }
 
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 pub enum AutoAdjustment {
     AdjustAddEnv(ty::TraitStore),
     AdjustDerefRef(AutoDerefRef)
 }
 
-#[deriving(Clone, PartialEq)]
+#[deriving(Clone, PartialEq, Show)]
 pub enum UnsizeKind {
     // [T, ..n] -> [T], the uint field is n.
     UnsizeLength(uint),
@@ -284,13 +284,13 @@ pub enum UnsizeKind {
     UnsizeVtable(TyTrait, /* the self type of the trait */ ty::t)
 }
 
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 pub struct AutoDerefRef {
     pub autoderefs: uint,
     pub autoref: Option<AutoRef>
 }
 
-#[deriving(Clone, PartialEq)]
+#[deriving(Clone, PartialEq, Show)]
 pub enum AutoRef {
     /// Convert from T to &T
     /// The third field allows us to wrap other AutoRef adjustments.
@@ -726,7 +726,7 @@ pub enum Region {
  * the original var id (that is, the root variable that is referenced
  * by the upvar) and the id of the closure expression.
  */
-#[deriving(Clone, PartialEq, Eq, Hash)]
+#[deriving(Clone, PartialEq, Eq, Hash, Show)]
 pub struct UpvarId {
     pub var_id: ast::NodeId,
     pub closure_expr_id: ast::NodeId,
@@ -827,7 +827,7 @@ pub enum BorrowKind {
  *   the closure, so sometimes it is necessary for them to be larger
  *   than the closure lifetime itself.
  */
-#[deriving(PartialEq, Clone, Encodable, Decodable)]
+#[deriving(PartialEq, Clone, Encodable, Decodable, Show)]
 pub struct UpvarBorrow {
     pub kind: BorrowKind,
     pub region: ty::Region,
@@ -1434,7 +1434,7 @@ pub struct UnboxedClosure {
     pub kind: UnboxedClosureKind,
 }
 
-#[deriving(Clone, PartialEq, Eq)]
+#[deriving(Clone, PartialEq, Eq, Show)]
 pub enum UnboxedClosureKind {
     FnUnboxedClosureKind,
     FnMutUnboxedClosureKind,
@@ -3133,7 +3133,7 @@ pub fn fn_is_variadic(fty: t) -> bool {
         ty_bare_fn(ref f) => f.sig.variadic,
         ty_closure(ref f) => f.sig.variadic,
         ref s => {
-            fail!("fn_is_variadic() called on non-fn type: {:?}", s)
+            fail!("fn_is_variadic() called on non-fn type: {}", s)
         }
     }
 }
@@ -3143,7 +3143,7 @@ pub fn ty_fn_sig(fty: t) -> FnSig {
         ty_bare_fn(ref f) => f.sig.clone(),
         ty_closure(ref f) => f.sig.clone(),
         ref s => {
-            fail!("ty_fn_sig() called on non-fn type: {:?}", s)
+            fail!("ty_fn_sig() called on non-fn type: {}", s)
         }
     }
 }
@@ -3163,7 +3163,7 @@ pub fn ty_fn_args(fty: t) -> Vec<t> {
         ty_bare_fn(ref f) => f.sig.inputs.clone(),
         ty_closure(ref f) => f.sig.inputs.clone(),
         ref s => {
-            fail!("ty_fn_args() called on non-fn type: {:?}", s)
+            fail!("ty_fn_args() called on non-fn type: {}", s)
         }
     }
 }
@@ -3177,7 +3177,7 @@ pub fn ty_closure_store(fty: t) -> TraitStore {
             UniqTraitStore
         }
         ref s => {
-            fail!("ty_closure_store() called on non-closure type: {:?}", s)
+            fail!("ty_closure_store() called on non-closure type: {}", s)
         }
     }
 }
@@ -3187,7 +3187,7 @@ pub fn ty_fn_ret(fty: t) -> t {
         ty_bare_fn(ref f) => f.sig.output,
         ty_closure(ref f) => f.sig.output,
         ref s => {
-            fail!("ty_fn_ret() called on non-fn type: {:?}", s)
+            fail!("ty_fn_ret() called on non-fn type: {}", s)
         }
     }
 }
@@ -3208,7 +3208,7 @@ pub fn ty_region(tcx: &ctxt,
         ref s => {
             tcx.sess.span_bug(
                 span,
-                format!("ty_region() invoked on an inappropriate ty: {:?}",
+                format!("ty_region() invoked on an inappropriate ty: {}",
                         s).as_slice());
         }
     }
@@ -3272,7 +3272,7 @@ pub fn expr_span(cx: &ctxt, id: NodeId) -> Span {
             e.span
         }
         Some(f) => {
-            cx.sess.bug(format!("Node id {} is not an expr: {:?}",
+            cx.sess.bug(format!("Node id {} is not an expr: {}",
                                 id,
                                 f).as_slice());
         }
@@ -3292,14 +3292,14 @@ pub fn local_var_name_str(cx: &ctxt, id: NodeId) -> InternedString {
                 }
                 _ => {
                     cx.sess.bug(
-                        format!("Variable id {} maps to {:?}, not local",
+                        format!("Variable id {} maps to {}, not local",
                                 id,
                                 pat).as_slice());
                 }
             }
         }
         r => {
-            cx.sess.bug(format!("Variable id {} maps to {:?}, not local",
+            cx.sess.bug(format!("Variable id {} maps to {}, not local",
                                 id,
                                 r).as_slice());
         }
@@ -3343,7 +3343,7 @@ pub fn adjust_ty(cx: &ctxt,
                         ref b => {
                             cx.sess.bug(
                                 format!("add_env adjustment on non-bare-fn: \
-                                         {:?}",
+                                         {}",
                                         b).as_slice());
                         }
                     }
@@ -3456,7 +3456,7 @@ pub fn resolve_expr(tcx: &ctxt, expr: &ast::Expr) -> def::Def {
         Some(&def) => def,
         None => {
             tcx.sess.span_bug(expr.span, format!(
-                "no def-map entry for expr {:?}", expr.id).as_slice());
+                "no def-map entry for expr {}", expr.id).as_slice());
         }
     }
 }
@@ -3547,7 +3547,7 @@ pub fn expr_kind(tcx: &ctxt, expr: &ast::Expr) -> ExprKind {
                 def => {
                     tcx.sess.span_bug(
                         expr.span,
-                        format!("uncategorized def for expr {:?}: {:?}",
+                        format!("uncategorized def for expr {}: {}",
                                 expr.id,
                                 def).as_slice());
                 }
@@ -3671,7 +3671,7 @@ pub fn field_idx_strict(tcx: &ctxt, name: ast::Name, fields: &[field])
     let mut i = 0u;
     for f in fields.iter() { if f.ident.name == name { return i; } i += 1u; }
     tcx.sess.bug(format!(
-        "no field named `{}` found in the list of fields `{:?}`",
+        "no field named `{}` found in the list of fields `{}`",
         token::get_name(name),
         fields.iter()
               .map(|f| token::get_ident(f.ident).get().to_string())
@@ -3965,7 +3965,7 @@ fn lookup_locally_or_in_crate_store<V:Clone>(
     }
 
     if def_id.krate == ast::LOCAL_CRATE {
-        fail!("No def'n found for {:?} in tcx.{}", def_id, descr);
+        fail!("No def'n found for {} in tcx.{}", def_id, descr);
     }
     let v = load_external();
     map.insert(def_id, v.clone());
@@ -4083,7 +4083,7 @@ pub fn trait_item_def_ids(cx: &ctxt, id: ast::DefId)
 pub fn impl_trait_ref(cx: &ctxt, id: ast::DefId) -> Option<Rc<TraitRef>> {
     memoized(&cx.impl_trait_cache, id, |id: ast::DefId| {
         if id.krate == ast::LOCAL_CRATE {
-            debug!("(impl_trait_ref) searching for trait impl {:?}", id);
+            debug!("(impl_trait_ref) searching for trait impl {}", id);
             match cx.map.find(id.node) {
                 Some(ast_map::NodeItem(item)) => {
                     match item.node {
@@ -5418,7 +5418,7 @@ fn unboxed_closures<'a>(&'a self)
 }
 
 /// The category of explicit self.
-#[deriving(Clone, Eq, PartialEq)]
+#[deriving(Clone, Eq, PartialEq, Show)]
 pub enum ExplicitSelfCategory {
     StaticExplicitSelfCategory,
     ByValueExplicitSelfCategory,
index efd0a2a0e48b2fcad2f33bf012d70be8d8052f74..0e9d255adf9daf1ba8be33a359398b328104fad0 100644 (file)
@@ -961,7 +961,7 @@ pub fn ast_ty_to_ty<'tcx, AC: AstConv<'tcx>, RS: RegionScope>(
                     _ => {
                         tcx.sess.span_fatal(ast_ty.span,
                                             format!("found value name used \
-                                                     as a type: {:?}",
+                                                     as a type: {}",
                                                     a_def).as_slice());
                     }
                 }
index 18e2e6c4f09b536147d006bba5f8cea73d5b2587..9463bafc9d277b70d21ad9e95905a73cb6e265a0 100644 (file)
@@ -442,8 +442,8 @@ pub 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".to_string())
index 45658e8a356a0761000920a3822c9f79d7e7f567..c2e7be2781fd6d073af52be163149e14f5ae10f9 100644 (file)
@@ -643,7 +643,7 @@ fn push_inherent_candidates_from_param(&mut self,
                                            rcvr_ty: ty::t,
                                            restrict_to: Option<DefId>,
                                            param_ty: ParamTy) {
-        debug!("push_inherent_candidates_from_param(param_ty={:?})",
+        debug!("push_inherent_candidates_from_param(param_ty={})",
                param_ty);
         self.push_inherent_candidates_from_bounds(
             rcvr_ty,
@@ -754,7 +754,7 @@ fn push_inherent_candidates_from_bounds_inner(
                     }
                 }
                 None => {
-                    debug!("trait doesn't contain method: {:?}",
+                    debug!("trait doesn't contain method: {}",
                         bound_trait_ref.def_id);
                     // check next trait or bound
                 }
@@ -873,7 +873,7 @@ fn search_for_autoderefd_method(&self,
             None => None,
             Some(method) => {
                 debug!("(searching for autoderef'd method) writing \
-                       adjustment {:?} for {}", adjustment, self.ty_to_string(self_ty));
+                       adjustment {} for {}", adjustment, self.ty_to_string(self_ty));
                 match adjustment {
                     Some((self_expr_id, adj)) => {
                         self.fcx.write_adjustment(self_expr_id, self.span, adj);
@@ -1759,7 +1759,7 @@ fn bug(&self, s: &str) -> ! {
 impl Repr for Candidate {
     fn repr(&self, tcx: &ty::ctxt) -> String {
         format!("Candidate(rcvr_ty={}, rcvr_substs={}, method_ty={}, \
-                 origin={:?})",
+                 origin={})",
                 self.rcvr_match_condition.repr(tcx),
                 self.rcvr_substs.repr(tcx),
                 self.method_ty.repr(tcx),
index 905d70eac19b0b38655bdebfd2ce84ee793f5d6c..c8318825e705450d1c56f2ecf96951a441b8579a 100644 (file)
@@ -1563,7 +1563,7 @@ pub fn local_ty(&self, span: Span, nid: ast::NodeId) -> ty::t {
             None => {
                 self.tcx().sess.span_bug(
                     span,
-                    format!("no type for local variable {:?}",
+                    format!("no type for local variable {}",
                             nid).as_slice());
             }
         }
@@ -1622,7 +1622,7 @@ pub fn write_adjustment(&self,
                             node_id: ast::NodeId,
                             span: Span,
                             adj: ty::AutoAdjustment) {
-        debug!("write_adjustment(node_id={:?}, adj={:?})", node_id, adj);
+        debug!("write_adjustment(node_id={}, adj={})", node_id, adj);
 
         // Careful: adjustments can imply trait obligations if we are
         // casting from a concrete type to an object type. I think
@@ -1673,7 +1673,7 @@ fn register_autoref_obligations(&self,
     fn register_unsize_obligations(&self,
                                    span: Span,
                                    unsize: &ty::UnsizeKind) {
-        debug!("register_unsize_obligations: unsize={:?}", unsize);
+        debug!("register_unsize_obligations: unsize={}", unsize);
 
         match *unsize {
             ty::UnsizeLength(..) => {}
@@ -2551,7 +2551,7 @@ fn check_argument_types<'a>(fcx: &FnCtxt,
         err_args(supplied_arg_count)
     };
 
-    debug!("check_argument_types: formal_tys={:?}",
+    debug!("check_argument_types: formal_tys={}",
            formal_tys.iter().map(|t| fcx.infcx().ty_to_string(*t)).collect::<Vec<String>>());
 
     // Check the arguments.
index f533079be69b3ee77b3836ccd859cb38ad6de4f1..b810ea3d94de613d17dd276126ef85173bbe8d3d 100644 (file)
@@ -239,7 +239,7 @@ fn region_of_def(fcx: &FnCtxt, def: def::Def) -> ty::Region {
             }
         }
         _ => {
-            tcx.sess.bug(format!("unexpected def in region_of_def: {:?}",
+            tcx.sess.bug(format!("unexpected def in region_of_def: {}",
                                  def).as_slice())
         }
     }
@@ -560,7 +560,7 @@ fn constrain_bindings_in_pat(pat: &ast::Pat, rcx: &mut Rcx) {
 }
 
 fn visit_expr(rcx: &mut Rcx, expr: &ast::Expr) {
-    debug!("regionck::visit_expr(e={}, repeating_scope={:?})",
+    debug!("regionck::visit_expr(e={}, repeating_scope={})",
            expr.repr(rcx.fcx.tcx()), rcx.repeating_scope);
 
     // No matter what, the type of each expression must outlive the
@@ -575,7 +575,7 @@ fn visit_expr(rcx: &mut Rcx, expr: &ast::Expr) {
 
     // Check any autoderefs or autorefs that appear.
     for &adjustment in rcx.fcx.inh.adjustments.borrow().find(&expr.id).iter() {
-        debug!("adjustment={:?}", adjustment);
+        debug!("adjustment={}", adjustment);
         match *adjustment {
             ty::AdjustDerefRef(ty::AutoDerefRef {autoderefs, autoref: ref opt_autoref}) => {
                 let expr_ty = rcx.resolve_node_type(expr.id);
@@ -978,7 +978,7 @@ fn constrain_free_variables_in_by_ref_closure(
         debug!("constrain_free_variables({}, {})",
                region_bound.repr(tcx), expr.repr(tcx));
         for freevar in freevars.iter() {
-            debug!("freevar def is {:?}", freevar.def);
+            debug!("freevar def is {}", freevar.def);
 
             // Identify the variable being closed over and its node-id.
             let def = freevar.def;
@@ -1116,7 +1116,7 @@ fn constrain_call<'a, I: Iterator<&'a ast::Expr>>(rcx: &mut Rcx,
     let tcx = rcx.fcx.tcx();
     debug!("constrain_call(call_expr={}, \
             receiver={}, \
-            implicitly_ref_args={:?})",
+            implicitly_ref_args={})",
             call_expr.repr(tcx),
             receiver.repr(tcx),
             implicitly_ref_args);
@@ -1171,7 +1171,7 @@ fn constrain_autoderefs(rcx: &mut Rcx,
      */
     let r_deref_expr = ty::ReScope(deref_expr.id);
     for i in range(0u, derefs) {
-        debug!("constrain_autoderefs(deref_expr=?, derefd_ty={}, derefs={:?}/{:?}",
+        debug!("constrain_autoderefs(deref_expr=?, derefd_ty={}, derefs={}/{}",
                rcx.fcx.infcx().ty_to_string(derefd_ty),
                i, derefs);
 
@@ -1280,7 +1280,7 @@ fn type_of_node_must_outlive(
                            rcx.fcx.inh.adjustments.borrow().find(&id),
                            |method_call| rcx.resolve_method_type(method_call));
     debug!("constrain_regions_in_type_of_node(\
-            ty={}, ty0={}, id={}, minimum_lifetime={:?})",
+            ty={}, ty0={}, id={}, minimum_lifetime={})",
            ty_to_string(tcx, ty), ty_to_string(tcx, ty0),
            id, minimum_lifetime);
     type_must_outlive(rcx, origin, ty, minimum_lifetime);
@@ -1381,7 +1381,7 @@ fn link_autoref(rcx: &Rcx,
      * to lifetimes in the value being autoref'd.
      */
 
-    debug!("link_autoref(autoref={:?})", autoref);
+    debug!("link_autoref(autoref={})", autoref);
     let mc = mc::MemCategorizationContext::new(rcx);
     let expr_cmt = ignore_err!(mc.cat_expr_autoderefd(expr, autoderefs));
     debug!("expr_cmt={}", expr_cmt.repr(rcx.tcx()));
@@ -1779,7 +1779,7 @@ fn link_upvar_borrow_kind_for_nested_closures(rcx: &mut Rcx,
      * this function.
      */
 
-    debug!("link_upvar_borrow_kind: inner_upvar_id={:?} outer_upvar_id={:?}",
+    debug!("link_upvar_borrow_kind: inner_upvar_id={} outer_upvar_id={}",
            inner_upvar_id, outer_upvar_id);
 
     let mut upvar_borrow_map = rcx.fcx.inh.upvar_borrow_map.borrow_mut();
@@ -1795,7 +1795,7 @@ fn link_upvar_borrow_kind_for_nested_closures(rcx: &mut Rcx,
 fn adjust_upvar_borrow_kind_for_loan(upvar_id: ty::UpvarId,
                                      upvar_borrow: &mut ty::UpvarBorrow,
                                      kind: ty::BorrowKind) {
-    debug!("adjust_upvar_borrow_kind_for_loan: upvar_id={:?} kind={:?} -> {:?}",
+    debug!("adjust_upvar_borrow_kind_for_loan: upvar_id={} kind={} -> {}",
            upvar_id, upvar_borrow.kind, kind);
 
     adjust_upvar_borrow_kind(upvar_id, upvar_borrow, kind)
@@ -1812,7 +1812,7 @@ fn adjust_upvar_borrow_kind(upvar_id: ty::UpvarId,
      * is required by some particular use.
      */
 
-    debug!("adjust_upvar_borrow_kind: id={:?} kind=({:?} -> {:?})",
+    debug!("adjust_upvar_borrow_kind: id={} kind=({} -> {})",
            upvar_id, upvar_borrow.kind, kind);
 
     match (upvar_borrow.kind, kind) {
index 6384c65591172b7bef3e15df49724ba43da24de1..56dec61d4102e054a2c596659527199c2fdb87a8 100644 (file)
@@ -306,7 +306,7 @@ fn visit_adjustments(&self, reason: ResolveReason, id: ast::NodeId) {
                         })
                     }
                 };
-                debug!("Adjustments for node {}: {:?}", id, resolved_adjustment);
+                debug!("Adjustments for node {}: {}", id, resolved_adjustment);
                 self.tcx().adjustments.borrow_mut().insert(
                     id, resolved_adjustment);
             }
@@ -319,7 +319,7 @@ fn visit_method_map_entry(&self,
         // Resolve any method map entry
         match self.fcx.inh.method_map.borrow_mut().pop(&method_call) {
             Some(method) => {
-                debug!("writeback::resolve_method_map_entry(call={:?}, entry={})",
+                debug!("writeback::resolve_method_map_entry(call={}, entry={})",
                        method_call,
                        method.repr(self.tcx()));
                 let new_method = MethodCallee {
index f6ac0e1666ca92915399d913e8878ee4dac57398..eef466ceebb9f35be39dd9c8ccf39fe99d025fa3 100644 (file)
@@ -86,7 +86,7 @@ fn get_base_type(inference_context: &InferCtxt,
         ty_str(..) | ty_vec(..) | ty_bare_fn(..) | ty_closure(..) | ty_tup(..) |
         ty_infer(..) | ty_param(..) | ty_err | ty_open(..) | ty_uniq(_) |
         ty_ptr(_) | ty_rptr(_, _) => {
-            debug!("(getting base type) no base type; found {:?}",
+            debug!("(getting base type) no base type; found {}",
                    get(original_type).sty);
             None
         }
@@ -245,7 +245,7 @@ fn instantiate_default_methods(
             trait_ref: &ty::TraitRef,
             all_impl_items: &mut Vec<ImplOrTraitItemId>) {
         let tcx = self.crate_context.tcx;
-        debug!("instantiate_default_methods(impl_id={:?}, trait_ref={})",
+        debug!("instantiate_default_methods(impl_id={}, trait_ref={})",
                impl_id, trait_ref.repr(tcx));
 
         let impl_poly_type = ty::lookup_item_type(tcx, impl_id);
@@ -256,7 +256,7 @@ fn instantiate_default_methods(
             let new_id = tcx.sess.next_node_id();
             let new_did = local_def(new_id);
 
-            debug!("new_did={:?} trait_method={}", new_did, trait_method.repr(tcx));
+            debug!("new_did={} trait_method={}", new_did, trait_method.repr(tcx));
 
             // Create substitutions for the various trait parameters.
             let new_method_ty =
index 6e25b23daace0aa99bf1c8ff20fe1b45949f93ff..8e4948bbea98016feb1b10b8fee5624027f7a372 100644 (file)
@@ -171,7 +171,7 @@ fn get_item_ty(&self, id: ast::DefId) -> ty::Polytype {
             }
             x => {
                 self.tcx.sess.bug(format!("unexpected sort of node \
-                                           in get_item_ty(): {:?}",
+                                           in get_item_ty(): {}",
                                           x).as_slice());
             }
         }
@@ -1421,7 +1421,7 @@ pub fn trait_def_of_item(ccx: &CrateCtxt, it: &ast::Item) -> Rc<ty::TraitDef> {
         ref s => {
             tcx.sess.span_bug(
                 it.span,
-                format!("trait_def_of_item invoked on {:?}", s).as_slice());
+                format!("trait_def_of_item invoked on {}", s).as_slice());
         }
     };
 
index a0c190c5c817b0541230ace1dc4f9866b2d771d9..9f88bec7f42257e98d64d350bc2b8dad6558d504 100644 (file)
@@ -231,7 +231,7 @@ pub fn unpack_actual_value<T>(&self, a: ty::t, f: |&ty::sty| -> T)
                 self.get_ref().infcx.tcx.sess.span_bug(
                     self.get_ref().trace.origin.span(),
                     format!("failed to resolve even without \
-                             any force options: {:?}", e).as_slice());
+                             any force options: {}", e).as_slice());
             }
         }
     }
@@ -243,7 +243,7 @@ pub fn coerce_borrowed_pointer(&self,
                                    b: ty::t,
                                    mutbl_b: ast::Mutability)
                                    -> CoerceResult {
-        debug!("coerce_borrowed_pointer(a={}, sty_a={:?}, b={})",
+        debug!("coerce_borrowed_pointer(a={}, sty_a={}, b={})",
                a.repr(self.get_ref().infcx.tcx), sty_a,
                b.repr(self.get_ref().infcx.tcx));
 
@@ -283,7 +283,7 @@ fn coerce_unsized_with_borrow(&self,
                                   b: ty::t,
                                   mutbl_b: ast::Mutability)
                                   -> CoerceResult {
-        debug!("coerce_unsized_with_borrow(a={}, sty_a={:?}, b={})",
+        debug!("coerce_unsized_with_borrow(a={}, sty_a={}, b={})",
                a.repr(self.get_ref().infcx.tcx), sty_a,
                b.repr(self.get_ref().infcx.tcx));
 
@@ -314,7 +314,7 @@ fn coerce_unsized(&self,
                       sty_a: &ty::sty,
                       b: ty::t)
                       -> CoerceResult {
-        debug!("coerce_unsized(a={}, sty_a={:?}, b={})",
+        debug!("coerce_unsized(a={}, sty_a={}, b={})",
                a.repr(self.get_ref().infcx.tcx), sty_a,
                b.repr(self.get_ref().infcx.tcx));
 
@@ -342,7 +342,7 @@ fn coerce_unsized(&self,
                                                  ty::mt{ty: ty, mutbl: mt_b.mutbl});
                             try!(self.get_ref().infcx.try(|| sub.tys(ty, b)));
                             debug!("Success, coerced with AutoDerefRef(1, \
-                                    AutoPtr(AutoUnsize({:?})))", kind);
+                                    AutoPtr(AutoUnsize({})))", kind);
                             Ok(Some(AdjustDerefRef(AutoDerefRef {
                                 autoderefs: 1,
                                 autoref: Some(ty::AutoPtr(r_borrow, mt_b.mutbl,
@@ -365,7 +365,7 @@ fn coerce_unsized(&self,
                                                  ty::mt{ty: ty, mutbl: mt_b.mutbl});
                             try!(self.get_ref().infcx.try(|| sub.tys(ty, b)));
                             debug!("Success, coerced with AutoDerefRef(1, \
-                                    AutoPtr(AutoUnsize({:?})))", kind);
+                                    AutoPtr(AutoUnsize({})))", kind);
                             Ok(Some(AdjustDerefRef(AutoDerefRef {
                                 autoderefs: 1,
                                 autoref: Some(ty::AutoUnsafe(mt_b.mutbl,
@@ -383,7 +383,7 @@ fn coerce_unsized(&self,
                             let ty = ty::mk_uniq(self.get_ref().infcx.tcx, ty);
                             try!(self.get_ref().infcx.try(|| sub.tys(ty, b)));
                             debug!("Success, coerced with AutoDerefRef(1, \
-                                    AutoUnsizeUniq({:?}))", kind);
+                                    AutoUnsizeUniq({}))", kind);
                             Ok(Some(AdjustDerefRef(AutoDerefRef {
                                 autoderefs: 1,
                                 autoref: Some(ty::AutoUnsizeUniq(kind))
@@ -405,7 +405,7 @@ fn unsize_ty(&self,
                  sty_a: &ty::sty,
                  ty_b: ty::t)
                  -> Option<(ty::t, ty::UnsizeKind)> {
-        debug!("unsize_ty(sty_a={:?}, ty_b={})", sty_a, ty_b.repr(self.get_ref().infcx.tcx));
+        debug!("unsize_ty(sty_a={}, ty_b={})", sty_a, ty_b.repr(self.get_ref().infcx.tcx));
 
         let tcx = self.get_ref().infcx.tcx;
 
@@ -485,7 +485,7 @@ fn coerce_borrowed_object(&self,
     {
         let tcx = self.get_ref().infcx.tcx;
 
-        debug!("coerce_borrowed_object(a={}, sty_a={:?}, b={}, b_mutbl={})",
+        debug!("coerce_borrowed_object(a={}, sty_a={}, b={}, b_mutbl={})",
                a.repr(tcx), sty_a,
                b.repr(tcx), b_mutbl);
 
@@ -505,7 +505,7 @@ fn coerce_unsafe_object(&self,
     {
         let tcx = self.get_ref().infcx.tcx;
 
-        debug!("coerce_unsafe_object(a={}, sty_a={:?}, b={}, b_mutbl={})",
+        debug!("coerce_unsafe_object(a={}, sty_a={}, b={}, b_mutbl={})",
                a.repr(tcx), sty_a,
                b.repr(tcx), b_mutbl);
 
@@ -557,7 +557,7 @@ pub fn coerce_borrowed_fn(&self,
                               sty_a: &ty::sty,
                               b: ty::t)
                               -> CoerceResult {
-        debug!("coerce_borrowed_fn(a={}, sty_a={:?}, b={})",
+        debug!("coerce_borrowed_fn(a={}, sty_a={}, b={})",
                a.repr(self.get_ref().infcx.tcx), sty_a,
                b.repr(self.get_ref().infcx.tcx));
 
@@ -610,7 +610,7 @@ pub fn coerce_unsafe_ptr(&self,
                              b: ty::t,
                              mutbl_b: ast::Mutability)
                              -> CoerceResult {
-        debug!("coerce_unsafe_ptr(a={}, sty_a={:?}, b={})",
+        debug!("coerce_unsafe_ptr(a={}, sty_a={}, b={})",
                a.repr(self.get_ref().infcx.tcx), sty_a,
                b.repr(self.get_ref().infcx.tcx));
 
index a742cf45059a4784749179446afdb311c61dd741..8ae0b603e487185abe183895e288b074be30c3ec 100644 (file)
@@ -390,7 +390,7 @@ fn check_ptr_to_unsized<'tcx, C: Combine<'tcx>>(this: &C,
     let tcx = this.infcx().tcx;
     let a_sty = &ty::get(a).sty;
     let b_sty = &ty::get(b).sty;
-    debug!("super_tys: a_sty={:?} b_sty={:?}", a_sty, b_sty);
+    debug!("super_tys: a_sty={} b_sty={}", a_sty, b_sty);
     return match (a_sty, b_sty) {
       // The "subtype" ought to be handling cases involving bot or var:
       (&ty::ty_bot, _) |
@@ -470,7 +470,7 @@ fn check_ptr_to_unsized<'tcx, C: Combine<'tcx>>(this: &C,
       (&ty::ty_trait(ref a_),
        &ty::ty_trait(ref b_))
       if a_.def_id == b_.def_id => {
-          debug!("Trying to match traits {:?} and {:?}", a, b);
+          debug!("Trying to match traits {} and {}", a, b);
           let substs = try!(this.substs(a_.def_id, &a_.substs, &b_.substs));
           let bounds = try!(this.existential_bounds(a_.bounds, b_.bounds));
           Ok(ty::mk_trait(tcx,
index 1a79837c03ae35704f4245165edd0683f4841db6..2ab585f5ae9988b78fef4d20b3b0589098ce6052 100644 (file)
@@ -268,7 +268,7 @@ fn process_errors(&self, errors: &Vec<RegionResolutionError>)
                 }
             }
             let pe = ProcessedErrors(var_origins, trace_origins, same_regions);
-            debug!("errors processed: {:?}", pe);
+            debug!("errors processed: {}", pe);
             processed_errors.push(pe);
         }
         return processed_errors;
@@ -297,7 +297,7 @@ fn free_regions_from_same_fn(tcx: &ty::ctxt,
                                      sub: Region,
                                      sup: Region)
                                      -> Option<FreeRegionsFromSameFn> {
-            debug!("free_regions_from_same_fn(sub={:?}, sup={:?})", sub, sup);
+            debug!("free_regions_from_same_fn(sub={}, sup={})", sub, sup);
             let (scope_id, fr1, fr2) = match (sub, sup) {
                 (ReFree(fr1), ReFree(fr2)) => {
                     if fr1.scope_id != fr2.scope_id {
index 08d4f9f3a86e5f041e9d00a8c8908a79e2982f0b..83ca67f33bc31a7a7e5a47a4af97138619b622f9 100644 (file)
@@ -109,7 +109,7 @@ fn builtin_bounds(&self,
     }
 
     fn regions(&self, a: ty::Region, b: ty::Region) -> cres<ty::Region> {
-        debug!("{}.regions({:?}, {:?})",
+        debug!("{}.regions({}, {})",
                self.tag(),
                a.repr(self.fields.infcx.tcx),
                b.repr(self.fields.infcx.tcx));
@@ -130,7 +130,7 @@ fn fn_sigs(&self, a: &ty::FnSig, b: &ty::FnSig) -> cres<ty::FnSig> {
         // Note: this is a subtle algorithm.  For a full explanation,
         // please see the large comment in `region_inference.rs`.
 
-        debug!("{}.fn_sigs({:?}, {:?})",
+        debug!("{}.fn_sigs({}, {})",
                self.tag(), a.repr(self.fields.infcx.tcx), b.repr(self.fields.infcx.tcx));
         let _indenter = indenter();
 
@@ -254,7 +254,7 @@ fn rev_lookup(this: &Glb,
             }
             this.fields.infcx.tcx.sess.span_bug(
                 this.fields.trace.origin.span(),
-                format!("could not find original bound region for {:?}",
+                format!("could not find original bound region for {}",
                         r).as_slice())
         }
 
index 6095e5b0504237823358ee068dd11bcf2d5dde46..24642d5213892ddb1a563f383d7278d1bf9fc18d 100644 (file)
@@ -123,7 +123,7 @@ pub fn var_ids<'tcx, T: Combine<'tcx>>(this: &T,
             r => {
                 this.infcx().tcx.sess.span_bug(
                     this.trace().origin.span(),
-                    format!("found non-region-vid: {:?}", r).as_slice());
+                    format!("found non-region-vid: {}", r).as_slice());
             }
         }).collect()
 }
index 276a22648374173f4eefcf8d885789f619072a09..f2d9203f8437b11bdf6a6a44be34e1556a20879a 100644 (file)
@@ -157,7 +157,7 @@ fn generalize_region(this: &Lub,
             // Regions that pre-dated the LUB computation stay as they are.
             if !is_var_in_set(new_vars, r0) {
                 assert!(!r0.is_bound());
-                debug!("generalize_region(r0={:?}): not new variable", r0);
+                debug!("generalize_region(r0={}): not new variable", r0);
                 return r0;
             }
 
@@ -167,8 +167,8 @@ fn generalize_region(this: &Lub,
             // *related* to regions that pre-date the LUB computation
             // stay as they are.
             if !tainted.iter().all(|r| is_var_in_set(new_vars, *r)) {
-                debug!("generalize_region(r0={:?}): \
-                        non-new-variables found in {:?}",
+                debug!("generalize_region(r0={}): \
+                        non-new-variables found in {}",
                        r0, tainted);
                 assert!(!r0.is_bound());
                 return r0;
@@ -181,8 +181,8 @@ fn generalize_region(this: &Lub,
             // with.
             for (a_br, a_r) in a_map.iter() {
                 if tainted.iter().any(|x| x == a_r) {
-                    debug!("generalize_region(r0={:?}): \
-                            replacing with {:?}, tainted={:?}",
+                    debug!("generalize_region(r0={}): \
+                            replacing with {}, tainted={}",
                            r0, *a_br, tainted);
                     return ty::ReLateBound(new_scope, *a_br);
                 }
@@ -190,7 +190,7 @@ fn generalize_region(this: &Lub,
 
             this.fields.infcx.tcx.sess.span_bug(
                 this.fields.trace.origin.span(),
-                format!("region {:?} is not associated with \
+                format!("region {} is not associated with \
                          any bound region from A!",
                         r0).as_slice())
         }
index 7c04b371aaea084c9f8468c414b10105a1d71654..7c455b85707b8fe812fe061257c4e2d1870360f7 100644 (file)
@@ -95,7 +95,7 @@ pub struct InferCtxt<'a, 'tcx: 'a> {
 /// Why did we require that the two types be related?
 ///
 /// See `error_reporting.rs` for more details
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 pub enum TypeOrigin {
     // Not yet categorized in a better way
     Misc(Span),
@@ -127,7 +127,7 @@ pub enum TypeOrigin {
 }
 
 /// See `error_reporting.rs` for more details
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 pub enum ValuePairs {
     Types(ty::expected_found<ty::t>),
     TraitRefs(ty::expected_found<Rc<ty::TraitRef>>),
@@ -137,7 +137,7 @@ pub enum ValuePairs {
 /// encounter an error or subtyping constraint.
 ///
 /// See `error_reporting.rs` for more details.
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 pub struct TypeTrace {
     origin: TypeOrigin,
     values: ValuePairs,
@@ -146,7 +146,7 @@ pub struct TypeTrace {
 /// The origin of a `r1 <= r2` constraint.
 ///
 /// See `error_reporting.rs` for more details
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 pub enum SubregionOrigin {
     // Arose from a subtyping relation
     Subtype(TypeTrace),
@@ -224,7 +224,7 @@ pub enum SubregionOrigin {
 /// Reasons to create a region inference variable
 ///
 /// See `error_reporting.rs` for more details
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 pub enum RegionVariableOrigin {
     // Region variables created for ill-categorized reasons,
     // mostly indicates places in need of refactoring
@@ -887,7 +887,7 @@ pub fn type_error_message_str_with_expected(&self,
                                                 expected_ty: Option<ty::t>,
                                                 actual_ty: String,
                                                 err: Option<&ty::type_err>) {
-        debug!("hi! expected_ty = {:?}, actual_ty = {}", expected_ty, actual_ty);
+        debug!("hi! expected_ty = {}, actual_ty = {}", expected_ty, actual_ty);
 
         let error_str = err.map_or("".to_string(), |t_err| {
             format!(" ({})", ty::type_err_to_str(self.tcx, t_err))
@@ -965,7 +965,7 @@ pub fn replace_late_bound_regions_with_fresh_regions(&self,
             replace_late_bound_regions_in_fn_sig(self.tcx, fsig, |br| {
                 let rvar = self.next_region_var(
                     BoundRegionInFnType(trace.origin.span(), br));
-                debug!("Bound region {} maps to {:?}",
+                debug!("Bound region {} maps to {}",
                        bound_region_to_string(self.tcx, "", false, br),
                        rvar);
                 rvar
@@ -1120,7 +1120,7 @@ fn repr(&self, tcx: &ty::ctxt) -> String {
             }
             Reborrow(a) => format!("Reborrow({})", a.repr(tcx)),
             ReborrowUpvar(a, b) => {
-                format!("ReborrowUpvar({},{:?})", a.repr(tcx), b)
+                format!("ReborrowUpvar({},{})", a.repr(tcx), b)
             }
             ReferenceOutlivesReferent(_, a) => {
                 format!("ReferenceOutlivesReferent({})", a.repr(tcx))
index 008ca6c0771655bb523e534a18558fb26468adab..504550f0d40d2fc5b80efe1ea7755d7f2aaaaa19 100644 (file)
@@ -81,7 +81,7 @@ pub enum CombineMapType {
     Lub, Glb
 }
 
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 pub enum RegionResolutionError {
     /// `ConcreteFailure(o, a, b)`:
     ///
@@ -133,7 +133,7 @@ pub enum RegionResolutionError {
 /// ```
 /// would report an error because we expect 'a and 'b to match, and so we group
 /// 'a and 'b together inside a SameRegions struct
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 pub struct SameRegions {
     pub scope_id: ast::NodeId,
     pub regions: Vec<BoundRegion>
index 7403d50a2109ca287ef63ea24f739f3db23321de..158fda802ff002e79a4d550607ea7e16a71cf576 100644 (file)
@@ -200,7 +200,7 @@ fn fn_sigs(&self, a: &ty::FnSig, b: &ty::FnSig) -> cres<ty::FnSig> {
         let (skol_map, b_sig) = {
             replace_late_bound_regions_in_fn_sig(self.fields.infcx.tcx, b, |br| {
                 let skol = self.fields.infcx.region_vars.new_skolemized(br);
-                debug!("Bound region {} skolemized to {:?}",
+                debug!("Bound region {} skolemized to {}",
                        bound_region_to_string(self.fields.infcx.tcx, "", false, br),
                        skol);
                 skol
index 6ef2143b624f821543f4759fa52720f9d2c5df3d..baa4f6d013bd24fe437f284e633559d5374ff425 100644 (file)
@@ -315,7 +315,7 @@ pub fn resolve_regions(&self) {
     pub fn make_lub_ty(&self, t1: ty::t, t2: ty::t) -> ty::t {
         match self.lub().tys(t1, t2) {
             Ok(t) => t,
-            Err(ref e) => fail!("unexpected error computing LUB: {:?}",
+            Err(ref e) => fail!("unexpected error computing LUB: {}",
                                 ty::type_err_to_str(self.infcx.tcx, e))
         }
     }
@@ -341,7 +341,7 @@ pub fn check_glb(&self, t1: ty::t, t2: ty::t, t_glb: ty::t) {
                self.ty_to_string(t_glb));
         match self.glb().tys(t1, t2) {
             Err(e) => {
-                fail!("unexpected error computing LUB: {:?}", e)
+                fail!("unexpected error computing LUB: {}", e)
             }
             Ok(t) => {
                 self.assert_eq(t, t_glb);
index e93ad056051f5bb3723ffbb4b0f0238a2414c5ea..5a23d54c9720b60766dbe0e6d00c4bec7b258097 100644 (file)
 pub mod coherence;
 pub mod variance;
 
-#[deriving(Clone, Encodable, Decodable, PartialEq, PartialOrd)]
+#[deriving(Clone, Encodable, Decodable, PartialEq, PartialOrd, Show)]
 pub struct param_index {
     pub space: subst::ParamSpace,
     pub index: uint
 }
 
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 pub enum MethodOrigin {
     // fully statically resolved method
     MethodStatic(ast::DefId),
@@ -111,7 +111,7 @@ pub enum MethodOrigin {
 
 // details for a method invoked with a receiver whose type is a type parameter
 // with a bounded trait.
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 pub struct MethodParam {
     // the precise trait reference that occurs as a bound -- this may
     // be a supertrait of what the user actually typed.
@@ -122,7 +122,7 @@ pub struct MethodParam {
 }
 
 // details for a method invoked with a receiver whose type is an object
-#[deriving(Clone)]
+#[deriving(Clone, Show)]
 pub struct MethodObject {
     // the (super)trait containing the method to be invoked
     pub trait_ref: Rc<ty::TraitRef>,
@@ -249,7 +249,7 @@ impl Repr for vtable_origin {
     fn repr(&self, tcx: &ty::ctxt) -> String {
         match *self {
             vtable_static(def_id, ref tys, ref vtable_res) => {
-                format!("vtable_static({:?}:{}, {}, {})",
+                format!("vtable_static({}:{}, {}, {})",
                         def_id,
                         ty::item_path_str(tcx, def_id),
                         tys.repr(tcx),
@@ -257,7 +257,7 @@ fn repr(&self, tcx: &ty::ctxt) -> String {
             }
 
             vtable_param(x, y) => {
-                format!("vtable_param({:?}, {:?})", x, y)
+                format!("vtable_param({}, {})", x, y)
             }
 
             vtable_unboxed_closure(def_id) => {
index 60a7aa77904420b151b397fa31f1d3823472ce03..dd6e087b6727a04d9253698357ec3c459fbdcda5 100644 (file)
@@ -232,6 +232,7 @@ pub fn infer_variance(tcx: &ty::ctxt) {
 
 type VarianceTermPtr<'a> = &'a VarianceTerm<'a>;
 
+#[deriving(Show)]
 struct InferredIndex(uint);
 
 enum VarianceTerm<'a> {
@@ -325,10 +326,10 @@ fn add_inferred(&mut self,
         assert!(newly_added);
 
         debug!("add_inferred(item_id={}, \
-                kind={:?}, \
+                kind={}, \
                 index={}, \
                 param_id={},
-                inf_index={:?})",
+                inf_index={})",
                 item_id, kind, index, param_id, inf_index);
     }
 
@@ -852,7 +853,7 @@ fn add_constraints_from_substs(&mut self,
                                    region_param_defs: &[ty::RegionParameterDef],
                                    substs: &subst::Substs,
                                    variance: VarianceTermPtr<'a>) {
-        debug!("add_constraints_from_substs(def_id={:?})", def_id);
+        debug!("add_constraints_from_substs(def_id={})", def_id);
 
         for p in type_param_defs.iter() {
             let variance_decl =
index 8ea9015c05d97d4d96ce5c44bad5cc05bc9e9c82..082dde978d8e7068d66745f9f71532a5573aba54 100644 (file)
@@ -13,6 +13,7 @@
 use std::cell::RefCell;
 use std::collections::HashMap;
 use std::hash::{Hash, Hasher};
+use std::fmt::Show;
 use syntax::ast;
 use syntax::visit;
 use syntax::visit::Visitor;
@@ -36,12 +37,12 @@ pub fn time<T, U>(do_it: bool, what: &str, u: U, f: |U| -> T) -> T {
     rv
 }
 
-pub fn indent<R>(op: || -> R) -> R {
+pub fn indent<R: Show>(op: || -> R) -> R {
     // Use in conjunction with the log post-processor like `src/etc/indenter`
     // to make debug output more readable.
     debug!(">>");
     let r = op();
-    debug!("<< (Result = {:?})", r);
+    debug!("<< (Result = {})", r);
     r
 }
 
index 459e7eb093e7c2d96877d539f4f70ed36d6b5b44..404864cec04e4968a45a64b2e8203907d938e730 100644 (file)
@@ -154,7 +154,7 @@ pub fn explain_region_and_span(cx: &ctxt, region: ty::Region)
       // I believe these cases should not occur (except when debugging,
       // perhaps)
       ty::ReInfer(_) | ty::ReLateBound(..) => {
-        (format!("lifetime {:?}", region), None)
+        (format!("lifetime {}", region), None)
       }
     };
 
@@ -599,7 +599,7 @@ fn user_string(&self, tcx: &ctxt) -> String {
 
 impl Repr for def::Def {
     fn repr(&self, _tcx: &ctxt) -> String {
-        format!("{:?}", *self)
+        format!("{}", *self)
     }
 }
 
@@ -843,14 +843,14 @@ fn repr(&self, tcx: &ctxt) -> String {
                 Some(ast_map::NodeVariant(..)) |
                 Some(ast_map::NodeStructCtor(..)) => {
                     return format!(
-                                "{:?}:{}",
+                                "{}:{}",
                                 *self,
                                 ty::item_path_str(tcx, *self))
                 }
                 _ => {}
             }
         }
-        return format!("{:?}", *self)
+        return format!("{}", *self)
     }
 }
 
@@ -922,19 +922,19 @@ fn repr(&self, _tcx: &ctxt) -> String {
 
 impl Repr for ast::ExplicitSelf_ {
     fn repr(&self, _tcx: &ctxt) -> String {
-        format!("{:?}", *self)
+        format!("{}", *self)
     }
 }
 
 impl Repr for ast::Visibility {
     fn repr(&self, _tcx: &ctxt) -> String {
-        format!("{:?}", *self)
+        format!("{}", *self)
     }
 }
 
 impl Repr for ty::BareFnTy {
     fn repr(&self, tcx: &ctxt) -> String {
-        format!("BareFnTy {{fn_style: {:?}, abi: {}, sig: {}}}",
+        format!("BareFnTy {{fn_style: {}, abi: {}, sig: {}}}",
                 self.fn_style,
                 self.abi.to_string(),
                 self.sig.repr(tcx))
@@ -985,7 +985,7 @@ fn repr(&self, tcx: &ctxt) -> String {
 
 impl Repr for typeck::MethodObject {
     fn repr(&self, tcx: &ctxt) -> String {
-        format!("MethodObject({},{:?},{:?})",
+        format!("MethodObject({},{},{})",
                 self.trait_ref.repr(tcx),
                 self.method_num,
                 self.real_index)
@@ -1000,7 +1000,7 @@ fn repr(&self, tcx: &ctxt) -> String {
 
 impl Repr for ty::BuiltinBound {
     fn repr(&self, _tcx: &ctxt) -> String {
-        format!("{:?}", *self)
+        format!("{}", *self)
     }
 }
 
@@ -1118,13 +1118,13 @@ fn repr(&self, tcx: &ctxt) -> String {
 
 impl Repr for ast::Mutability {
     fn repr(&self, _tcx: &ctxt) -> String {
-        format!("{:?}", *self)
+        format!("{}", *self)
     }
 }
 
 impl Repr for ty::BorrowKind {
     fn repr(&self, _tcx: &ctxt) -> String {
-        format!("{:?}", *self)
+        format!("{}", *self)
     }
 }
 
@@ -1162,25 +1162,25 @@ fn repr(&self, _tcx: &ctxt) -> String {
 
 impl Repr for ty::IntVarValue {
     fn repr(&self, _tcx: &ctxt) -> String {
-        format!("{:?}", *self)
+        format!("{}", *self)
     }
 }
 
 impl Repr for ast::IntTy {
     fn repr(&self, _tcx: &ctxt) -> String {
-        format!("{:?}", *self)
+        format!("{}", *self)
     }
 }
 
 impl Repr for ast::UintTy {
     fn repr(&self, _tcx: &ctxt) -> String {
-        format!("{:?}", *self)
+        format!("{}", *self)
     }
 }
 
 impl Repr for ast::FloatTy {
     fn repr(&self, _tcx: &ctxt) -> String {
-        format!("{:?}", *self)
+        format!("{}", *self)
     }
 }