@@ -132,21 +132,21 @@ pub fn explain_region_and_span(cx: ctxt, region: ty::Region)
132
132
}
133
133
134
134
pub 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)
136
136
}
137
137
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) ; }
141
143
142
144
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) ,
146
147
br_anon( _) => prefix. to_str ( ) ,
147
148
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)
150
150
}
151
151
}
152
152
@@ -194,13 +194,12 @@ pub fn re_scope_id_to_str(cx: ctxt, node_id: ast::node_id) -> ~str {
194
194
// you should use `explain_region()` or, better yet,
195
195
// `note_and_explain_region()`
196
196
pub fn region_to_str ( cx : ctxt , region : Region ) -> ~str {
197
- region_to_str_adorned ( cx, "&" , region, "" )
197
+ region_to_str_space ( cx, "&" , region)
198
198
}
199
199
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 {
202
201
if cx. sess . verbose ( ) {
203
- return fmt ! ( "%s%?%s " , prefix, region, sep ) ;
202
+ return fmt ! ( "%s%? " , prefix, region) ;
204
203
}
205
204
206
205
// 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,
209
208
// `explain_region()` or `note_and_explain_region()`.
210
209
match region {
211
210
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) ,
214
213
re_infer( ReSkolemized ( _, br) ) => {
215
- bound_region_to_str_adorned ( cx, prefix, br, sep )
214
+ bound_region_to_str_space ( cx, prefix, br)
216
215
}
217
216
re_infer( ReVar ( _) ) => prefix. to_str ( ) ,
218
- re_static => fmt ! ( "%sstatic%s " , prefix, sep )
217
+ re_static => fmt ! ( "%s'static " , prefix)
219
218
}
220
219
}
221
220
@@ -233,7 +232,7 @@ pub fn vstore_to_str(cx: ctxt, vs: ty::vstore) -> ~str {
233
232
ty:: vstore_fixed( n) => fmt ! ( "%u" , n) ,
234
233
ty:: vstore_uniq => ~"~",
235
234
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)
237
236
}
238
237
}
239
238
@@ -242,7 +241,7 @@ pub fn trait_store_to_str(cx: ctxt, s: ty::TraitStore) -> ~str {
242
241
ty:: BareTraitStore => ~"",
243
242
ty:: UniqTraitStore => ~"~",
244
243
ty:: BoxTraitStore => ~"@",
245
- ty:: RegionTraitStore ( r) => region_to_str_adorned ( cx, "&" , r, "" )
244
+ ty:: RegionTraitStore ( r) => region_to_str_space ( cx, "&" , r)
246
245
}
247
246
}
248
247
@@ -252,7 +251,7 @@ pub fn vstore_ty_to_str(cx: ctxt, ty: ~str, vs: ty::vstore) -> ~str {
252
251
fmt ! ( "[%s * %s]" , ty, vstore_to_str( cx, vs) )
253
252
}
254
253
ty:: vstore_slice( _) => {
255
- fmt ! ( "%s/ %s" , vstore_to_str( cx, vs) , ty)
254
+ fmt ! ( "%s %s" , vstore_to_str( cx, vs) , ty)
256
255
}
257
256
_ => fmt ! ( "%s[%s]" , vstore_to_str( cx, vs) , ty)
258
257
}
@@ -344,7 +343,7 @@ pub fn ty_to_str(cx: ctxt, typ: t) -> ~str {
344
343
( ast:: OwnedSigil , ty:: re_static) => { }
345
344
346
345
( _, region) => {
347
- s. push_str ( region_to_str_adorned ( cx, "" , region, "/" ) ) ;
346
+ s. push_str ( region_to_str_space ( cx, "" , region) ) ;
348
347
}
349
348
}
350
349
@@ -418,7 +417,7 @@ pub fn ty_to_str(cx: ctxt, typ: t) -> ~str {
418
417
ty_uniq ( tm) => ~"~" + mt_to_str ( cx, tm) ,
419
418
ty_ptr ( tm) => ~"* " + mt_to_str(cx, tm),
420
419
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)
422
421
}
423
422
ty_unboxed_vec(tm) => { ~" unboxed_vec<" + mt_to_str(cx, tm) + ~" >" }
424
423
ty_type => ~" type",
0 commit comments