@@ -132,21 +132,21 @@ pub fn explain_region_and_span(cx: ctxt, region: ty::Region)
132132}
133133
134134pub fn bound_region_to_str ( cx : ctxt , br : bound_region ) -> ~str {
135- bound_region_to_str_adorned ( cx, "&" , br, "" )
135+ bound_region_to_str_space ( cx, "&" , br)
136136}
137137
138- pub fn bound_region_to_str_adorned ( cx : ctxt , prefix : & str ,
139- br : bound_region , sep : & str ) -> ~str {
140- if cx. sess . verbose ( ) { return fmt ! ( "%s%?%s" , prefix, br, sep) ; }
138+ pub fn bound_region_to_str_space ( cx : ctxt ,
139+ prefix : & str ,
140+ br : bound_region )
141+ -> ~str {
142+ if cx. sess . verbose ( ) { return fmt ! ( "%s%? " , prefix, br) ; }
141143
142144 match br {
143- br_named( id) => fmt ! ( "%s%s%s" , prefix, * cx. sess. str_of( id) ,
144- sep) ,
145- br_self => fmt ! ( "%sself%s" , prefix, sep) ,
145+ br_named( id) => fmt ! ( "%s'%s " , prefix, * cx. sess. str_of( id) ) ,
146+ br_self => fmt ! ( "%s'self " , prefix) ,
146147 br_anon( _) => prefix. to_str ( ) ,
147148 br_fresh( _) => prefix. to_str ( ) ,
148- br_cap_avoid( _, br) => bound_region_to_str_adorned ( cx, prefix,
149- * br, sep)
149+ br_cap_avoid( _, br) => bound_region_to_str_space ( cx, prefix, * br)
150150 }
151151}
152152
@@ -194,13 +194,12 @@ pub fn re_scope_id_to_str(cx: ctxt, node_id: ast::node_id) -> ~str {
194194// you should use `explain_region()` or, better yet,
195195// `note_and_explain_region()`
196196pub fn region_to_str ( cx : ctxt , region : Region ) -> ~str {
197- region_to_str_adorned ( cx, "&" , region, "" )
197+ region_to_str_space ( cx, "&" , region)
198198}
199199
200- pub fn region_to_str_adorned ( cx : ctxt , prefix : & str ,
201- region : Region , sep : & str ) -> ~str {
200+ pub fn region_to_str_space ( cx : ctxt , prefix : & str , region : Region ) -> ~str {
202201 if cx. sess . verbose ( ) {
203- return fmt ! ( "%s%?%s " , prefix, region, sep ) ;
202+ return fmt ! ( "%s%? " , prefix, region) ;
204203 }
205204
206205 // These printouts are concise. They do not contain all the information
@@ -209,13 +208,13 @@ pub fn region_to_str_adorned(cx: ctxt, prefix: &str,
209208 // `explain_region()` or `note_and_explain_region()`.
210209 match region {
211210 re_scope( _) => prefix. to_str ( ) ,
212- re_bound( br) => bound_region_to_str_adorned ( cx, prefix, br, sep ) ,
213- re_free( _, br) => bound_region_to_str_adorned ( cx, prefix, br, sep ) ,
211+ re_bound( br) => bound_region_to_str_space ( cx, prefix, br) ,
212+ re_free( _, br) => bound_region_to_str_space ( cx, prefix, br) ,
214213 re_infer( ReSkolemized ( _, br) ) => {
215- bound_region_to_str_adorned ( cx, prefix, br, sep )
214+ bound_region_to_str_space ( cx, prefix, br)
216215 }
217216 re_infer( ReVar ( _) ) => prefix. to_str ( ) ,
218- re_static => fmt ! ( "%sstatic%s " , prefix, sep )
217+ re_static => fmt ! ( "%s'static " , prefix)
219218 }
220219}
221220
@@ -233,7 +232,7 @@ pub fn vstore_to_str(cx: ctxt, vs: ty::vstore) -> ~str {
233232 ty:: vstore_fixed( n) => fmt ! ( "%u" , n) ,
234233 ty:: vstore_uniq => ~"~",
235234 ty:: vstore_box => ~"@",
236- ty:: vstore_slice( r) => region_to_str_adorned ( cx, "&" , r, "/" )
235+ ty:: vstore_slice( r) => region_to_str_space ( cx, "&" , r)
237236 }
238237}
239238
@@ -242,7 +241,7 @@ pub fn trait_store_to_str(cx: ctxt, s: ty::TraitStore) -> ~str {
242241 ty:: BareTraitStore => ~"",
243242 ty:: UniqTraitStore => ~"~",
244243 ty:: BoxTraitStore => ~"@",
245- ty:: RegionTraitStore ( r) => region_to_str_adorned ( cx, "&" , r, "" )
244+ ty:: RegionTraitStore ( r) => region_to_str_space ( cx, "&" , r)
246245 }
247246}
248247
@@ -252,7 +251,7 @@ pub fn vstore_ty_to_str(cx: ctxt, ty: ~str, vs: ty::vstore) -> ~str {
252251 fmt ! ( "[%s * %s]" , ty, vstore_to_str( cx, vs) )
253252 }
254253 ty:: vstore_slice( _) => {
255- fmt ! ( "%s/ %s" , vstore_to_str( cx, vs) , ty)
254+ fmt ! ( "%s %s" , vstore_to_str( cx, vs) , ty)
256255 }
257256 _ => fmt ! ( "%s[%s]" , vstore_to_str( cx, vs) , ty)
258257 }
@@ -344,7 +343,7 @@ pub fn ty_to_str(cx: ctxt, typ: t) -> ~str {
344343 ( ast:: OwnedSigil , ty:: re_static) => { }
345344
346345 ( _, region) => {
347- s. push_str ( region_to_str_adorned ( cx, "" , region, "/" ) ) ;
346+ s. push_str ( region_to_str_space ( cx, "" , region) ) ;
348347 }
349348 }
350349
@@ -418,7 +417,7 @@ pub fn ty_to_str(cx: ctxt, typ: t) -> ~str {
418417 ty_uniq ( tm) => ~"~" + mt_to_str ( cx, tm) ,
419418 ty_ptr ( tm) => ~"* " + mt_to_str(cx, tm),
420419 ty_rptr(r, tm) => {
421- region_to_str_adorned (cx, ~" & ", r, ~" / " ) + mt_to_str(cx, tm)
420+ region_to_str_space (cx, ~" & ", r) + mt_to_str(cx, tm)
422421 }
423422 ty_unboxed_vec(tm) => { ~" unboxed_vec<" + mt_to_str(cx, tm) + ~" >" }
424423 ty_type => ~" type",
0 commit comments