@@ -13,8 +13,8 @@ import driver::session::session;
13
13
fn bound_region_to_str ( _cx : ctxt , br : bound_region ) -> str {
14
14
alt br {
15
15
br_anon { "& " }
16
- br_param(_, str) { #fmt[" & %s. ", str ] }
17
- br_self { "&self. " }
16
+ br_param(_, str) { #fmt[" & %s", str] }
17
+ br_self { "&self" }
18
18
}
19
19
}
20
20
@@ -47,14 +47,14 @@ fn re_scope_id_to_str(cx: ctxt, node_id: ast::node_id) -> str {
47
47
48
48
fn region_to_str ( cx : ctxt , region : region ) -> str {
49
49
alt region {
50
- re_scope( node_id) { #fmt[ "&%s. " , re_scope_id_to_str ( cx, node_id) ] }
50
+ re_scope( node_id) { #fmt[ "&%s" , re_scope_id_to_str ( cx, node_id) ] }
51
51
re_bound ( br) { bound_region_to_str ( cx, br) }
52
52
re_free ( id, br) { #fmt[ "{%d} %s" , id, bound_region_to_str ( cx, br) ] }
53
53
54
54
// These two should not be seen by end-users (very often, anyhow):
55
- re_var ( id) { #fmt ( "&%s. " , id. to_str ( ) ) }
56
- re_default { "&(default). " }
57
- re_static { "&static. " }
55
+ re_var ( id) { #fmt ( "&%s" , id. to_str ( ) ) }
56
+ re_default { "&(default)" }
57
+ re_static { "&static" }
58
58
}
59
59
}
60
60
@@ -67,6 +67,15 @@ fn mt_to_str(cx: ctxt, m: mt) -> str {
67
67
ret mstr + ty_to_str ( cx, m. ty ) ;
68
68
}
69
69
70
+ fn vstore_to_str ( cx : ctxt , vs : ty:: vstore ) -> str {
71
+ alt vs {
72
+ ty : : vstore_fixed ( n) { #fmt[ "%u" , n] }
73
+ ty:: vstore_uniq { "~" }
74
+ ty:: vstore_box { "@" }
75
+ ty:: vstore_slice ( r) { region_to_str ( cx, r) }
76
+ }
77
+ }
78
+
70
79
fn ty_to_str ( cx : ctxt , typ : t ) -> str {
71
80
fn fn_input_to_str ( cx : ctxt , input : { mode : ast:: mode , ty : t } ) ->
72
81
str {
@@ -152,7 +161,14 @@ fn ty_to_str(cx: ctxt, typ: t) -> str {
152
161
ty_box ( tm) { "@" + mt_to_str ( cx, tm) }
153
162
ty_uniq ( tm) { "~" + mt_to_str ( cx, tm) }
154
163
ty_ptr ( tm) { "*" + mt_to_str ( cx, tm) }
155
- ty_rptr ( r, tm) { region_to_str ( cx, r) + mt_to_str ( cx, tm) }
164
+ ty_rptr ( r, tm) {
165
+ let rs = region_to_str ( cx, r) ;
166
+ if str:: len ( rs) == 1 u {
167
+ rs + mt_to_str ( cx, tm)
168
+ } else {
169
+ rs + "." + mt_to_str ( cx, tm)
170
+ }
171
+ }
156
172
ty_vec ( tm) { "[" + mt_to_str ( cx, tm) + "]" }
157
173
ty_type { "type" }
158
174
ty_rec ( elems) {
@@ -179,7 +195,16 @@ fn ty_to_str(cx: ctxt, typ: t) -> str {
179
195
let base = ast_map:: path_to_str( path) ;
180
196
parameterized( cx, base, tps)
181
197
}
182
- _ { ty_to_short_str( cx, typ) }
198
+ ty_evec( mt, vs) {
199
+ #fmt[ "[%s]/%s" , mt_to_str( cx, mt) ,
200
+ vstore_to_str( cx, vs) ]
201
+ }
202
+ ty_estr( vs) { #fmt[ "str/%s" , vstore_to_str( cx, vs) ] }
203
+ ty_opaque_box { "@?" }
204
+ ty_constr( t, _) { "@?" }
205
+ ty_opaque_closure_ptr( ck_block) { "closure&" }
206
+ ty_opaque_closure_ptr( ck_box) { "closure@" }
207
+ ty_opaque_closure_ptr( ck_uniq) { "closure~" }
183
208
}
184
209
}
185
210
0 commit comments