@@ -16,6 +16,7 @@ use middle::ty::{BrFresh, ctxt};
16
16
use middle:: ty:: { mt, t, param_ty} ;
17
17
use middle:: ty:: { ReFree , ReScope , ReInfer , ReStatic , Region ,
18
18
ReEmpty } ;
19
+ use middle:: ty:: RegionVid ;
19
20
use middle:: ty:: { ty_bool, ty_char, ty_bot, ty_box, ty_struct, ty_enum} ;
20
21
use middle:: ty:: { ty_err, ty_str, ty_vec, ty_float, ty_bare_fn, ty_closure} ;
21
22
use middle:: ty:: { ty_nil, ty_param, ty_ptr, ty_rptr, ty_self, ty_tup} ;
@@ -221,13 +222,18 @@ pub fn region_to_str(cx: &ctxt, prefix: &str, space: bool, region: Region) -> ~s
221
222
// `explain_region()` or `note_and_explain_region()`.
222
223
match region {
223
224
ty:: ReScope ( _) => prefix. to_str ( ) ,
224
- ty:: ReEarlyBound ( _, _, name) => token:: get_name ( name) . get ( ) . to_str ( ) ,
225
- ty:: ReLateBound ( _, br) => bound_region_to_str ( cx, prefix, space, br) ,
226
- ty:: ReFree ( ref fr) => bound_region_to_str ( cx, prefix, space, fr. bound_region ) ,
225
+ ty:: ReEarlyBound ( _, _, name) =>
226
+ format ! ( "{:s}E!{:s}{:s}" ,
227
+ prefix, token:: get_name( name) . get( ) . to_str( ) , space_str) ,
228
+ ty:: ReLateBound ( _, br) =>
229
+ format ! ( "{:s}L!{:s}" , prefix, bound_region_to_str( cx, "" , space, br) ) ,
230
+ ty:: ReFree ( ref fr) =>
231
+ format ! ( "{:s}F!{:s}" , prefix, bound_region_to_str( cx, "" , space, fr. bound_region) ) ,
227
232
ty:: ReInfer ( ReSkolemized ( _, br) ) => {
228
- bound_region_to_str ( cx, prefix , space, br)
233
+ format ! ( "{:s}S!{:s}" , prefix , bound_region_to_str( cx, "" , space, br) )
229
234
}
230
- ty:: ReInfer ( ReVar ( _) ) => prefix. to_str ( ) ,
235
+ ty:: ReInfer ( ReVar ( RegionVid { id : vid} ) ) =>
236
+ format ! ( "{:s}V!{:u}" , prefix, vid) ,
231
237
ty:: ReStatic => format ! ( "{}'static{}" , prefix, space_str) ,
232
238
ty:: ReEmpty => format ! ( "{}'<empty>{}" , prefix, space_str)
233
239
}
0 commit comments