1
-
2
1
import syntax:: ast;
3
2
import ast:: mutability;
4
3
import ast:: local_def;
@@ -186,8 +185,8 @@ fn instantiate_path(&@fn_ctxt fcx, &ast::path pth, &ty_param_count_and_ty tpt,
186
185
ty_substs_opt = some[ ty:: t[ ] ] ( ty_substs) ;
187
186
if ( ty_param_count == 0 u) {
188
187
fcx. ccx . tcx . sess . span_fatal ( sp,
189
- "this item does not take type " +
190
- " parameters") ;
188
+ "this item does not take type \
189
+ parameters") ;
191
190
fail;
192
191
}
193
192
} else {
@@ -1527,10 +1526,9 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
1527
1526
fn check_call_or_bind( & @fn_ctxt fcx, & span sp, & @ast:: expr f,
1528
1527
& ( option:: t[ @ast:: expr] ) [ ] args, call_kind call_kind) {
1529
1528
// Check the function.
1530
-
1531
1529
check_expr( fcx, f) ;
1532
- // Get the function type.
1533
1530
1531
+ // Get the function type.
1534
1532
auto fty = expr_ty( fcx. ccx. tcx, f) ;
1535
1533
1536
1534
// We want to autoderef calls but not binds
@@ -1551,8 +1549,8 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
1551
1549
+ ty_to_str( fcx. ccx. tcx, fty) ) ;
1552
1550
}
1553
1551
}
1554
- // Check that the correct number of arguments were supplied.
1555
1552
1553
+ // Check that the correct number of arguments were supplied.
1556
1554
auto expected_arg_count = ivec:: len[ ty:: arg] ( arg_tys) ;
1557
1555
auto supplied_arg_count = ivec:: len[ option:: t[ @ast:: expr] ] ( args) ;
1558
1556
if ( expected_arg_count != supplied_arg_count) {
@@ -1568,9 +1566,9 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
1568
1566
" was"
1569
1567
} else { "s were" } ) ) ;
1570
1568
}
1569
+
1571
1570
// Check the arguments.
1572
1571
// TODO: iter2
1573
-
1574
1572
auto i = 0 u;
1575
1573
for ( option:: t[ @ast:: expr] a_opt in args) {
1576
1574
auto check_ty_vars = call_kind == kind_spawn;
@@ -2486,9 +2484,9 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
2486
2484
auto ot = ty:: mk_obj( fcx. ccx. tcx, ty:: sort_methods( method_types) ) ;
2487
2485
2488
2486
write:: ty_only_fixup( fcx, id, ot) ;
2487
+
2489
2488
// Write the methods into the node type table. (This happens in
2490
2489
// collect::convert for regular objects.)
2491
-
2492
2490
auto i = 0 u;
2493
2491
while ( i < ivec:: len[ @ast:: method ] ( ao. methods ) ) {
2494
2492
write:: ty_only ( fcx. ccx . tcx , ao. methods . ( i) . node . id ,
@@ -2569,7 +2567,7 @@ fn check_decl_local(&@fn_ctxt fcx, &@ast::local local) {
2569
2567
alt ( fcx. locals . find ( a_id) ) {
2570
2568
case ( none) {
2571
2569
fcx. ccx . tcx . sess . bug ( "check_decl_local: local id not found " +
2572
- local. node . ident ) ;
2570
+ local. node . ident ) ;
2573
2571
}
2574
2572
case ( some ( ?i) ) {
2575
2573
auto t = ty:: mk_var ( fcx. ccx . tcx , i) ;
@@ -2650,12 +2648,11 @@ fn check_fn(&@crate_ctxt ccx, &ast::_fn f, &ast::node_id id) {
2650
2648
check_block ( fcx, body) ;
2651
2649
alt ( decl. purity ) {
2652
2650
case ( ast:: pure_fn) {
2653
-
2654
- // per the previous comment, this just checks that the declared
2655
- // type is bool, and trusts that that's the actual return type.
2651
+ // This just checks that the declared type is bool, and trusts
2652
+ // that that's the actual return type.
2656
2653
if ( !ty:: type_is_bool ( ccx. tcx , fcx. ret_ty ) ) {
2657
2654
ccx. tcx . sess . span_fatal ( body. span ,
2658
- "Non-boolean return type in pred" ) ;
2655
+ "Non-boolean return type in pred" ) ;
2659
2656
}
2660
2657
}
2661
2658
case ( _) { }
0 commit comments