Skip to content

Commit cfa1ca9

Browse files
committed
---
yaml --- r: 4648 b: refs/heads/master c: 8e92be3 h: refs/heads/master v: v3
1 parent d21e8ca commit cfa1ca9

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
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: c01e48748504934e27ac89b2ca12d7d626e3be42
2+
refs/heads/master: 8e92be3b94d4e2051bf132028ac3bcb6af4ad644

trunk/src/comp/middle/trans.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3316,8 +3316,6 @@ fn autoderef(cx: &@block_ctxt, v: ValueRef, t: &ty::t) -> result_t {
33163316

33173317
fn trans_binary(cx: &@block_ctxt, op: ast::binop, a: &@ast::expr,
33183318
b: &@ast::expr) -> result {
3319-
3320-
33213319
// First couple cases are lazy:
33223320
alt op {
33233321
ast::and. {
@@ -3333,11 +3331,11 @@ fn trans_binary(cx: &@block_ctxt, op: ast::binop, a: &@ast::expr,
33333331
ty::expr_ty(bcx_tcx(cx), b));
33343332
let lhs_false_cx = new_scope_block_ctxt(cx, "lhs false");
33353333
let lhs_false_res = rslt(lhs_false_cx, C_bool(false));
3334+
33363335
// The following line ensures that any cleanups for rhs
33373336
// are done within the block for rhs. This is necessary
33383337
// because and/or are lazy. So the rhs may never execute,
33393338
// and the cleanups can't be pushed into later code.
3340-
33413339
let rhs_bcx = trans_block_cleanups(rhs_res.bcx, rhs_cx);
33423340
lhs_res.bcx.build.CondBr(lhs_res.val, rhs_cx.llbb, lhs_false_cx.llbb);
33433341
ret join_results(cx, T_bool(),
@@ -3356,8 +3354,8 @@ fn trans_binary(cx: &@block_ctxt, op: ast::binop, a: &@ast::expr,
33563354
ty::expr_ty(bcx_tcx(cx), b));
33573355
let lhs_true_cx = new_scope_block_ctxt(cx, "lhs true");
33583356
let lhs_true_res = rslt(lhs_true_cx, C_bool(true));
3359-
// see the and case for an explanation
33603357

3358+
// see the and case for an explanation
33613359
let rhs_bcx = trans_block_cleanups(rhs_res.bcx, rhs_cx);
33623360
lhs_res.bcx.build.CondBr(lhs_res.val, lhs_true_cx.llbb, rhs_cx.llbb);
33633361
ret join_results(cx, T_bool(),

trunk/src/comp/middle/typeck.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,6 @@ mod collect {
883883

884884

885885
// Type unification
886-
887886
mod unify {
888887
fn unify(fcx: &@fn_ctxt, expected: &ty::t, actual: &ty::t) ->
889888
ty::unify::result {
@@ -1009,12 +1008,12 @@ mod demand {
10091008
} else if (adk == AUTODEREF_BLOCK_COERCE) {
10101009
actual_1 = do_fn_block_coerce(fcx, sp, actual, expected);
10111010
}
1011+
10121012
let ty_param_substs: [mutable ty::t] = ~[mutable];
10131013
let ty_param_subst_var_ids: [int] = ~[];
10141014
for ty_param_subst: ty::t in ty_param_substs_0 {
10151015
// Generate a type variable and unify it with the type parameter
10161016
// substitution. We will then pull out these type variables.
1017-
10181017
let t_0 = next_ty_var(fcx);
10191018
ty_param_substs += ~[mutable t_0];
10201019
ty_param_subst_var_ids += ~[ty::ty_var_id(fcx.ccx.tcx, t_0)];
@@ -1370,12 +1369,11 @@ fn check_pat(fcx: &@fn_ctxt, map: &ast::pat_id_map, pat: &@ast::pat,
13701369
let v_def_ids = ast::variant_def_ids(v_def);
13711370
let tag_tpt = ty::lookup_item_type(fcx.ccx.tcx, v_def_ids.tg);
13721371
let path_tpot = instantiate_path(fcx, path, tag_tpt, pat.span);
1373-
// Take the tag type params out of `expected`.
13741372

1373+
// Take the tag type params out of `expected`.
13751374
alt structure_of(fcx, pat.span, expected) {
13761375
ty::ty_tag(_, expected_tps) {
13771376
// Unify with the expected tag type.
1378-
13791377
let ctor_ty =
13801378
ty::ty_param_substs_opt_and_ty_to_monotype(fcx.ccx.tcx,
13811379
path_tpot);
@@ -1385,8 +1383,8 @@ fn check_pat(fcx: &@fn_ctxt, map: &ast::pat_id_map, pat: &@ast::pat,
13851383
NO_AUTODEREF);
13861384
path_tpot =
13871385
{substs: some[[ty::t]](path_tpt.substs), ty: path_tpt.ty};
1388-
// Get the number of arguments in this tag variant.
13891386

1387+
// Get the number of arguments in this tag variant.
13901388
let arg_types =
13911389
variant_arg_types(fcx.ccx, pat.span, v_def_ids.var,
13921390
expected_tps);
@@ -1417,9 +1415,6 @@ fn check_pat(fcx: &@fn_ctxt, map: &ast::pat_id_map, pat: &@ast::pat,
14171415
}
14181416
} else if (subpats_len > 0u) {
14191417
// TODO: note definition of tag variant
1420-
// TODO (issue #448): Wrap a #fmt string over multiple
1421-
// lines...
1422-
14231418
fcx.ccx.tcx.sess.span_fatal
14241419
(pat.span, #fmt("this pattern has %u field%s, \
14251420
but the corresponding \

0 commit comments

Comments
 (0)