Skip to content

Commit 0d92fec

Browse files
committed
---
yaml --- r: 15604 b: refs/heads/try c: dfdca5d h: refs/heads/master v: v3
1 parent 5a5c1f2 commit 0d92fec

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 512927573e08aba67832146a6097c8f6142f4fd4
5+
refs/heads/try: dfdca5d538d9cb89f50f0d9bdd8f9ba649c1c788
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rustc/middle/trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2341,7 +2341,7 @@ fn trans_callee(bcx: block, e: @ast::expr) -> lval_maybe_callee {
23412341
let _icx = bcx.insn_ctxt("trans_callee");
23422342
alt e.node {
23432343
ast::expr_path(path) { ret trans_path(bcx, e.id); }
2344-
ast::expr_field(base, ident, _) {
2344+
ast::expr_field(base, _, _) {
23452345
// Lval means this is a record field, so not a method
23462346
if !expr_is_lval(bcx, e) {
23472347
alt bcx.ccx().maps.method_map.find(e.id) {

branches/try/src/rustc/middle/trans/impl.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,15 @@ fn method_with_name(ccx: @crate_ctxt, impl_id: ast::def_id,
9595
}
9696
}
9797

98-
fn method_ty_param_count(ccx: @crate_ctxt, m_id: ast::def_id) -> uint {
98+
fn method_ty_param_count(ccx: @crate_ctxt, m_id: ast::def_id,
99+
i_id: ast::def_id) -> uint {
99100
if m_id.crate == ast::local_crate {
100101
alt check ccx.tcx.items.get(m_id.node) {
101102
ast_map::node_method(m, _, _) { vec::len(m.tps) }
102103
}
103104
} else {
104-
csearch::get_type_param_count(ccx.sess.cstore, m_id)
105+
csearch::get_type_param_count(ccx.sess.cstore, m_id) -
106+
csearch::get_type_param_count(ccx.sess.cstore, i_id)
105107
}
106108
}
107109

@@ -115,7 +117,7 @@ fn trans_monomorphized_callee(bcx: block, callee_id: ast::node_id,
115117
let ccx = bcx.ccx();
116118
let mname = ty::iface_methods(ccx.tcx, iface_id)[n_method].ident;
117119
let mth_id = method_with_name(bcx.ccx(), impl_did, mname);
118-
let n_m_tps = method_ty_param_count(ccx, mth_id);
120+
let n_m_tps = method_ty_param_count(ccx, mth_id, impl_did);
119121
let node_substs = node_id_type_params(bcx, callee_id);
120122
let ty_substs = impl_substs +
121123
vec::tailn(node_substs, node_substs.len() - n_m_tps);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import iter::*;
2+
3+
fn main() {
4+
let range = bind uint::range(0u, 1000u, _);
5+
let filt = bind iter::filter(range, {|&&n: uint| n % 3u != 0u && n % 5u != 0u }, _);
6+
let sum = iter::foldl(filt, 0u) {|accum, &&n: uint| accum + n };
7+
8+
io::println(#fmt("%u", sum));
9+
}

0 commit comments

Comments
 (0)