diff options
Diffstat (limited to 'src/librustc')
38 files changed, 262 insertions, 262 deletions
diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs index e3ab587894b..acf0cc6bd95 100644 --- a/src/librustc/lint/builtin.rs +++ b/src/librustc/lint/builtin.rs @@ -1629,7 +1629,6 @@ declare_lint! { Warn, "detects use of #[deprecated] items" } - // FIXME #6875: Change to Warn after std library stabilization is complete declare_lint! { EXPERIMENTAL, @@ -1848,7 +1847,7 @@ declare_lint! { "detects transmutes of fat pointers" } -declare_lint!{ +declare_lint! { pub MISSING_COPY_IMPLEMENTATIONS, Warn, "detects potentially-forgotten implementations of `Copy`" diff --git a/src/librustc/metadata/csearch.rs b/src/librustc/metadata/csearch.rs index 9249bce276e..72ce61b133a 100644 --- a/src/librustc/metadata/csearch.rs +++ b/src/librustc/metadata/csearch.rs @@ -246,13 +246,13 @@ pub fn get_field_type<'tcx>(tcx: &ty::ctxt<'tcx>, 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() }); diff --git a/src/librustc/metadata/encoder.rs b/src/librustc/metadata/encoder.rs index b19501229aa..a13df5a220f 100644 --- a/src/librustc/metadata/encoder.rs +++ b/src/librustc/metadata/encoder.rs @@ -845,7 +845,7 @@ fn encode_info_for_method<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>, parent_id: NodeId, ast_item_opt: Option<&ast::ImplItem>) { - debug!("encode_info_for_method: {} {}", m.def_id, + debug!("encode_info_for_method: {:?} {:?}", m.def_id, token::get_name(m.name)); rbml_w.start_tag(tag_items_data_item); @@ -887,7 +887,7 @@ fn encode_info_for_associated_type(ecx: &EncodeContext, impl_path: PathElems, parent_id: NodeId, typedef_opt: Option<P<ast::Typedef>>) { - debug!("encode_info_for_associated_type({},{})", + debug!("encode_info_for_associated_type({:?},{:?})", associated_type.def_id, token::get_name(associated_type.name)); diff --git a/src/librustc/metadata/tydecode.rs b/src/librustc/metadata/tydecode.rs index 01b058b5d1b..a4304bf1e2d 100644 --- a/src/librustc/metadata/tydecode.rs +++ b/src/librustc/metadata/tydecode.rs @@ -738,12 +738,12 @@ pub fn parse_def_id(buf: &[u8]) -> ast::DefId { let crate_num = match str::from_utf8(crate_part).ok().and_then(|s| s.parse::<uint>()) { Some(cn) => cn as ast::CrateNum, - None => panic!("internal error: parse_def_id: crate number expected, found {}", + None => panic!("internal error: parse_def_id: crate number expected, found {:?}", crate_part) }; let def_num = match str::from_utf8(def_part).ok().and_then(|s| s.parse::<uint>()) { Some(dn) => dn as ast::NodeId, - None => panic!("internal error: parse_def_id: id expected, found {}", + None => panic!("internal error: parse_def_id: id expected, found {:?}", def_part) }; ast::DefId { krate: crate_num, node: def_num } diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs index 7f11317a4b9..39e15832bb7 100644 --- a/src/librustc/middle/astencode.rs +++ b/src/librustc/middle/astencode.rs @@ -82,7 +82,7 @@ pub fn encode_inlined_item(ecx: &e::EncodeContext, e::IIImplItemRef(_, &ast::MethodImplItem(ref m)) => m.id, e::IIImplItemRef(_, &ast::TypeImplItem(ref ti)) => ti.id, }; - debug!("> Encoding inlined item: {} ({})", + debug!("> Encoding inlined item: {} ({:?})", ecx.tcx.map.path_to_string(id), rbml_w.writer.tell()); @@ -96,7 +96,7 @@ pub fn encode_inlined_item(ecx: &e::EncodeContext, encode_side_tables_for_ii(ecx, rbml_w, &ii); rbml_w.end_tag(); - debug!("< Encoded inlined fn: {} ({})", + debug!("< Encoded inlined fn: {} ({:?})", ecx.tcx.map.path_to_string(id), rbml_w.writer.tell()); } @@ -127,7 +127,7 @@ pub fn decode_inlined_item<'tcx>(cdata: &cstore::crate_metadata, None => Err(path), Some(ast_doc) => { let mut path_as_str = None; - debug!("> Decoding inlined fn: {}::?", + debug!("> Decoding inlined fn: {:?}::?", { // Do an Option dance to use the path after it is moved below. let s = ast_map::path_to_string(ast_map::Values(path.iter())); @@ -1880,7 +1880,7 @@ impl<'a, 'tcx> rbml_decoder_decoder_helpers<'tcx> for reader::Decoder<'a> { NominalType | TypeWithId | RegionParameter => dcx.tr_def_id(did), TypeParameter | UnboxedClosureSource => 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; } } diff --git a/src/librustc/middle/cfg/construct.rs b/src/librustc/middle/cfg/construct.rs index 2f0e3aeee9b..de3ce9f115e 100644 --- a/src/librustc/middle/cfg/construct.rs +++ b/src/librustc/middle/cfg/construct.rs @@ -480,12 +480,12 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> { 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); @@ -622,7 +622,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> { 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).index(&FullRange)); } } diff --git a/src/librustc/middle/check_const.rs b/src/librustc/middle/check_const.rs index ac53bdbefcf..621d7274b3f 100644 --- a/src/librustc/middle/check_const.rs +++ b/src/librustc/middle/check_const.rs @@ -118,7 +118,7 @@ fn check_expr(v: &mut CheckCrateVisitor, e: &ast::Expr) { DefStruct(_) | DefVariant(_, _, _) => {} 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"); diff --git a/src/librustc/middle/check_match.rs b/src/librustc/middle/check_match.rs index 5712ce3792e..f1edfb37273 100644 --- a/src/librustc/middle/check_match.rs +++ b/src/librustc/middle/check_match.rs @@ -574,7 +574,7 @@ fn is_useful(cx: &MatchCheckCtxt, witness: WitnessPreference) -> Usefulness { let &Matrix(ref rows) = matrix; - debug!("{:}", matrix); + debug!("{:?}", matrix); if rows.len() == 0u { return match witness { ConstructWitness => UsefulWithWitness(vec!()), @@ -1042,7 +1042,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).index(&FullRange)); } diff --git a/src/librustc/middle/check_rvalues.rs b/src/librustc/middle/check_rvalues.rs index c383b1579ef..5ff1f36f0e0 100644 --- a/src/librustc/middle/check_rvalues.rs +++ b/src/librustc/middle/check_rvalues.rs @@ -59,7 +59,7 @@ impl<'a, 'tcx> euv::Delegate<'tcx> for RvalueContextDelegate<'a, 'tcx> { span: Span, cmt: mc::cmt<'tcx>, _: 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.param_env, span, cmt.ty) { span_err!(self.tcx.sess, span, E0161, "cannot move a value of type {0}: the size of {0} cannot be statically determined", diff --git a/src/librustc/middle/dataflow.rs b/src/librustc/middle/dataflow.rs index 49ae1bce193..bdd98a94fc3 100644 --- a/src/librustc/middle/dataflow.rs +++ b/src/librustc/middle/dataflow.rs @@ -196,7 +196,7 @@ impl<'a, 'tcx, O:DataFlowOperator> DataFlowContext<'a, 'tcx, O> { 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: {}, id_range={}, \ + debug!("DataFlowContext::new(analysis_name: {}, id_range={:?}, \ bits_per_id={}, words_per_id={}) \ num_nodes: {}", analysis_name, id_range, bits_per_id, words_per_id, @@ -251,7 +251,7 @@ impl<'a, 'tcx, O:DataFlowOperator> DataFlowContext<'a, 'tcx, O> { fn apply_gen_kill(&self, cfgidx: CFGIndex, bits: &mut [uint]) { //! Applies the gen and kill sets for `cfgidx` to `bits` - debug!("{} apply_gen_kill(cfgidx={}, bits={}) [before]", + debug!("{} apply_gen_kill(cfgidx={:?}, bits={}) [before]", self.analysis_name, cfgidx, mut_bits_to_string(bits)); assert!(self.bits_per_id > 0); @@ -261,7 +261,7 @@ impl<'a, 'tcx, O:DataFlowOperator> DataFlowContext<'a, 'tcx, O> { let kills = self.kills.slice(start, end); bitwise(bits, kills, &Subtract); - debug!("{} apply_gen_kill(cfgidx={}, bits={}) [after]", + debug!("{} apply_gen_kill(cfgidx={:?}, bits={}) [after]", self.analysis_name, cfgidx, mut_bits_to_string(bits)); } @@ -315,7 +315,7 @@ impl<'a, 'tcx, O:DataFlowOperator> DataFlowContext<'a, 'tcx, O> { temp_bits.index(&FullRange) } }; - debug!("{} each_bit_for_node({}, cfgidx={}) bits={}", + debug!("{} each_bit_for_node({:?}, cfgidx={:?}) bits={}", self.analysis_name, e, cfgidx, bits_to_string(slice)); self.each_bit(slice, f) } @@ -410,7 +410,7 @@ impl<'a, 'tcx, O:DataFlowOperator> DataFlowContext<'a, 'tcx, O> { } } None => { - debug!("{} add_kills_from_flow_exits flow_exit={} \ + debug!("{} add_kills_from_flow_exits flow_exit={:?} \ no cfg_idx for exiting_scope={}", self.analysis_name, flow_exit, node_id); } @@ -419,10 +419,10 @@ impl<'a, 'tcx, O:DataFlowOperator> DataFlowContext<'a, 'tcx, O> { if changed { let bits = self.kills.slice_mut(start, end); - debug!("{} add_kills_from_flow_exits flow_exit={} bits={} [before]", + debug!("{} add_kills_from_flow_exits flow_exit={:?} bits={} [before]", self.analysis_name, flow_exit, mut_bits_to_string(bits)); bits.clone_from_slice(orig_kills.index(&FullRange)); - debug!("{} add_kills_from_flow_exits flow_exit={} bits={} [after]", + debug!("{} add_kills_from_flow_exits flow_exit={:?} bits={} [after]", self.analysis_name, flow_exit, mut_bits_to_string(bits)); } true @@ -481,7 +481,7 @@ impl<'a, 'b, 'tcx, O:DataFlowOperator> PropagationContext<'a, 'b, 'tcx, O> { assert!(self.dfcx.bits_per_id > 0); cfg.graph.each_node(|node_index, node| { - debug!("DataFlowContext::walk_cfg idx={} id={} begin in_out={}", + debug!("DataFlowContext::walk_cfg idx={:?} id={} begin in_out={}", node_index, node.data.id, bits_to_string(in_out)); let (start, end) = self.dfcx.compute_id_range(node_index); @@ -521,7 +521,7 @@ impl<'a, 'b, 'tcx, O:DataFlowOperator> PropagationContext<'a, 'b, 'tcx, O> { edge: &cfg::CFGEdge) { let source = edge.source(); let cfgidx = edge.target(); - debug!("{} propagate_bits_into_entry_set_for(pred_bits={}, {} to {})", + debug!("{} propagate_bits_into_entry_set_for(pred_bits={}, {:?} to {:?})", self.dfcx.analysis_name, bits_to_string(pred_bits), source, cfgidx); assert!(self.dfcx.bits_per_id > 0); @@ -532,7 +532,7 @@ impl<'a, 'b, 'tcx, O:DataFlowOperator> PropagationContext<'a, 'b, 'tcx, O> { bitwise(on_entry, pred_bits, &self.dfcx.oper) }; if changed { - debug!("{} changed entry set for {} to {}", + debug!("{} changed entry set for {:?} to {}", self.dfcx.analysis_name, cfgidx, bits_to_string(self.dfcx.on_entry.slice(start, end))); self.changed = true; diff --git a/src/librustc/middle/dependency_format.rs b/src/librustc/middle/dependency_format.rs index 8182dec2db0..0bc899a8a62 100644 --- a/src/librustc/middle/dependency_format.rs +++ b/src/librustc/middle/dependency_format.rs @@ -149,7 +149,7 @@ fn calculate_type(sess: &session::Session, add_library(sess, cnum, cstore::RequireDynamic, &mut formats); let deps = csearch::get_dylib_dependency_formats(&sess.cstore, cnum); for &(depnum, style) in deps.iter() { - debug!("adding {}: {}", style, + debug!("adding {:?}: {}", style, sess.cstore.get_crate_data(depnum).name.clone()); add_library(sess, depnum, style, &mut formats); } diff --git a/src/librustc/middle/expr_use_visitor.rs b/src/librustc/middle/expr_use_visitor.rs index 1f89121488e..046271613ca 100644 --- a/src/librustc/middle/expr_use_visitor.rs +++ b/src/librustc/middle/expr_use_visitor.rs @@ -1019,7 +1019,7 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> { if pat_util::pat_is_binding(def_map, pat) { let tcx = typer.tcx(); - debug!("binding cmt_pat={} pat={} match_mode={}", + debug!("binding cmt_pat={} pat={} match_mode={:?}", cmt_pat.repr(tcx), pat.repr(tcx), match_mode); @@ -1155,7 +1155,7 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> { // pattern. if !tcx.sess.has_errors() { - let msg = format!("Pattern has unexpected type: {} and type {}", + let msg = format!("Pattern has unexpected type: {:?} and type {}", def, cmt_pat.ty.repr(tcx)); tcx.sess.span_bug(pat.span, msg.as_slice()) @@ -1172,7 +1172,7 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> { // reported. if !tcx.sess.has_errors() { - let msg = format!("Pattern has unexpected def: {} and type {}", + let msg = format!("Pattern has unexpected def: {:?} and type {}", def, cmt_pat.ty.repr(tcx)); tcx.sess.span_bug(pat.span, msg.index(&FullRange)) diff --git a/src/librustc/middle/graph.rs b/src/librustc/middle/graph.rs index 52b6af76081..26cafb3c3d4 100644 --- a/src/librustc/middle/graph.rs +++ b/src/librustc/middle/graph.rs @@ -55,7 +55,7 @@ pub struct Edge<E> { impl<E: Show> Show for Edge<E> { fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { - write!(f, "Edge {{ next_edge: [{}, {}], source: {}, target: {}, data: {} }}", + write!(f, "Edge {{ next_edge: [{:?}, {:?}], source: {:?}, target: {:?}, data: {:?} }}", self.next_edge[0], self.next_edge[1], self.source, self.target, self.data) } diff --git a/src/librustc/middle/infer/coercion.rs b/src/librustc/middle/infer/coercion.rs index 65de3a083d2..9f87e73d4af 100644 --- a/src/librustc/middle/infer/coercion.rs +++ b/src/librustc/middle/infer/coercion.rs @@ -265,7 +265,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> { 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, @@ -288,7 +288,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> { 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, @@ -306,7 +306,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> { let ty = ty::mk_uniq(self.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)) @@ -328,7 +328,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> { a: Ty<'tcx>, ty_b: Ty<'tcx>) -> Option<(Ty<'tcx>, ty::UnsizeKind<'tcx>)> { - debug!("unsize_ty(a={}, ty_b={})", a, ty_b.repr(self.tcx())); + debug!("unsize_ty(a={:?}, ty_b={})", a, ty_b.repr(self.tcx())); let tcx = self.tcx(); @@ -406,7 +406,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> { { let tcx = self.tcx(); - debug!("coerce_borrowed_object(a={}, b={}, b_mutbl={})", + debug!("coerce_borrowed_object(a={}, b={}, b_mutbl={:?})", a.repr(tcx), b.repr(tcx), b_mutbl); @@ -426,7 +426,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> { { let tcx = self.tcx(); - debug!("coerce_unsafe_object(a={}, b={}, b_mutbl={})", + debug!("coerce_unsafe_object(a={}, b={}, b_mutbl={:?})", a.repr(tcx), b.repr(tcx), b_mutbl); @@ -449,7 +449,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> { match a.sty { ty::ty_rptr(_, ty::mt{ty, mutbl}) => match ty.sty { ty::ty_trait(box ty::TyTrait { ref principal, ref bounds }) => { - debug!("mutbl={} b_mutbl={}", mutbl, b_mutbl); + debug!("mutbl={:?} b_mutbl={:?}", mutbl, b_mutbl); let tr = ty::mk_trait(tcx, principal.clone(), bounds.clone()); try!(self.subtype(mk_ty(tr), b)); Ok(Some(AdjustDerefRef(AutoDerefRef { diff --git a/src/librustc/middle/infer/combine.rs b/src/librustc/middle/infer/combine.rs index 9122359bb9e..22975f54a9f 100644 --- a/src/librustc/middle/infer/combine.rs +++ b/src/librustc/middle/infer/combine.rs @@ -361,7 +361,7 @@ pub trait Combine<'tcx> : Sized { a: ty::TraitStore, b: ty::TraitStore) -> cres<'tcx, ty::TraitStore> { - debug!("{}.trait_stores(a={}, b={})", self.tag(), a, b); + debug!("{}.trait_stores(a={:?}, b={:?})", self.tag(), a, b); match (a, b) { (ty::RegionTraitStore(a_r, a_m), @@ -471,7 +471,7 @@ pub fn super_tys<'tcx, C: Combine<'tcx>>(this: &C, let tcx = this.infcx().tcx; let a_sty = &a.sty; let b_sty = &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 var: (&ty::ty_infer(TyVar(_)), _) | @@ -550,7 +550,7 @@ pub fn super_tys<'tcx, C: Combine<'tcx>>(this: &C, (&ty::ty_trait(ref a_), &ty::ty_trait(ref b_)) => { - debug!("Trying to match traits {} and {}", a, b); + debug!("Trying to match traits {:?} and {:?}", a, b); let principal = try!(this.binders(&a_.principal, &b_.principal)); let bounds = try!(this.existential_bounds(&a_.bounds, &b_.bounds)); Ok(ty::mk_trait(tcx, principal, bounds)) @@ -724,7 +724,7 @@ impl<'f, 'tcx> CombineFields<'f, 'tcx> { Some(e) => e, }; - debug!("instantiate(a_ty={} dir={} b_vid={})", + debug!("instantiate(a_ty={} dir={:?} b_vid={})", a_ty.repr(tcx), dir, b_vid.repr(tcx)); @@ -745,7 +745,7 @@ impl<'f, 'tcx> CombineFields<'f, 'tcx> { self.generalize(a_ty, b_vid, true) } }); - debug!("instantiate(a_ty={}, dir={}, \ + debug!("instantiate(a_ty={}, dir={:?}, \ b_vid={}, generalized_ty={})", a_ty.repr(tcx), dir, b_vid.repr(tcx), generalized_ty.repr(tcx)); diff --git a/src/librustc/middle/infer/error_reporting.rs b/src/librustc/middle/infer/error_reporting.rs index 1566a7938d3..64b3c14ff69 100644 --- a/src/librustc/middle/infer/error_reporting.rs +++ b/src/librustc/middle/infer/error_reporting.rs @@ -268,7 +268,7 @@ impl<'a, 'tcx> ErrorReporting<'tcx> for InferCtxt<'a, 'tcx> { } } 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 @@ impl<'a, 'tcx> ErrorReporting<'tcx> for InferCtxt<'a, 'tcx> { 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 != fr2.scope { diff --git a/src/librustc/middle/infer/higher_ranked/mod.rs b/src/librustc/middle/infer/higher_ranked/mod.rs index cd4705d4fb2..073052dd368 100644 --- a/src/librustc/middle/infer/higher_ranked/mod.rs +++ b/src/librustc/middle/infer/higher_ranked/mod.rs @@ -154,7 +154,7 @@ impl<'tcx,C> HigherRankedRelations<'tcx> for C // 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; } @@ -164,8 +164,8 @@ impl<'tcx,C> HigherRankedRelations<'tcx> for C // *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; @@ -178,8 +178,8 @@ impl<'tcx,C> HigherRankedRelations<'tcx> for C // 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(debruijn, *a_br); } @@ -187,7 +187,7 @@ impl<'tcx,C> HigherRankedRelations<'tcx> for C infcx.tcx.sess.span_bug( span, - format!("region {} is not associated with \ + format!("region {:?} is not associated with \ any bound region from A!", r0).index(&FullRange)) } @@ -322,7 +322,7 @@ impl<'tcx,C> HigherRankedRelations<'tcx> for C } infcx.tcx.sess.span_bug( span, - format!("could not find original bound region for {}", r).index(&FullRange)); + format!("could not find original bound region for {:?}", r).index(&FullRange)); } fn fresh_bound_variable(infcx: &InferCtxt, debruijn: ty::DebruijnIndex) -> ty::Region { @@ -339,7 +339,7 @@ fn var_ids<'tcx, T: Combine<'tcx>>(combiner: &T, r => { combiner.infcx().tcx.sess.span_bug( combiner.trace().origin.span(), - format!("found non-region-vid: {}", r).index(&FullRange)); + format!("found non-region-vid: {:?}", r).index(&FullRange)); } }).collect() } diff --git a/src/librustc/middle/infer/mod.rs b/src/librustc/middle/infer/mod.rs index a3d94e8b844..3f18af3d768 100644 --- a/src/librustc/middle/infer/mod.rs +++ b/src/librustc/middle/infer/mod.rs @@ -989,7 +989,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { err: Option<&ty::type_err<'tcx>>) where M: FnOnce(Option<String>, String) -> String, { - debug!("hi! expected_ty = {}, actual_ty = {}", expected_ty, actual_ty); + debug!("hi! expected_ty = {:?}, actual_ty = {}", expected_ty, actual_ty); let resolved_expected = expected_ty.map(|e_ty| self.resolve_type_vars_if_possible(&e_ty)); @@ -1219,7 +1219,7 @@ impl<'tcx> Repr<'tcx> for SubregionOrigin<'tcx> { } 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)) @@ -1277,7 +1277,7 @@ impl<'tcx> Repr<'tcx> for RegionVariableOrigin<'tcx> { format!("EarlyBoundRegion({},{})", a.repr(tcx), b.repr(tcx)) } LateBoundRegion(a, b, c) => { - format!("LateBoundRegion({},{},{})", a.repr(tcx), b.repr(tcx), c) + format!("LateBoundRegion({},{},{:?})", a.repr(tcx), b.repr(tcx), c) } BoundRegionInCoherence(a) => { format!("bound_regionInCoherence({})", a.repr(tcx)) diff --git a/src/librustc/middle/infer/region_inference/graphviz.rs b/src/librustc/middle/infer/region_inference/graphviz.rs index 98c69962bc2..16169610b52 100644 --- a/src/librustc/middle/infer/region_inference/graphviz.rs +++ b/src/librustc/middle/infer/region_inference/graphviz.rs @@ -67,7 +67,7 @@ pub fn maybe_print_constraints_for<'a, 'tcx>(region_vars: &RegionVarBindings<'a, } let requested_output = os::getenv("RUST_REGION_GRAPH"); - debug!("requested_output: {} requested_node: {}", + debug!("requested_output: {:?} requested_node: {:?}", requested_output, requested_node); let output_path = { @@ -166,7 +166,7 @@ impl<'a, 'tcx> dot::Labeller<'a, Node, Edge> for ConstraintGraph<'a, 'tcx> { fn node_label(&self, n: &Node) -> dot::LabelText { match *n { Node::RegionVid(n_vid) => - dot::LabelText::label(format!("{}", n_vid)), + dot::LabelText::label(format!("{:?}", n_vid)), Node::Region(n_rgn) => dot::LabelText::label(format!("{}", n_rgn.repr(self.tcx))), } @@ -204,12 +204,12 @@ impl<'a, 'tcx> dot::GraphWalk<'a, Node, Edge> for ConstraintGraph<'a, 'tcx> { } fn source(&self, edge: &Edge) -> Node { let (n1, _) = constraint_to_nodes(edge); - debug!("edge {} has source {}", edge, n1); + debug!("edge {:?} has source {:?}", edge, n1); n1 } fn target(&self, edge: &Edge) -> Node { let (_, n2) = constraint_to_nodes(edge); - debug!("edge {} has target {}", edge, n2); + debug!("edge {:?} has target {:?}", edge, n2); n2 } } diff --git a/src/librustc/middle/infer/region_inference/mod.rs b/src/librustc/middle/infer/region_inference/mod.rs index ea5d8456117..bdc787e4d58 100644 --- a/src/librustc/middle/infer/region_inference/mod.rs +++ b/src/librustc/middle/infer/region_inference/mod.rs @@ -273,7 +273,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { } pub fn rollback_to(&self, snapshot: RegionSnapshot) { - debug!("RegionVarBindings: rollback_to({})", snapshot); + debug!("RegionVarBindings: rollback_to({:?})", snapshot); let mut undo_log = self.undo_log.borrow_mut(); assert!(undo_log.len() > snapshot.length); assert!((*undo_log)[snapshot.length] == OpenSnapshot); @@ -325,7 +325,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { if self.in_snapshot() { self.undo_log.borrow_mut().push(AddVar(vid)); } - debug!("created new region variable {} with origin {}", + debug!("created new region variable {:?} with origin {}", vid, origin.repr(self.tcx)); return vid; } @@ -427,7 +427,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { let mut givens = self.givens.borrow_mut(); if givens.insert((sub, sup)) { - debug!("add_given({} <= {})", + debug!("add_given({} <= {:?})", sub.repr(self.tcx), sup); @@ -565,7 +565,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { } Some(ref values) => { let r = lookup(values, rid); - debug!("resolve_var({}) = {}", rid, r.repr(self.tcx)); + debug!("resolve_var({:?}) = {}", rid, r.repr(self.tcx)); r } } @@ -602,7 +602,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { } relate(self, a, ReInfer(ReVar(c))); relate(self, b, ReInfer(ReVar(c))); - debug!("combine_vars() c={}", c); + debug!("combine_vars() c={:?}", c); ReInfer(ReVar(c)) } @@ -623,7 +623,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { /// made---`r0` itself will be the first entry. This is used when checking whether skolemized /// regions are being improperly related to other regions. pub fn tainted(&self, mark: &RegionSnapshot, r0: Region) -> Vec<Region> { - debug!("tainted(mark={}, r0={})", mark, r0.repr(self.tcx)); + debug!("tainted(mark={:?}, r0={})", mark, r0.repr(self.tcx)); let _indenter = indenter(); // `result_set` acts as a worklist: we explore all outgoing @@ -634,7 +634,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { while result_index < result_set.len() { // nb: can't use uint::range() here because result_set grows let r = result_set[result_index]; - debug!("result_index={}, r={}", result_index, r); + debug!("result_index={}, r={:?}", result_index, r); for undo_entry in self.undo_log.borrow().slice_from(mark.length).iter() @@ -751,7 +751,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { self.tcx.sess.span_bug( (*self.var_origins.borrow())[v_id.index as uint].span(), format!("lub_concrete_regions invoked with \ - non-concrete regions: {}, {}", + non-concrete regions: {:?}, {:?}", a, b).index(&FullRange)); } @@ -827,7 +827,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { a: Region, b: Region) -> cres<'tcx, Region> { - debug!("glb_concrete_regions({}, {})", a, b); + debug!("glb_concrete_regions({:?}, {:?})", a, b); match (a, b) { (ReLateBound(..), _) | (_, ReLateBound(..)) | @@ -854,7 +854,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { self.tcx.sess.span_bug( (*self.var_origins.borrow())[v_id.index as uint].span(), format!("glb_concrete_regions invoked with \ - non-concrete regions: {}, {}", + non-concrete regions: {:?}, {:?}", a, b).index(&FullRange)); } @@ -932,7 +932,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { // scopes or two free regions. So, if one of // these scopes is a subscope of the other, return // it. Otherwise fail. - debug!("intersect_scopes(scope_a={}, scope_b={}, region_a={}, region_b={})", + debug!("intersect_scopes(scope_a={:?}, scope_b={:?}, region_a={:?}, region_b={:?})", scope_a, scope_b, region_a, region_b); match self.tcx.region_maps.nearest_common_ancestor(scope_a, scope_b) { Some(r_id) if scope_a == r_id => Ok(ReScope(scope_b)), @@ -971,7 +971,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { // Dorky hack to cause `dump_constraints` to only get called // if debug mode is enabled: - debug!("----() End constraint listing {}---", self.dump_constraints()); + debug!("----() End constraint listing {:?}---", self.dump_constraints()); graphviz::maybe_print_constraints_for(self, subject); self.expansion(var_data.as_mut_slice()); @@ -1039,7 +1039,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { b_data: &mut VarData) -> bool { - debug!("expand_node({}, {} == {})", + debug!("expand_node({}, {:?} == {})", a_region.repr(self.tcx), b_vid, b_data.value.repr(self.tcx)); @@ -1058,7 +1058,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { b_data.classification = Expanding; match b_data.value { NoValue => { - debug!("Setting initial value of {} to {}", + debug!("Setting initial value of {:?} to {}", b_vid, a_region.repr(self.tcx)); b_data.value = Value(a_region); @@ -1071,7 +1071,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { return false; } - debug!("Expanding value of {} from {} to {}", + debug!("Expanding value of {:?} from {} to {}", b_vid, cur_region.repr(self.tcx), lub.repr(self.tcx)); @@ -1122,7 +1122,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { a_data: &mut VarData, b_region: Region) -> bool { - debug!("contract_node({} == {}/{}, {})", + debug!("contract_node({:?} == {}/{:?}, {})", a_vid, a_data.value.repr(self.tcx), a_data.classification, b_region.repr(self.tcx)); @@ -1156,7 +1156,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { b_region: Region) -> bool { if !this.is_subregion_of(a_region, b_region) { - debug!("Setting {} to ErrorValue: {} not subregion of {}", + debug!("Setting {:?} to ErrorValue: {} not subregion of {}", a_vid, a_region.repr(this.tcx), b_region.repr(this.tcx)); @@ -1176,7 +1176,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { if glb == a_region { false } else { - debug!("Contracting value of {} from {} to {}", + debug!("Contracting value of {:?} from {} to {}", a_vid, a_region.repr(this.tcx), glb.repr(this.tcx)); @@ -1185,7 +1185,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { } } Err(_) => { - debug!("Setting {} to ErrorValue: no glb of {}, {}", + debug!("Setting {:?} to ErrorValue: no glb of {}, {}", a_vid, a_region.repr(this.tcx), b_region.repr(this.tcx)); @@ -1412,7 +1412,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { self.tcx.sess.span_bug( (*self.var_origins.borrow())[node_idx.index as uint].span(), format!("collect_error_for_expanding_node() could not find error \ - for var {}, lower_bounds={}, upper_bounds={}", + for var {:?}, lower_bounds={}, upper_bounds={}", node_idx, lower_bounds.repr(self.tcx), upper_bounds.repr(self.tcx)).index(&FullRange)); @@ -1457,7 +1457,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { self.tcx.sess.span_bug( (*self.var_origins.borrow())[node_idx.index as uint].span(), format!("collect_error_for_contracting_node() could not find error \ - for var {}, upper_bounds={}", + for var {:?}, upper_bounds={}", node_idx, upper_bounds.repr(self.tcx)).index(&FullRange)); } @@ -1498,8 +1498,8 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { state.dup_found = true; } - debug!("collect_concrete_regions(orig_node_idx={}, node_idx={}, \ - classification={})", + debug!("collect_concrete_regions(orig_node_idx={:?}, node_idx={:?}, \ + classification={:?})", orig_node_idx, node_idx, classification); // figure out the direction from which this node takes its @@ -1520,7 +1520,7 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> { graph: &RegionGraph, source_vid: RegionVid, dir: Direction) { - debug!("process_edges(source_vid={}, dir={})", source_vid, dir); + debug!("process_edges(source_vid={:?}, dir={:?})", source_vid, dir); let source_node_index = NodeIndex(source_vid.index as uint); graph.each_adjacent_edge(source_node_index, dir, |_, edge| { diff --git a/src/librustc/middle/infer/type_variable.rs b/src/librustc/middle/infer/type_variable.rs index 2aacc863f54..3f3e4c50e70 100644 --- a/src/librustc/middle/infer/type_variable.rs +++ b/src/librustc/middle/infer/type_variable.rs @@ -184,7 +184,7 @@ impl<'tcx> TypeVariableTable<'tcx> { let escaping_type = self.probe(vid).unwrap(); escaping_types.push(escaping_type); } - debug!("SpecifyVar({}) new_elem_threshold={}", vid, new_elem_threshold); + debug!("SpecifyVar({:?}) new_elem_threshold={}", vid, new_elem_threshold); } _ => { } diff --git a/src/librustc/middle/infer/unify.rs b/src/librustc/middle/infer/unify.rs index 73da9644593..2d70e2cdc4d 100644 --- a/src/librustc/middle/infer/unify.rs +++ b/src/librustc/middle/infer/unify.rs @@ -129,7 +129,7 @@ impl<'tcx, V:PartialEq+Clone+Repr<'tcx>, K:UnifyKey<'tcx, V>> UnificationTable<K pub fn new_key(&mut self, value: V) -> K { let index = self.values.push(Root(value, 0)); let k = UnifyKey::from_index(index); - debug!("{}: created new key: {}", + debug!("{}: created new key: {:?}", UnifyKey::tag(None::<K>), k); k diff --git a/src/librustc/middle/intrinsicck.rs b/src/librustc/middle/intrinsicck.rs index a83416667ab..41f293cfca5 100644 --- a/src/librustc/middle/intrinsicck.rs +++ b/src/librustc/middle/intrinsicck.rs @@ -209,7 +209,7 @@ impl<'a, 'tcx> IntrinsicCheckingVisitor<'a, 'tcx> { } Some((space, index, ¶m_ty)) => { - debug!("with_each_combination: space={}, index={}, param_ty={}", + debug!("with_each_combination: space={:?}, index={}, param_ty={}", space, index, param_ty.repr(self.tcx)); if !ty::type_is_sized(param_env, span, param_ty) { diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index 24cfe511230..dab8faa3f78 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -289,7 +289,7 @@ impl<'a, 'tcx> IrMaps<'a, 'tcx> { self.lnks.push(lnk); self.num_live_nodes += 1; - debug!("{} is of kind {}", ln.to_string(), + debug!("{:?} is of kind {}", ln, live_node_kind_to_string(lnk, self.tcx)); ln @@ -299,7 +299,7 @@ impl<'a, 'tcx> IrMaps<'a, 'tcx> { let ln = self.add_live_node(lnk); self.live_node_map.insert(node_id, ln); - debug!("{} is node {}", ln.to_string(), node_id); + debug!("{:?} is node {}", ln, node_id); } fn add_variable(&mut self, vk: VarKind) -> Variable { @@ -314,7 +314,7 @@ impl<'a, 'tcx> IrMaps<'a, 'tcx> { ImplicitRet | CleanExit => {} } - debug!("{} is {}", v.to_string(), vk); + debug!("{:?} is {:?}", v, vk); v } @@ -377,7 +377,7 @@ fn visit_fn(ir: &mut IrMaps, // swap in a new set of IR maps for this function body: let mut fn_maps = IrMaps::new(ir.tcx); - debug!("creating fn_maps: {}", &fn_maps as *const IrMaps); + debug!("creating fn_maps: {:?}", &fn_maps as *const IrMaps); for arg in decl.inputs.iter() { pat_util::pat_bindings(&ir.tcx.def_map, @@ -430,7 +430,7 @@ fn visit_local(ir: &mut IrMaps, local: &ast::Local) { fn visit_arm(ir: &mut IrMaps, arm: &ast::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)); @@ -448,7 +448,7 @@ fn visit_expr(ir: &mut IrMaps, expr: &Expr) { // live nodes required for uses or definitions of variables: ast::ExprPath(_) => { let def = ir.tcx.def_map.borrow()[expr.id].clone(); - debug!("expr {}: path that leads to {}", expr.id, def); + debug!("expr {}: path that leads to {:?}", expr.id, def); if let DefLocal(..) = def { ir.add_live_node_for_node(expr.id, ExprNode(expr.span)); } @@ -491,7 +491,7 @@ fn visit_expr(ir: &mut IrMaps, expr: &Expr) { } ast::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)); @@ -702,7 +702,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> { for var_idx in range(0u, self.ir.num_vars) { let idx = node_base_idx + var_idx; if test(idx).is_valid() { - try!(write!(wr, " {}", Variable(var_idx).to_string())); + try!(write!(wr, " {:?}", Variable(var_idx))); } } Ok(()) @@ -740,11 +740,11 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> { let mut wr = Vec::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[idx].reader); write!(wr, " writes"); self.write_vars(wr, ln, |idx| self.users[idx].writer); - write!(wr, " precedes {}]", self.successors[ln.get()].to_string()); + write!(wr, " precedes {:?}]", self.successors[ln.get()]); } String::from_utf8(wr).unwrap() } @@ -792,8 +792,8 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> { } }); - debug!("merge_from_succ(ln={}, succ={}, first_merge={}, changed={})", - ln.to_string(), self.ln_str(succ_ln), first_merge, changed); + debug!("merge_from_succ(ln={:?}, succ={}, first_merge={}, changed={})", + ln, self.ln_str(succ_ln), first_merge, changed); return changed; fn copy_if_invalid(src: LiveNode, dst: &mut LiveNode) -> bool { @@ -814,14 +814,14 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> { self.users[idx].reader = invalid_node(); self.users[idx].writer = invalid_node(); - debug!("{} defines {} (idx={}): {}", writer.to_string(), var.to_string(), + debug!("{:?} defines {:?} (idx={}): {}", writer, var, idx, self.ln_str(writer)); } // Either read, write, or both depending on the acc bitset fn acc(&mut self, ln: LiveNode, var: Variable, acc: uint) { - debug!("{} accesses[{:x}] {}: {}", - ln.to_string(), acc, var.to_string(), self.ln_str(ln)); + debug!("{:?} accesses[{:x}] {:?}: {}", + ln, acc, var, self.ln_str(ln)); let idx = self.idx(ln, var); let user = &mut self.users[idx]; @@ -857,14 +857,14 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> { |this| this.propagate_through_fn_block(decl, body)); // hack to skip the loop unless debug! is enabled: - debug!("^^ liveness computation results for body {} (entry={})", + debug!("^^ liveness computation results for body {} (entry={:?})", { for ln_idx in range(0u, self.ir.num_live_nodes) { - debug!("{}", self.ln_str(LiveNode(ln_idx))); + debug!("{:?}", self.ln_str(LiveNode(ln_idx))); } body.id }, - entry_ln.to_string()); + entry_ln); entry_ln } diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index 81d4d66a88e..c472ea4a814 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -539,7 +539,7 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> { expr_ty: Ty<'tcx>, def: def::Def) -> McResult<cmt<'tcx>> { - debug!("cat_def: id={} expr={} def={}", + debug!("cat_def: id={} expr={} def={:?}", id, expr_ty.repr(self.tcx()), def); match def { @@ -852,7 +852,7 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> { }; 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 { @@ -1447,7 +1447,7 @@ impl<'tcx> cmt_<'tcx> { impl<'tcx> Repr<'tcx> for cmt_<'tcx> { fn repr(&self, tcx: &ty::ctxt<'tcx>) -> String { - format!("{{{} id:{} m:{} ty:{}}}", + format!("{{{} id:{} m:{:?} ty:{}}}", self.cat.repr(tcx), self.id, self.mutbl, @@ -1462,7 +1462,7 @@ impl<'tcx> Repr<'tcx> for categorization<'tcx> { cat_rvalue(..) | cat_local(..) | cat_upvar(..) => { - format!("{}", *self) + format!("{:?}", *self) } cat_deref(ref cmt, derefs, ptr) => { format!("{}-{}{}->", cmt.cat.repr(tcx), ptr_sigil(ptr), derefs) diff --git a/src/librustc/middle/privacy.rs b/src/librustc/middle/privacy.rs index df545c7570a..861c4a2c85e 100644 --- a/src/librustc/middle/privacy.rs +++ b/src/librustc/middle/privacy.rs @@ -435,28 +435,28 @@ impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> { 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().get(&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 @@ -471,17 +471,17 @@ impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> { 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 @@ -696,7 +696,7 @@ impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> { let fields = ty::lookup_struct_fields(self.tcx, id); let field = match name { NamedField(ident) => { - debug!("privacy - check named field {} in struct {}", ident.name, id); + debug!("privacy - check named field {} in struct {:?}", ident.name, id); fields.iter().find(|f| f.name == ident.name).unwrap() } UnnamedField(idx) => &fields[idx] diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs index 5be092eb1bd..5d18843097f 100644 --- a/src/librustc/middle/region.rs +++ b/src/librustc/middle/region.rs @@ -146,24 +146,24 @@ impl RegionMaps { 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)); } pub fn record_encl_scope(&self, sub: CodeExtent, sup: CodeExtent) { - debug!("record_encl_scope(sub={}, sup={})", sub, sup); + debug!("record_encl_scope(sub={:?}, sup={:?})", sub, sup); assert!(sub != sup); self.scope_map.borrow_mut().insert(sub, sup); } pub fn record_var_scope(&self, var: ast::NodeId, lifetime: CodeExtent) { - debug!("record_var_scope(sub={}, sup={})", var, lifetime); + debug!("record_var_scope(sub={:?}, sup={:?})", var, lifetime); assert!(var != lifetime.node_id()); self.var_map.borrow_mut().insert(var, lifetime); } pub fn record_rvalue_scope(&self, var: ast::NodeId, lifetime: CodeExtent) { - debug!("record_rvalue_scope(sub={}, sup={})", var, lifetime); + debug!("record_rvalue_scope(sub={:?}, sup={:?})", var, lifetime); assert!(var != lifetime.node_id()); self.rvalue_scopes.borrow_mut().insert(var, lifetime); } @@ -172,7 +172,7 @@ impl RegionMaps { /// e.g. by an expression like `a().f` -- they will be freed within the innermost terminating /// scope. pub fn mark_as_terminating_scope(&self, scope_id: CodeExtent) { - debug!("record_terminating_scope(scope_id={})", scope_id); + debug!("record_terminating_scope(scope_id={:?})", scope_id); self.terminating_scopes.borrow_mut().insert(scope_id); } @@ -186,7 +186,7 @@ impl RegionMaps { //! Returns the narrowest scope that encloses `id`, if any. match self.scope_map.borrow().get(&id) { Some(&r) => r, - None => { panic!("no enclosing scope for id {}", id); } + None => { panic!("no enclosing scope for id {:?}", id); } } } @@ -194,7 +194,7 @@ impl RegionMaps { pub fn var_scope(&self, var_id: ast::NodeId) -> CodeExtent { match self.var_map.borrow().get(&var_id) { Some(&r) => r, - None => { panic!("no enclosing scope for id {}", var_id); } + None => { panic!("no enclosing scope for id {:?}", var_id); } } } @@ -204,7 +204,7 @@ impl RegionMaps { // check for a designated rvalue scope match self.rvalue_scopes.borrow().get(&expr_id) { Some(&s) => { - debug!("temporary_scope({}) = {} [custom]", expr_id, s); + debug!("temporary_scope({:?}) = {:?} [custom]", expr_id, s); return Some(s); } None => { } @@ -225,12 +225,12 @@ impl RegionMaps { id = p; } None => { - debug!("temporary_scope({}) = None", expr_id); + debug!("temporary_scope({:?}) = None", expr_id); return None; } } } - debug!("temporary_scope({}) = {} [enclosing]", expr_id, id); + debug!("temporary_scope({:?}) = {:?} [enclosing]", expr_id, id); return Some(id); } @@ -238,7 +238,7 @@ impl RegionMaps { //! 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 } @@ -258,7 +258,7 @@ impl RegionMaps { while superscope != s { match self.scope_map.borrow().get(&s) { None => { - debug!("is_subscope_of({}, {}, s={})=false", + debug!("is_subscope_of({:?}, {:?}, s={:?})=false", subscope, superscope, s); return false; @@ -267,7 +267,7 @@ impl RegionMaps { } } - debug!("is_subscope_of({}, {})=true", + debug!("is_subscope_of({:?}, {:?})=true", subscope, superscope); return true; @@ -287,7 +287,7 @@ impl RegionMaps { sub_region: ty::Region, super_region: ty::Region) -> bool { - debug!("is_subregion_of(sub_region={}, super_region={})", + debug!("is_subregion_of(sub_region={:?}, super_region={:?})", sub_region, super_region); sub_region == super_region || { @@ -365,7 +365,7 @@ impl RegionMaps { fn ancestors_of(this: &RegionMaps, scope: CodeExtent) -> Vec<CodeExtent> { - // debug!("ancestors_of(scope={})", scope); + // debug!("ancestors_of(scope={:?})", scope); let mut result = vec!(scope); let mut scope = scope; loop { @@ -376,7 +376,7 @@ impl RegionMaps { scope = superscope; } } - // debug!("ancestors_of_loop(scope={})", scope); + // debug!("ancestors_of_loop(scope={:?})", scope); } } } @@ -414,7 +414,7 @@ fn record_var_lifetime(visitor: &mut RegionResolutionVisitor, } fn resolve_block(visitor: &mut RegionResolutionVisitor, blk: &ast::Block) { - debug!("resolve_block(blk.id={})", blk.id); + debug!("resolve_block(blk.id={:?})", blk.id); // Record the parent of this block. record_superlifetime(visitor, blk.id, blk.span); @@ -466,7 +466,7 @@ fn resolve_pat(visitor: &mut RegionResolutionVisitor, pat: &ast::Pat) { fn resolve_stmt(visitor: &mut RegionResolutionVisitor, stmt: &ast::Stmt) { let stmt_id = stmt_id(stmt); - debug!("resolve_stmt(stmt.id={})", stmt_id); + debug!("resolve_stmt(stmt.id={:?})", stmt_id); let stmt_scope = CodeExtent::from_node_id(stmt_id); visitor.region_maps.mark_as_terminating_scope(stmt_scope); @@ -479,7 +479,7 @@ fn resolve_stmt(visitor: &mut RegionResolutionVisitor, stmt: &ast::Stmt) { } fn resolve_expr(visitor: &mut RegionResolutionVisitor, expr: &ast::Expr) { - debug!("resolve_expr(expr.id={})", expr.id); + debug!("resolve_expr(expr.id={:?})", expr.id); record_superlifetime(visitor, expr.id, expr.span); @@ -566,7 +566,7 @@ fn resolve_expr(visitor: &mut RegionResolutionVisitor, expr: &ast::Expr) { } fn resolve_local(visitor: &mut RegionResolutionVisitor, local: &ast::Local) { - debug!("resolve_local(local.id={},local.init={})", + debug!("resolve_local(local.id={:?},local.init={:?})", local.id,local.init.is_some()); let blk_id = match visitor.cx.var_parent { @@ -815,10 +815,10 @@ fn resolve_fn(visitor: &mut RegionResolutionVisitor, body: &ast::Block, sp: Span, id: ast::NodeId) { - debug!("region::resolve_fn(id={}, \ - span={}, \ - body.id={}, \ - cx.parent={})", + debug!("region::resolve_fn(id={:?}, \ + span={:?}, \ + body.id={:?}, \ + cx.parent={:?})", id, visitor.sess.codemap().span_to_string(sp), body.id, diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index 6cdbd9872bc..8e03d774b81 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -223,7 +223,7 @@ impl<'a, 'v> Visitor<'v> for LifetimeContext<'a> { fn visit_poly_trait_ref(&mut self, trait_ref: &ast::PolyTraitRef, _modifier: &ast::TraitBoundModifier) { - debug!("visit_poly_trait_ref trait_ref={}", trait_ref); + debug!("visit_poly_trait_ref trait_ref={:?}", trait_ref); self.with(LateScope(&trait_ref.bound_lifetimes, self.scope), |old_scope, this| { this.check_lifetime_defs(old_scope, &trait_ref.bound_lifetimes); @@ -250,9 +250,9 @@ impl<'a> LifetimeContext<'a> { scope: &wrap_scope, def_map: self.def_map, }; - debug!("entering scope {}", this.scope); + debug!("entering scope {:?}", this.scope); f(self.scope, &mut this); - debug!("exiting scope {}", this.scope); + debug!("exiting scope {:?}", this.scope); } /// Visits self by adding a scope and handling recursive walk over the contents with `walk`. @@ -281,7 +281,7 @@ impl<'a> LifetimeContext<'a> { { let referenced_idents = early_bound_lifetime_names(generics); - debug!("visit_early_late: referenced_idents={}", + debug!("visit_early_late: referenced_idents={:?}", referenced_idents); let (early, late): (Vec<_>, _) = generics.lifetimes.iter().cloned().partition( @@ -488,7 +488,7 @@ impl<'a> LifetimeContext<'a> { 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); @@ -605,9 +605,9 @@ fn early_bound_lifetime_names(generics: &ast::Generics) -> Vec<ast::Name> { impl<'a> fmt::Show for ScopeChain<'a> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { match *self { - EarlyScope(space, defs, _) => write!(fmt, "EarlyScope({}, {})", space, defs), - LateScope(defs, _) => write!(fmt, "LateScope({})", defs), - BlockScope(id, _) => write!(fmt, "BlockScope({})", id), + EarlyScope(space, defs, _) => write!(fmt, "EarlyScope({:?}, {:?})", space, defs), + LateScope(defs, _) => write!(fmt, "LateScope({:?})", defs), + BlockScope(id, _) => write!(fmt, "BlockScope({:?})", id), RootScope => write!(fmt, "RootScope"), } } diff --git a/src/librustc/middle/stability.rs b/src/librustc/middle/stability.rs index 362d5fedaa3..359ad8d3941 100644 --- a/src/librustc/middle/stability.rs +++ b/src/librustc/middle/stability.rs @@ -161,7 +161,7 @@ pub fn lookup(tcx: &ty::ctxt, id: DefId) -> Option<Stability> { // is this definition the implementation of a trait method? match ty::trait_item_of_item(tcx, id) { Some(ty::MethodTraitItemId(trait_method_id)) if trait_method_id != id => { - debug!("lookup: trait_method_id={}", trait_method_id); + debug!("lookup: trait_method_id={:?}", trait_method_id); return lookup(tcx, trait_method_id) } _ => {} @@ -182,7 +182,7 @@ pub fn lookup(tcx: &ty::ctxt, id: DefId) -> Option<Stability> { // stability of the trait to determine the stability of any // unmarked impls for it. See FIXME above for more details. - debug!("lookup: trait_id={}", trait_id); + debug!("lookup: trait_id={:?}", trait_id); lookup(tcx, trait_id) } else { None diff --git a/src/librustc/middle/subst.rs b/src/librustc/middle/subst.rs index a3973d58542..98bb0645bef 100644 --- a/src/librustc/middle/subst.rs +++ b/src/librustc/middle/subst.rs @@ -242,7 +242,7 @@ impl<T:fmt::Show> fmt::Show for VecPerParamSpace<T> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { try!(write!(fmt, "VecPerParamSpace {{")); for space in ParamSpace::all().iter() { - try!(write!(fmt, "{}: {}, ", *space, self.get_slice(*space))); + try!(write!(fmt, "{:?}: {:?}, ", *space, self.get_slice(*space))); } try!(write!(fmt, "}}")); Ok(()) @@ -601,7 +601,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for SubstFolder<'a, 'tcx> { span, format!("Type parameter out of range \ when substituting in region {} (root type={}) \ - (space={}, index={})", + (space={:?}, index={})", region_name.as_str(), self.root_ty.repr(self.tcx()), space, i).index(&FullRange)); @@ -654,7 +654,7 @@ impl<'a,'tcx> SubstFolder<'a,'tcx> { let span = self.span.unwrap_or(DUMMY_SP); self.tcx().sess.span_bug( span, - format!("Type parameter `{}` ({}/{}/{}) out of range \ + format!("Type parameter `{}` ({}/{:?}/{}) out of range \ when substituting (root type={}) substs={}", p.repr(self.tcx()), source_ty.repr(self.tcx()), @@ -711,7 +711,7 @@ impl<'a,'tcx> SubstFolder<'a,'tcx> { /// first case we do not increase the Debruijn index and in the second case we do. The reason /// is that only in the second case have we passed through a fn binder. fn shift_regions_through_binders(&self, ty: Ty<'tcx>) -> Ty<'tcx> { - debug!("shift_regions(ty={}, region_binders_passed={}, type_has_escaping_regions={})", + debug!("shift_regions(ty={:?}, region_binders_passed={:?}, type_has_escaping_regions={:?})", ty.repr(self.tcx()), self.region_binders_passed, ty::type_has_escaping_regions(ty)); if self.region_binders_passed == 0 || !ty::type_has_escaping_regions(ty) { @@ -719,7 +719,7 @@ impl<'a,'tcx> SubstFolder<'a,'tcx> { } let result = ty_fold::shift_regions(self.tcx(), self.region_binders_passed, &ty); - debug!("shift_regions: shifted result = {}", result.repr(self.tcx())); + debug!("shift_regions: shifted result = {:?}", result.repr(self.tcx())); result } diff --git a/src/librustc/middle/traits/mod.rs b/src/librustc/middle/traits/mod.rs index 3638d98ae88..3ef6694ce31 100644 --- a/src/librustc/middle/traits/mod.rs +++ b/src/librustc/middle/traits/mod.rs @@ -297,7 +297,7 @@ pub fn evaluate_builtin_bound<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>, span: Span) -> SelectionResult<'tcx, ()> { - debug!("type_known_to_meet_builtin_bound(ty={}, bound={})", + debug!("type_known_to_meet_builtin_bound(ty={}, bound={:?})", ty.repr(infcx.tcx), bound); @@ -347,7 +347,7 @@ pub fn evaluate_builtin_bound<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>, } }; - debug!("type_known_to_meet_builtin_bound: ty={} bound={} result={}", + debug!("type_known_to_meet_builtin_bound: ty={} bound={:?} result={:?}", ty.repr(infcx.tcx), bound, result); diff --git a/src/librustc/middle/traits/object_safety.rs b/src/librustc/middle/traits/object_safety.rs index 17792ef78ab..beb3340e3c4 100644 --- a/src/librustc/middle/traits/object_safety.rs +++ b/src/librustc/middle/traits/object_safety.rs @@ -295,7 +295,7 @@ impl<'tcx> Repr<'tcx> for ObjectSafetyViolation<'tcx> { ObjectSafetyViolation::SizedSelf => format!("SizedSelf"), ObjectSafetyViolation::Method(ref m, code) => - format!("Method({},{})", m.repr(tcx), code), + format!("Method({},{:?})", m.repr(tcx), code), } } } diff --git a/src/librustc/middle/traits/select.rs b/src/librustc/middle/traits/select.rs index 4ffae39ea44..25a33de1cc7 100644 --- a/src/librustc/middle/traits/select.rs +++ b/src/librustc/middle/traits/select.rs @@ -368,7 +368,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { let result = self.evaluate_stack(&stack); - debug!("result: {}", result); + debug!("result: {:?}", result); result } @@ -944,14 +944,14 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { _ => { return Ok(()); } }; - debug!("assemble_unboxed_candidates: self_ty={} kind={} obligation={}", + debug!("assemble_unboxed_candidates: self_ty={} kind={:?} obligation={}", self_ty.repr(self.tcx()), kind, obligation.repr(self.tcx())); let closure_kind = self.closure_typer.unboxed_closure_kind(closure_def_id); - debug!("closure_kind = {}", closure_kind); + debug!("closure_kind = {:?}", closure_kind); if closure_kind == kind { candidates.vec.push(UnboxedClosureCandidate(closure_def_id, substs.clone())); @@ -1102,7 +1102,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { Err(error) => EvaluatedToErr(error), } }); - debug!("winnow_candidate depth={} result={}", + debug!("winnow_candidate depth={} result={:?}", stack.obligation.recursion_depth, result); result } @@ -1716,7 +1716,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { let substs = self.rematch_impl(impl_def_id, obligation, snapshot, &skol_map, skol_obligation_trait_ref.trait_ref); - debug!("confirm_impl_candidate substs={}", substs); + debug!("confirm_impl_candidate substs={:?}", substs); Ok(self.vtable_impl(impl_def_id, substs, obligation.cause.clone(), obligation.recursion_depth + 1, skol_map, snapshot)) }) @@ -2225,7 +2225,7 @@ impl<'tcx> Repr<'tcx> for SelectionCandidate<'tcx> { fn repr(&self, tcx: &ty::ctxt<'tcx>) -> String { match *self { ErrorCandidate => format!("ErrorCandidate"), - BuiltinCandidate(b) => format!("BuiltinCandidate({})", b), + BuiltinCandidate(b) => format!("BuiltinCandidate({:?})", b), ParamCandidate(ref a) => format!("ParamCandidate({})", a.repr(tcx)), ImplCandidate(a) => format!("ImplCandidate({})", a.repr(tcx)), ProjectionCandidate => format!("ProjectionCandidate"), @@ -2234,7 +2234,7 @@ impl<'tcx> Repr<'tcx> for SelectionCandidate<'tcx> { format!("ObjectCandidate") } UnboxedClosureCandidate(c, ref s) => { - format!("UnboxedClosureCandidate({},{})", c, s.repr(tcx)) + format!("UnboxedClosureCandidate({:?},{})", c, s.repr(tcx)) } } } diff --git a/src/librustc/middle/traits/util.rs b/src/librustc/middle/traits/util.rs index 229d34fe423..272447027af 100644 --- a/src/librustc/middle/traits/util.rs +++ b/src/librustc/middle/traits/util.rs @@ -238,7 +238,7 @@ pub fn fresh_substs_for_impl<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>, impl<'tcx, N> fmt::Show for VtableImplData<'tcx, N> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "VtableImpl({})", self.impl_def_id) + write!(f, "VtableImpl({:?})", self.impl_def_id) } } @@ -451,8 +451,8 @@ impl<'tcx> Repr<'tcx> for super::FulfillmentErrorCode<'tcx> { impl<'tcx> fmt::Show for super::FulfillmentErrorCode<'tcx> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { - super::CodeSelectionError(ref e) => write!(f, "{}", e), - super::CodeProjectionError(ref e) => write!(f, "{}", e), + super::CodeSelectionError(ref e) => write!(f, "{:?}", e), + super::CodeProjectionError(ref e) => write!(f, "{:?}", e), super::CodeAmbiguity => write!(f, "Ambiguity") } } diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 1b35d019c8a..593c144f888 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -1709,8 +1709,8 @@ impl fmt::Show for InferTy { TyVar(ref v) => v.fmt(f), IntVar(ref v) => v.fmt(f), FloatVar(ref v) => v.fmt(f), - FreshTy(v) => write!(f, "FreshTy({})", v), - FreshIntTy(v) => write!(f, "FreshIntTy({})", v), + FreshTy(v) => write!(f, "FreshTy({:?})", v), + FreshIntTy(v) => write!(f, "FreshIntTy({:?})", v), } } } @@ -2470,7 +2470,7 @@ fn intern_ty<'tcx>(type_arena: &'tcx TypedArena<TyS<'tcx>>, region_depth: flags.depth, }); - debug!("Interned type: {} Pointer: {}", + debug!("Interned type: {:?} Pointer: {:?}", ty, ty as *const _); interner.insert(InternedTy { ty: ty }, ty); @@ -3532,7 +3532,7 @@ fn type_impls_bound<'a,'tcx>(param_env: &ParameterEnvironment<'a,'tcx>, match cache.borrow().get(&ty) { None => {} Some(&result) => { - debug!("type_impls_bound({}, {}) = {} (cached)", + debug!("type_impls_bound({}, {:?}) = {:?} (cached)", ty.repr(param_env.tcx), bound, result); @@ -3545,7 +3545,7 @@ fn type_impls_bound<'a,'tcx>(param_env: &ParameterEnvironment<'a,'tcx>, let is_impld = traits::type_known_to_meet_builtin_bound(&infcx, param_env, ty, bound, span); - debug!("type_impls_bound({}, {}) = {}", + debug!("type_impls_bound({}, {:?}) = {:?}", ty.repr(param_env.tcx), bound, is_impld); @@ -3584,13 +3584,13 @@ pub fn is_ffi_safe<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>) -> bool { pub fn is_instantiable<'tcx>(cx: &ctxt<'tcx>, r_ty: Ty<'tcx>) -> bool { fn type_requires<'tcx>(cx: &ctxt<'tcx>, seen: &mut Vec<DefId>, r_ty: Ty<'tcx>, ty: Ty<'tcx>) -> bool { - debug!("type_requires({}, {})?", + debug!("type_requires({:?}, {:?})?", ::util::ppaux::ty_to_string(cx, r_ty), ::util::ppaux::ty_to_string(cx, ty)); let r = r_ty == ty || subtypes_require(cx, seen, r_ty, ty); - debug!("type_requires({}, {})? {}", + debug!("type_requires({:?}, {:?})? {:?}", ::util::ppaux::ty_to_string(cx, r_ty), ::util::ppaux::ty_to_string(cx, ty), r); @@ -3599,7 +3599,7 @@ pub fn is_instantiable<'tcx>(cx: &ctxt<'tcx>, r_ty: Ty<'tcx>) -> bool { fn subtypes_require<'tcx>(cx: &ctxt<'tcx>, seen: &mut Vec<DefId>, r_ty: Ty<'tcx>, ty: Ty<'tcx>) -> bool { - debug!("subtypes_require({}, {})?", + debug!("subtypes_require({:?}, {:?})?", ::util::ppaux::ty_to_string(cx, r_ty), ::util::ppaux::ty_to_string(cx, ty)); @@ -3654,7 +3654,7 @@ pub fn is_instantiable<'tcx>(cx: &ctxt<'tcx>, r_ty: Ty<'tcx>) -> bool { ty_unboxed_closure(..) => { // this check is run on type definitions, so we don't expect to see // inference by-products or unboxed closure types - cx.sess.bug(format!("requires check invoked on inapplicable type: {}", + cx.sess.bug(format!("requires check invoked on inapplicable type: {:?}", ty).as_slice()) } @@ -3680,7 +3680,7 @@ pub fn is_instantiable<'tcx>(cx: &ctxt<'tcx>, r_ty: Ty<'tcx>) -> bool { } }; - debug!("subtypes_require({}, {})? {}", + debug!("subtypes_require({:?}, {:?})? {:?}", ::util::ppaux::ty_to_string(cx, r_ty), ::util::ppaux::ty_to_string(cx, ty), r); @@ -3748,7 +3748,7 @@ pub fn is_type_representable<'tcx>(cx: &ctxt<'tcx>, sp: Span, ty: Ty<'tcx>) ty_unboxed_closure(..) => { // this check is run on type definitions, so we don't expect to see // unboxed closure types - cx.sess.bug(format!("requires check invoked on inapplicable type: {}", + cx.sess.bug(format!("requires check invoked on inapplicable type: {:?}", ty).as_slice()) } _ => Representable, @@ -3790,7 +3790,7 @@ pub fn is_type_representable<'tcx>(cx: &ctxt<'tcx>, sp: Span, ty: Ty<'tcx>) fn is_type_structurally_recursive<'tcx>(cx: &ctxt<'tcx>, sp: Span, seen: &mut Vec<Ty<'tcx>>, ty: Ty<'tcx>) -> Representability { - debug!("is_type_structurally_recursive: {}", + debug!("is_type_structurally_recursive: {:?}", ::util::ppaux::ty_to_string(cx, ty)); match ty.sty { @@ -3810,7 +3810,7 @@ pub fn is_type_representable<'tcx>(cx: &ctxt<'tcx>, sp: Span, ty: Ty<'tcx>) match iter.next() { Some(&seen_type) => { if same_struct_or_enum_def_id(seen_type, did) { - debug!("SelfRecursive: {} contains {}", + debug!("SelfRecursive: {:?} contains {:?}", ::util::ppaux::ty_to_string(cx, seen_type), ::util::ppaux::ty_to_string(cx, ty)); return SelfRecursive; @@ -3830,7 +3830,7 @@ pub fn is_type_representable<'tcx>(cx: &ctxt<'tcx>, sp: Span, ty: Ty<'tcx>) for &seen_type in iter { if same_type(ty, seen_type) { - debug!("ContainsRecursive: {} contains {}", + debug!("ContainsRecursive: {:?} contains {:?}", ::util::ppaux::ty_to_string(cx, seen_type), ::util::ppaux::ty_to_string(cx, ty)); return ContainsRecursive; @@ -3852,7 +3852,7 @@ pub fn is_type_representable<'tcx>(cx: &ctxt<'tcx>, sp: Span, ty: Ty<'tcx>) } } - debug!("is_type_representable: {}", + debug!("is_type_representable: {:?}", ::util::ppaux::ty_to_string(cx, ty)); // To avoid a stack overflow when checking an enum variant or struct that @@ -3860,7 +3860,7 @@ pub fn is_type_representable<'tcx>(cx: &ctxt<'tcx>, sp: Span, ty: Ty<'tcx>) // of seen types and check recursion for each of them (issues #3008, #3779). let mut seen: Vec<Ty> = Vec::new(); let r = is_type_structurally_recursive(cx, sp, &mut seen, ty); - debug!("is_type_representable: {} is {}", + debug!("is_type_representable: {:?} is {:?}", ::util::ppaux::ty_to_string(cx, ty), r); r } @@ -4123,7 +4123,7 @@ pub fn fn_is_variadic(fty: Ty) -> bool { match fty.sty { ty_bare_fn(_, ref f) => f.sig.0.variadic, ref s => { - panic!("fn_is_variadic() called on non-fn type: {}", s) + panic!("fn_is_variadic() called on non-fn type: {:?}", s) } } } @@ -4132,7 +4132,7 @@ pub fn ty_fn_sig<'tcx>(fty: Ty<'tcx>) -> &'tcx PolyFnSig<'tcx> { match fty.sty { ty_bare_fn(_, ref f) => &f.sig, ref s => { - panic!("ty_fn_sig() called on non-fn type: {}", s) + panic!("ty_fn_sig() called on non-fn type: {:?}", s) } } } @@ -4158,7 +4158,7 @@ pub fn ty_closure_store(fty: Ty) -> TraitStore { UniqTraitStore } ref s => { - panic!("ty_closure_store() called on non-closure type: {}", s) + panic!("ty_closure_store() called on non-closure type: {:?}", s) } } } @@ -4167,7 +4167,7 @@ pub fn ty_fn_ret<'tcx>(fty: Ty<'tcx>) -> FnOutput<'tcx> { match fty.sty { ty_bare_fn(_, ref f) => f.sig.0.output, ref s => { - panic!("ty_fn_ret() called on non-fn type: {}", s) + panic!("ty_fn_ret() called on non-fn type: {:?}", s) } } } @@ -4187,7 +4187,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).index(&FullRange)); } } @@ -4247,7 +4247,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).index(&FullRange)); } @@ -4267,14 +4267,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).index(&FullRange)); } } } r => { - cx.sess.bug(format!("Variable id {} maps to {}, not local", + cx.sess.bug(format!("Variable id {} maps to {:?}, not local", id, r).index(&FullRange)); } @@ -4298,7 +4298,7 @@ pub fn adjust_ty<'tcx, F>(cx: &ctxt<'tcx>, return match adjustment { Some(adjustment) => { match *adjustment { - AdjustReifyFnPointer(_) => { + AdjustReifyFnPointer(_) => { match unadjusted_ty.sty { ty::ty_bare_fn(Some(_), b) => { ty::mk_bare_fn(cx, None, b) @@ -4306,7 +4306,7 @@ pub fn adjust_ty<'tcx, F>(cx: &ctxt<'tcx>, ref b => { cx.sess.bug( format!("AdjustReifyFnPointer adjustment on non-fn-item: \ - {}", + {:?}", b).index(&FullRange)); } } @@ -4397,7 +4397,7 @@ pub fn unsize_ty<'tcx>(cx: &ctxt<'tcx>, mk_vec(cx, ty, None) } _ => cx.sess.span_bug(span, - format!("UnsizeLength with bad sty: {}", + format!("UnsizeLength with bad sty: {:?}", ty_to_string(cx, ty)).index(&FullRange)) }, &UnsizeStruct(box ref k, tp_index) => match ty.sty { @@ -4409,7 +4409,7 @@ pub fn unsize_ty<'tcx>(cx: &ctxt<'tcx>, mk_struct(cx, did, cx.mk_substs(unsized_substs)) } _ => cx.sess.span_bug(span, - format!("UnsizeStruct with bad sty: {}", + format!("UnsizeStruct with bad sty: {:?}", ty_to_string(cx, ty)).index(&FullRange)) }, &UnsizeVtable(TyTrait { ref principal, ref bounds }, _) => { @@ -4516,7 +4516,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).index(&FullRange)); } @@ -4639,7 +4639,7 @@ pub fn field_idx_strict(tcx: &ctxt, name: ast::Name, fields: &[field]) let mut i = 0u; for f in fields.iter() { if f.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_name(f.name).get().to_string()) @@ -4716,18 +4716,18 @@ pub fn type_err_to_str<'tcx>(cx: &ctxt<'tcx>, err: &type_err<'tcx>) -> String { terr_mismatch => "types differ".to_string(), terr_unsafety_mismatch(values) => { format!("expected {} fn, found {} fn", - values.expected.to_string(), - values.found.to_string()) + values.expected, + values.found) } terr_abi_mismatch(values) => { format!("expected {} fn, found {} fn", - values.expected.to_string(), - values.found.to_string()) + values.expected, + values.found) } terr_onceness_mismatch(values) => { format!("expected {} fn, found {} fn", - values.expected.to_string(), - values.found.to_string()) + values.expected, + values.found) } terr_sigil_mismatch(values) => { format!("expected {}, found {}", @@ -4819,14 +4819,14 @@ pub fn type_err_to_str<'tcx>(cx: &ctxt<'tcx>, err: &type_err<'tcx>) -> String { "expected an integral type, found `char`".to_string() } terr_int_mismatch(ref values) => { - format!("expected `{}`, found `{}`", - values.expected.to_string(), - values.found.to_string()) + format!("expected `{:?}`, found `{:?}`", + values.expected, + values.found) } terr_float_mismatch(ref values) => { - format!("expected `{}`, found `{}`", - values.expected.to_string(), - values.found.to_string()) + format!("expected `{:?}`, found `{:?}`", + values.expected, + values.found) } terr_variadic_mismatch(ref values) => { format!("expected {} fn, found {} function", @@ -4915,14 +4915,14 @@ pub fn provided_trait_methods<'tcx>(cx: &ctxt<'tcx>, id: ast::DefId) }).collect() } _ => { - cx.sess.bug(format!("provided_trait_methods: `{}` is \ + cx.sess.bug(format!("provided_trait_methods: `{:?}` is \ not a trait", id).index(&FullRange)) } } } _ => { - cx.sess.bug(format!("provided_trait_methods: `{}` is not a \ + cx.sess.bug(format!("provided_trait_methods: `{:?}` is not a \ trait", id).index(&FullRange)) } @@ -4951,7 +4951,7 @@ fn lookup_locally_or_in_crate_store<V, F>(descr: &str, } if def_id.krate == ast::LOCAL_CRATE { - panic!("No def'n found for {} in tcx.{}", def_id, descr); + panic!("No def'n found for {:?} in tcx.{}", def_id, descr); } let v = load_external(); map.insert(def_id, v.clone()); @@ -5058,7 +5058,7 @@ pub fn impl_trait_ref<'tcx>(cx: &ctxt<'tcx>, id: ast::DefId) -> Option<Rc<TraitRef<'tcx>>> { 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 { @@ -5378,7 +5378,7 @@ pub fn predicates_for_trait_ref<'tcx>(tcx: &ctxt<'tcx>, { let trait_def = lookup_trait_def(tcx, trait_ref.def_id()); - debug!("bounds_for_trait_ref(trait_def={}, trait_ref={})", + debug!("bounds_for_trait_ref(trait_def={:?}, trait_ref={:?})", trait_def.repr(tcx), trait_ref.repr(tcx)); // The interaction between HRTB and supertraits is not entirely @@ -5930,7 +5930,7 @@ pub fn required_region_bounds<'tcx>(tcx: &ctxt<'tcx>, predicates: Vec<ty::Predicate<'tcx>>) -> Vec<ty::Region> { - debug!("required_region_bounds(erased_self_ty={}, predicates={})", + debug!("required_region_bounds(erased_self_ty={:?}, predicates={:?})", erased_self_ty.repr(tcx), predicates.repr(tcx)); @@ -6008,7 +6008,7 @@ pub fn populate_implementations_for_type_if_necessary(tcx: &ctxt, return } - debug!("populate_implementations_for_type_if_necessary: searching for {}", type_id); + debug!("populate_implementations_for_type_if_necessary: searching for {:?}", type_id); let mut inherent_impls = Vec::new(); csearch::each_implementation_for_type(&tcx.sess.cstore, type_id, @@ -6369,7 +6369,7 @@ pub fn construct_parameter_environment<'a,'tcx>( record_region_bounds(tcx, &bounds); - debug!("construct_parameter_environment: free_id={} free_subst={} bounds={}", + debug!("construct_parameter_environment: free_id={:?} free_subst={:?} bounds={:?}", free_id, free_substs.repr(tcx), bounds.repr(tcx)); @@ -6395,15 +6395,15 @@ pub fn construct_parameter_environment<'a,'tcx>( types: &mut VecPerParamSpace<Ty<'tcx>>, defs: &[TypeParameterDef<'tcx>]) { for def in defs.iter() { - debug!("construct_parameter_environment(): push_types_from_defs: def={}", + debug!("construct_parameter_environment(): push_types_from_defs: def={:?}", def.repr(tcx)); let ty = ty::mk_param_from_def(tcx, def); types.push(def.space, ty); - } + } } fn record_region_bounds<'tcx>(tcx: &ty::ctxt<'tcx>, bounds: &GenericBounds<'tcx>) { - debug!("record_region_bounds(bounds={})", bounds.repr(tcx)); + debug!("record_region_bounds(bounds={:?})", bounds.repr(tcx)); for predicate in bounds.predicates.iter() { match *predicate { @@ -6757,7 +6757,7 @@ pub fn replace_late_bound_regions<'tcx, T, F>( } }); - debug!("resulting map: {} value: {}", map, value.repr(tcx)); + debug!("resulting map: {:?} value: {:?}", map, value.repr(tcx)); (value, map) } @@ -6805,7 +6805,7 @@ impl<'tcx> Repr<'tcx> for AutoRef<'tcx> { fn repr(&self, tcx: &ctxt<'tcx>) -> String { match *self { AutoPtr(a, b, ref c) => { - format!("AutoPtr({},{},{})", a.repr(tcx), b, c.repr(tcx)) + format!("AutoPtr({},{:?},{})", a.repr(tcx), b, c.repr(tcx)) } AutoUnsize(ref a) => { format!("AutoUnsize({})", a.repr(tcx)) @@ -6814,7 +6814,7 @@ impl<'tcx> Repr<'tcx> for AutoRef<'tcx> { format!("AutoUnsizeUniq({})", a.repr(tcx)) } AutoUnsafe(ref a, ref b) => { - format!("AutoUnsafe({},{})", a, b.repr(tcx)) + format!("AutoUnsafe({:?},{})", a, b.repr(tcx)) } } } @@ -6844,7 +6844,7 @@ impl<'tcx> Repr<'tcx> for vtable_origin<'tcx> { fn repr(&self, tcx: &ty::ctxt<'tcx>) -> 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), @@ -6852,11 +6852,11 @@ impl<'tcx> Repr<'tcx> for vtable_origin<'tcx> { } vtable_param(x, y) => { - format!("vtable_param({}, {})", x, y) + format!("vtable_param({:?}, {})", x, y) } vtable_unboxed_closure(def_id) => { - format!("vtable_unboxed_closure({})", def_id) + format!("vtable_unboxed_closure({:?})", def_id) } vtable_error => { @@ -7287,7 +7287,7 @@ impl ReferencesError for Region impl<'tcx> Repr<'tcx> for ClosureTy<'tcx> { fn repr(&self, tcx: &ctxt<'tcx>) -> String { - format!("ClosureTy({},{},{},{},{},{})", + format!("ClosureTy({},{},{:?},{},{},{})", self.unsafety, self.onceness, self.store, diff --git a/src/librustc/middle/ty_walk.rs b/src/librustc/middle/ty_walk.rs index 4953e9a2ce1..28975c73416 100644 --- a/src/librustc/middle/ty_walk.rs +++ b/src/librustc/middle/ty_walk.rs @@ -95,7 +95,7 @@ impl<'tcx> Iterator for TypeWalker<'tcx> { type Item = Ty<'tcx>; fn next(&mut self) -> Option<Ty<'tcx>> { - debug!("next(): stack={}", self.stack); + debug!("next(): stack={:?}", self.stack); match self.stack.pop() { None => { return None; @@ -103,7 +103,7 @@ impl<'tcx> Iterator for TypeWalker<'tcx> { Some(ty) => { self.last_subtree = self.stack.len(); self.push_subtypes(ty); - debug!("next: stack={}", self.stack); + debug!("next: stack={:?}", self.stack); Some(ty) } } diff --git a/src/librustc/util/common.rs b/src/librustc/util/common.rs index 7d2a8509cb5..26f98e28a8d 100644 --- a/src/librustc/util/common.rs +++ b/src/librustc/util/common.rs @@ -64,7 +64,7 @@ pub fn indent<R, F>(op: F) -> R where // to make debug output more readable. debug!(">>"); let r = op(); - debug!("<< (Result = {})", r); + debug!("<< (Result = {:?})", r); r } diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 55bba3e4215..ded8713079a 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -111,7 +111,7 @@ pub fn explain_region_and_span(cx: &ctxt, region: ty::Region) } Some(_) | None => { // this really should not happen - (format!("unknown scope: {}. Please report a bug.", scope), None) + (format!("unknown scope: {:?}. Please report a bug.", scope), None) } } } @@ -140,7 +140,7 @@ pub fn explain_region_and_span(cx: &ctxt, region: ty::Region) } Some(_) | None => { // this really should not happen - (format!("{} unknown free region bounded by scope {}", prefix, fr.scope), None) + (format!("{} unknown free region bounded by scope {:?}", prefix, fr.scope), None) } } } @@ -156,7 +156,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) } }; @@ -653,13 +653,13 @@ impl<'tcx, T:UserString<'tcx>> UserString<'tcx> for Vec<T> { impl<'tcx> Repr<'tcx> for def::Def { fn repr(&self, _tcx: &ctxt) -> String { - format!("{}", *self) + format!("{:?}", *self) } } impl<'tcx> Repr<'tcx> for ty::TypeParameterDef<'tcx> { fn repr(&self, tcx: &ctxt<'tcx>) -> String { - format!("TypeParameterDef({}, {}, {}/{})", + format!("TypeParameterDef({:?}, {}, {:?}/{})", self.def_id, self.bounds.repr(tcx), self.space, @@ -854,7 +854,7 @@ impl<'tcx> Repr<'tcx> for ty::Region { fn repr(&self, tcx: &ctxt) -> String { match *self { ty::ReEarlyBound(id, space, index, name) => { - format!("ReEarlyBound({}, {}, {}, {})", + format!("ReEarlyBound({}, {:?}, {}, {})", id, space, index, @@ -862,7 +862,7 @@ impl<'tcx> Repr<'tcx> for ty::Region { } ty::ReLateBound(binder_id, ref bound_region) => { - format!("ReLateBound({}, {})", + format!("ReLateBound({:?}, {})", binder_id, bound_region.repr(tcx)) } @@ -870,7 +870,7 @@ impl<'tcx> Repr<'tcx> for ty::Region { ty::ReFree(ref fr) => fr.repr(tcx), ty::ReScope(id) => { - format!("ReScope({})", id) + format!("ReScope({:?})", id) } ty::ReStatic => { @@ -878,7 +878,7 @@ impl<'tcx> Repr<'tcx> for ty::Region { } ty::ReInfer(ReVar(ref vid)) => { - format!("{}", vid) + format!("{:?}", vid) } ty::ReInfer(ReSkolemized(id, ref bound_region)) => { @@ -920,14 +920,14 @@ impl<'tcx> Repr<'tcx> for ast::DefId { Some(ast_map::NodeVariant(..)) | Some(ast_map::NodeStructCtor(..)) => { return format!( - "{}:{}", + "{:?}:{}", *self, ty::item_path_str(tcx, *self)) } _ => {} } } - return format!("{}", *self) + return format!("{:?}", *self) } } @@ -1007,13 +1007,13 @@ impl<'tcx> Repr<'tcx> for ast::Ident { impl<'tcx> Repr<'tcx> for ast::ExplicitSelf_ { fn repr(&self, _tcx: &ctxt) -> String { - format!("{}", *self) + format!("{:?}", *self) } } impl<'tcx> Repr<'tcx> for ast::Visibility { fn repr(&self, _tcx: &ctxt) -> String { - format!("{}", *self) + format!("{:?}", *self) } } @@ -1026,6 +1026,7 @@ impl<'tcx> Repr<'tcx> for ty::BareFnTy<'tcx> { } } + impl<'tcx> Repr<'tcx> for ty::FnSig<'tcx> { fn repr(&self, tcx: &ctxt<'tcx>) -> String { format!("fn{} -> {}", self.inputs.repr(tcx), self.output.repr(tcx)) @@ -1096,7 +1097,7 @@ impl<'tcx> Repr<'tcx> for ty::TraitStore { impl<'tcx> Repr<'tcx> for ty::BuiltinBound { fn repr(&self, _tcx: &ctxt) -> String { - format!("{}", *self) + format!("{:?}", *self) } } @@ -1251,13 +1252,13 @@ impl<'tcx> Repr<'tcx> for ty::UpvarId { impl<'tcx> Repr<'tcx> for ast::Mutability { fn repr(&self, _tcx: &ctxt) -> String { - format!("{}", *self) + format!("{:?}", *self) } } impl<'tcx> Repr<'tcx> for ty::BorrowKind { fn repr(&self, _tcx: &ctxt) -> String { - format!("{}", *self) + format!("{:?}", *self) } } @@ -1271,49 +1272,49 @@ impl<'tcx> Repr<'tcx> for ty::UpvarBorrow { impl<'tcx> Repr<'tcx> for ty::IntVid { fn repr(&self, _tcx: &ctxt) -> String { - format!("{}", self) + format!("{:?}", self) } } impl<'tcx> Repr<'tcx> for ty::FloatVid { fn repr(&self, _tcx: &ctxt) -> String { - format!("{}", self) + format!("{:?}", self) } } impl<'tcx> Repr<'tcx> for ty::RegionVid { fn repr(&self, _tcx: &ctxt) -> String { - format!("{}", self) + format!("{:?}", self) } } impl<'tcx> Repr<'tcx> for ty::TyVid { fn repr(&self, _tcx: &ctxt) -> String { - format!("{}", self) + format!("{:?}", self) } } impl<'tcx> Repr<'tcx> for ty::IntVarValue { fn repr(&self, _tcx: &ctxt) -> String { - format!("{}", *self) + format!("{:?}", *self) } } impl<'tcx> Repr<'tcx> for ast::IntTy { fn repr(&self, _tcx: &ctxt) -> String { - format!("{}", *self) + format!("{:?}", *self) } } impl<'tcx> Repr<'tcx> for ast::UintTy { fn repr(&self, _tcx: &ctxt) -> String { - format!("{}", *self) + format!("{:?}", *self) } } impl<'tcx> Repr<'tcx> for ast::FloatTy { fn repr(&self, _tcx: &ctxt) -> String { - format!("{}", *self) + format!("{:?}", *self) } } @@ -1332,7 +1333,7 @@ impl<'tcx> UserString<'tcx> for ParamTy { impl<'tcx> Repr<'tcx> for ParamTy { fn repr(&self, tcx: &ctxt) -> String { let ident = self.user_string(tcx); - format!("{}/{}.{}", ident, self.space, self.idx) + format!("{}/{:?}.{}", ident, self.space, self.idx) } } |
