Skip to content

Commit 2855847

Browse files
committed
---
yaml --- r: 4541 b: refs/heads/master c: a8a4d4e h: refs/heads/master i: 4539: 9bd8bbf v: v3
1 parent 24c9b82 commit 2855847

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
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: 6b756c4b4a0f632e537cdfd2c0ac63cea357c8ad
2+
refs/heads/master: a8a4d4ec056b68ac25a04ea020cdc674527a76df

trunk/src/comp/middle/trans.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,16 @@ fn get_tydesc(cx: &@block_ctxt, orig_t: &ty::t, escapes: bool,
995995

996996
// Is the supplied type a type param? If so, return the passed-in tydesc.
997997
alt ty::type_param(bcx_tcx(cx), t) {
998-
some(id) { ret rslt(cx, cx.fcx.lltydescs.(id)); }
998+
some(id) {
999+
if id < std::ivec::len(cx.fcx.lltydescs) {
1000+
ret rslt(cx, cx.fcx.lltydescs.(id));
1001+
}
1002+
else {
1003+
bcx_tcx(cx).sess.span_bug(cx.sp, "Unbound typaram in get_tydesc: "
1004+
+ "orig_t = " + ty_to_str(bcx_tcx(cx), orig_t)
1005+
+ " ty_param = " + std::uint::str(id));
1006+
}
1007+
}
9991008
none. {/* fall through */ }
10001009
}
10011010

@@ -4517,7 +4526,9 @@ fn trans_arg_expr(cx: &@block_ctxt, arg: &ty::arg,
45174526
// Collect arg for later if it happens to be one we've moving out.
45184527
if arg.mode == ty::mo_move {
45194528
if lv.is_mem {
4520-
to_zero += ~[{v: lv.res.val, t: arg.ty}];
4529+
// Use actual ty, not declared ty -- anything else doesn't make sense
4530+
// if declared ty is a ty param
4531+
to_zero += ~[{v: lv.res.val, t: e_ty}];
45214532
} else {
45224533
to_revoke += ~[lv.res.val];
45234534
}
@@ -4668,7 +4679,7 @@ fn trans_call(cx: &@block_ctxt, f: &@ast::expr,
46684679
/*
46694680
log "calling: " + val_str(bcx_ccx(cx).tn, faddr);
46704681
4671-
for (ValueRef arg in llargs) {
4682+
for arg: ValueRef in llargs {
46724683
log "arg: " + val_str(bcx_ccx(cx).tn, arg);
46734684
}
46744685
*/

trunk/src/test/run-fail/bug-811.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// error-pattern:quux
2+
fn test00_start(ch: chan_t[int], message: int) {
3+
send(ch, message);
4+
}
5+
6+
type task_id = int;
7+
type port_id = int;
8+
9+
type chan_t[~T] = {
10+
task : task_id,
11+
port : port_id
12+
};
13+
14+
fn send[~T](ch : chan_t[T], data : -T) { fail; }
15+
16+
fn main() { fail "quux"; }

0 commit comments

Comments
 (0)