@@ -90,7 +90,7 @@ fn print_crate(cm: &codemap, crate: @ast::crate, filename: str,
90
90
eof ( s. s ) ;
91
91
}
92
92
93
- fn ty_to_str ( ty : & ast:: ty ) -> str { be to_str ( ty, print_type) ; }
93
+ fn ty_to_str ( ty : & @ ast:: ty ) -> str { be to_str ( ty, print_type) ; }
94
94
95
95
fn pat_to_str ( pat : & @ast:: pat ) -> str { be to_str ( pat, print_pat) ; }
96
96
@@ -268,9 +268,7 @@ fn print_native_mod(s: &ps, nmod: &ast::native_mod,
268
268
for item: @ast:: native_item in nmod. items { print_native_item ( s, item) ; }
269
269
}
270
270
271
- fn print_boxed_type ( s : & ps , ty : & @ast:: ty ) { print_type ( s, * ty) ; }
272
-
273
- fn print_type ( s : & ps , ty : & ast:: ty ) {
271
+ fn print_type ( s : & ps , ty : & @ast:: ty ) {
274
272
maybe_print_comment ( s, ty. span . lo ) ;
275
273
ibox ( s, 0 u) ;
276
274
alt ty. node {
@@ -293,19 +291,19 @@ fn print_type(s: &ps, ty: &ast::ty) {
293
291
ast:: maybe_mut. { word_space ( s, "mutable?" ) ; }
294
292
ast:: imm. { }
295
293
}
296
- print_type ( s, * mt. ty ) ;
294
+ print_type ( s, mt. ty ) ;
297
295
word ( s. s , "]" ) ;
298
296
}
299
297
ast:: ty_ptr ( mt) { word ( s. s , "*" ) ; print_mt ( s, mt) ; }
300
298
ast:: ty_task. { word ( s. s , "task" ) ; }
301
299
ast:: ty_port ( t) {
302
300
word ( s. s , "port[" ) ;
303
- print_type ( s, * t) ;
301
+ print_type ( s, t) ;
304
302
word ( s. s , "]" ) ;
305
303
}
306
304
ast:: ty_chan ( t) {
307
305
word ( s. s , "chan[" ) ;
308
- print_type ( s, * t) ;
306
+ print_type ( s, t) ;
309
307
word ( s. s , "]" ) ;
310
308
}
311
309
ast:: ty_rec ( fields) {
@@ -315,7 +313,7 @@ fn print_type(s: &ps, ty: &ast::ty) {
315
313
print_mutability ( s, f. node . mt . mut ) ;
316
314
word ( s. s , f. node . ident ) ;
317
315
word_space ( s, ":" ) ;
318
- print_type ( s, * f. node . mt . ty ) ;
316
+ print_type ( s, f. node . mt . ty ) ;
319
317
end ( s) ;
320
318
}
321
319
fn get_span ( f : & ast:: ty_field ) -> codemap:: span { ret f. span ; }
@@ -324,7 +322,7 @@ fn print_type(s: &ps, ty: &ast::ty) {
324
322
}
325
323
ast:: ty_tup ( elts) {
326
324
popen ( s) ;
327
- commasep ( s, inconsistent, elts, print_boxed_type ) ;
325
+ commasep ( s, inconsistent, elts, print_type ) ;
328
326
pclose ( s) ;
329
327
}
330
328
ast:: ty_fn ( proto, inputs, output, cf, constrs) {
@@ -347,7 +345,7 @@ fn print_type(s: &ps, ty: &ast::ty) {
347
345
ast:: ty_path ( path, _) { print_path ( s, path) ; }
348
346
ast:: ty_type. { word ( s. s , "type" ) ; }
349
347
ast:: ty_constr ( t, cs) {
350
- print_type ( s, * t) ;
348
+ print_type ( s, t) ;
351
349
space ( s. s ) ;
352
350
word ( s. s , ast_ty_constrs_str ( cs) ) ;
353
351
}
@@ -396,7 +394,7 @@ fn print_item(s: &ps, item: &@ast::item) {
396
394
ast:: item_const ( ty, expr) {
397
395
head ( s, "const" ) ;
398
396
word_space ( s, item. ident + ":" ) ;
399
- print_type ( s, * ty) ;
397
+ print_type ( s, ty) ;
400
398
space ( s. s ) ;
401
399
end ( s) ; // end the head-ibox
402
400
@@ -451,7 +449,7 @@ fn print_item(s: &ps, item: &@ast::item) {
451
449
452
450
space ( s. s ) ;
453
451
word_space ( s, "=" ) ;
454
- print_type ( s, * ty) ;
452
+ print_type ( s, ty) ;
455
453
word ( s. s , ";" ) ;
456
454
end ( s) ; // end the outer ibox
457
455
}
@@ -469,7 +467,7 @@ fn print_item(s: &ps, item: &@ast::item) {
469
467
space ( s. s ) ;
470
468
if newtype {
471
469
word_space ( s, "=" ) ;
472
- print_type ( s, * variants. ( 0 ) . node . args . ( 0 ) . ty ) ;
470
+ print_type ( s, variants. ( 0 ) . node . args . ( 0 ) . ty ) ;
473
471
word ( s. s , ";" ) ;
474
472
end ( s) ;
475
473
} else {
@@ -481,7 +479,7 @@ fn print_item(s: &ps, item: &@ast::item) {
481
479
if ivec:: len ( v. node . args ) > 0 u {
482
480
popen ( s) ;
483
481
fn print_variant_arg ( s : & ps , arg : & ast:: variant_arg ) {
484
- print_type ( s, * arg. ty ) ;
482
+ print_type ( s, arg. ty ) ;
485
483
}
486
484
commasep ( s, consistent, v. node . args , print_variant_arg) ;
487
485
pclose ( s) ;
@@ -501,7 +499,7 @@ fn print_item(s: &ps, item: &@ast::item) {
501
499
ibox ( s, indent_unit) ;
502
500
print_mutability ( s, field. mut ) ;
503
501
word_space ( s, field. ident + ":" ) ;
504
- print_type ( s, * field. ty ) ;
502
+ print_type ( s, field. ty ) ;
505
503
end ( s) ;
506
504
}
507
505
fn get_span ( f : & ast:: obj_field ) -> codemap:: span { ret f. ty . span ; }
@@ -526,7 +524,7 @@ fn print_item(s: &ps, item: &@ast::item) {
526
524
print_type_params ( s, tps) ;
527
525
popen ( s) ;
528
526
word_space ( s, dt. decl . inputs . ( 0 ) . ident + ":" ) ;
529
- print_type ( s, * dt. decl . inputs . ( 0 ) . ty ) ;
527
+ print_type ( s, dt. decl . inputs . ( 0 ) . ty ) ;
530
528
pclose ( s) ;
531
529
space ( s. s ) ;
532
530
print_block ( s, dt. body ) ;
@@ -697,7 +695,7 @@ fn print_mac(s: &ps, m: &ast::mac) {
697
695
}
698
696
ast:: mac_embed_type ( ty) {
699
697
word ( s. s , "#<" ) ;
700
- print_type ( s, * ty) ;
698
+ print_type ( s, ty) ;
701
699
word ( s. s , ">" ) ;
702
700
}
703
701
ast:: mac_embed_block ( blk) {
@@ -803,7 +801,7 @@ fn print_expr(s: &ps, expr: &@ast::expr) {
803
801
print_maybe_parens ( s, expr, parse:: parser:: as_prec) ;
804
802
space ( s. s ) ;
805
803
word_space ( s, "as" ) ;
806
- print_type ( s, * ty) ;
804
+ print_type ( s, ty) ;
807
805
}
808
806
ast:: expr_if ( test, blk, elseopt) {
809
807
print_if ( s, test, blk, elseopt, false ) ;
@@ -981,7 +979,7 @@ fn print_expr(s: &ps, expr: &@ast::expr) {
981
979
word ( s. s , "port" ) ;
982
980
alt t. node {
983
981
ast:: ty_infer. { }
984
- _ { word( s. s , "[" ) ; print_type ( s, * t) ; word ( s. s , "]" ) ; }
982
+ _ { word( s. s , "[" ) ; print_type ( s, t) ; word ( s. s , "]" ) ; }
985
983
}
986
984
popen( s) ;
987
985
pclose ( s) ;
@@ -1001,7 +999,7 @@ fn print_expr(s: &ps, expr: &@ast::expr) {
1001
999
ibox ( s, indent_unit) ;
1002
1000
print_mutability ( s, field. mut ) ;
1003
1001
word_space ( s, field. ident + ":" ) ;
1004
- print_type ( s, * field. ty ) ;
1002
+ print_type ( s, field. ty ) ;
1005
1003
space ( s. s ) ;
1006
1004
word_space ( s, "=" ) ;
1007
1005
print_expr ( s, field. expr ) ;
@@ -1055,7 +1053,7 @@ fn print_local_decl(s: &ps, loc: &@ast::local) {
1055
1053
print_pat ( s, loc. node . pat ) ;
1056
1054
alt loc. node . ty . node {
1057
1055
ast:: ty_infer. { }
1058
- _ { word_space( s, ":" ) ; print_type ( s, * loc. node . ty ) ; }
1056
+ _ { word_space( s, ":" ) ; print_type ( s, loc. node . ty ) ; }
1059
1057
}
1060
1058
}
1061
1059
@@ -1108,7 +1106,7 @@ fn print_path(s: &ps, path: &ast::path) {
1108
1106
}
1109
1107
if ivec:: len ( path. node . types ) > 0 u {
1110
1108
word ( s. s , "[" ) ;
1111
- commasep ( s, inconsistent, path. node . types , print_boxed_type ) ;
1109
+ commasep ( s, inconsistent, path. node . types , print_type ) ;
1112
1110
word ( s. s , "]" ) ;
1113
1111
}
1114
1112
}
@@ -1174,7 +1172,7 @@ fn print_fn_args_and_ret(s: &ps, decl: &ast::fn_decl,
1174
1172
ibox ( s, indent_unit) ;
1175
1173
word_space ( s, x. ident + ":" ) ;
1176
1174
print_alias ( s, x. mode ) ;
1177
- print_type ( s, * x. ty ) ;
1175
+ print_type ( s, x. ty ) ;
1178
1176
end ( s) ;
1179
1177
}
1180
1178
commasep ( s, inconsistent, decl. inputs , print_arg) ;
@@ -1184,7 +1182,7 @@ fn print_fn_args_and_ret(s: &ps, decl: &ast::fn_decl,
1184
1182
if decl. output . node != ast:: ty_nil {
1185
1183
space_if_not_bol ( s) ;
1186
1184
word_space ( s, "->" ) ;
1187
- print_type ( s, * decl. output ) ;
1185
+ print_type ( s, decl. output ) ;
1188
1186
}
1189
1187
}
1190
1188
@@ -1316,7 +1314,7 @@ fn print_mutability(s: &ps, mut: &ast::mutability) {
1316
1314
1317
1315
fn print_mt ( s : & ps , mt : & ast:: mt ) {
1318
1316
print_mutability ( s, mt. mut ) ;
1319
- print_type ( s, * mt. ty ) ;
1317
+ print_type ( s, mt. ty ) ;
1320
1318
}
1321
1319
1322
1320
fn print_ty_fn ( s : & ps , proto : & ast:: proto , id : & option:: t [ str ] ,
@@ -1329,7 +1327,7 @@ fn print_ty_fn(s: &ps, proto: &ast::proto, id: &option::t[str],
1329
1327
popen ( s) ;
1330
1328
fn print_arg ( s : & ps , input : & ast:: ty_arg ) {
1331
1329
print_alias ( s, input. node . mode ) ;
1332
- print_type ( s, * input. node . ty ) ;
1330
+ print_type ( s, input. node . ty ) ;
1333
1331
}
1334
1332
commasep ( s, inconsistent, inputs, print_arg) ;
1335
1333
pclose ( s) ;
@@ -1339,7 +1337,7 @@ fn print_ty_fn(s: &ps, proto: &ast::proto, id: &option::t[str],
1339
1337
ibox ( s, indent_unit) ;
1340
1338
word_space ( s, "->" ) ;
1341
1339
alt cf {
1342
- ast : : return . { print_type ( s, * output) ; }
1340
+ ast : : return . { print_type ( s, output) ; }
1343
1341
ast:: noreturn. { word_nbsp ( s, "!" ) ; }
1344
1342
}
1345
1343
end ( s) ;
0 commit comments