Skip to content

Commit cb21119

Browse files
committed
---
yaml --- r: 4012 b: refs/heads/master c: 64fb39c h: refs/heads/master v: v3
1 parent 9381676 commit cb21119

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: bd4aeef78bcc8e03ef9275e7652f91b936f5dec6
2+
refs/heads/master: 64fb39cdd3fb1f3bf1ea484112b96983e4ba5c2c

trunk/src/comp/middle/typeck.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import syntax::ast;
32
import ast::mutability;
43
import ast::local_def;
@@ -186,8 +185,8 @@ fn instantiate_path(&@fn_ctxt fcx, &ast::path pth, &ty_param_count_and_ty tpt,
186185
ty_substs_opt = some[ty::t[]](ty_substs);
187186
if (ty_param_count == 0u) {
188187
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");
191190
fail;
192191
}
193192
} else {
@@ -1527,10 +1526,9 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
15271526
fn check_call_or_bind(&@fn_ctxt fcx, &span sp, &@ast::expr f,
15281527
&(option::t[@ast::expr])[] args, call_kind call_kind) {
15291528
// Check the function.
1530-
15311529
check_expr(fcx, f);
1532-
// Get the function type.
15331530

1531+
// Get the function type.
15341532
auto fty = expr_ty(fcx.ccx.tcx, f);
15351533

15361534
// We want to autoderef calls but not binds
@@ -1551,8 +1549,8 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
15511549
+ ty_to_str(fcx.ccx.tcx, fty));
15521550
}
15531551
}
1554-
// Check that the correct number of arguments were supplied.
15551552

1553+
// Check that the correct number of arguments were supplied.
15561554
auto expected_arg_count = ivec::len[ty::arg](arg_tys);
15571555
auto supplied_arg_count = ivec::len[option::t[@ast::expr]](args);
15581556
if (expected_arg_count != supplied_arg_count) {
@@ -1568,9 +1566,9 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
15681566
" was"
15691567
} else { "s were" }));
15701568
}
1569+
15711570
// Check the arguments.
15721571
// TODO: iter2
1573-
15741572
auto i = 0u;
15751573
for (option::t[@ast::expr] a_opt in args) {
15761574
auto check_ty_vars = call_kind == kind_spawn;
@@ -2486,9 +2484,9 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
24862484
auto ot = ty::mk_obj(fcx.ccx.tcx, ty::sort_methods(method_types));
24872485

24882486
write::ty_only_fixup(fcx, id, ot);
2487+
24892488
// Write the methods into the node type table. (This happens in
24902489
// collect::convert for regular objects.)
2491-
24922490
auto i = 0u;
24932491
while (i < ivec::len[@ast::method](ao.methods)) {
24942492
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) {
25692567
alt (fcx.locals.find(a_id)) {
25702568
case (none) {
25712569
fcx.ccx.tcx.sess.bug("check_decl_local: local id not found " +
2572-
local.node.ident);
2570+
local.node.ident);
25732571
}
25742572
case (some(?i)) {
25752573
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) {
26502648
check_block(fcx, body);
26512649
alt (decl.purity) {
26522650
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.
26562653
if (!ty::type_is_bool(ccx.tcx, fcx.ret_ty)) {
26572654
ccx.tcx.sess.span_fatal(body.span,
2658-
"Non-boolean return type in pred");
2655+
"Non-boolean return type in pred");
26592656
}
26602657
}
26612658
case (_) { }

0 commit comments

Comments
 (0)