Skip to content

Commit 7278aea

Browse files
committed
---
yaml --- r: 7018 b: refs/heads/master c: 439e28b h: refs/heads/master v: v3
1 parent a0ed110 commit 7278aea

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
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: 72a3667eb30705826a99bfa2b9478c4037589dbc
2+
refs/heads/master: 439e28b7510919e2ff69c82acef387d08cd1e947

trunk/src/comp/middle/trans.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ fn type_of_inner(cx: @crate_ctxt, sp: span, t: ty::t)
208208
ty::ty_opaque_closure. {
209209
T_opaque_closure(cx)
210210
}
211+
ty::ty_constr(subt,_) {
212+
// FIXME: could be a constraint on ty_fn
213+
check non_ty_var(cx, subt);
214+
type_of_inner(cx, sp, subt)
215+
}
211216
_ {
212217
fail "type_of_inner not implemented for this kind of type";
213218
}

trunk/src/comp/middle/ty.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,12 @@ fn fold_ty(cx: ctxt, fld: fold_mode, ty_0: t) -> t {
818818
ty_param(id, did) {
819819
alt fld { fm_param(folder) { ty = folder(id, did); } _ {} }
820820
}
821+
ty_constr(subty, cs) {
822+
ty = mk_constr(cx, fold_ty(cx, fld, subty), cs);
823+
}
824+
_ {
825+
cx.sess.fatal("Unsupported sort of type in fold_ty");
826+
}
821827
}
822828

823829
// If this is a general type fold, then we need to run it now.

trunk/src/test/run-pass/issue-970.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
tag maybe_ordered_pair {
2+
yes({low: int, high: int} : less_than(*.low, *.high));
3+
no;
4+
}
5+
pure fn less_than(x: int, y: int) -> bool { ret x < y; }
6+
fn main() { }

0 commit comments

Comments
 (0)