Skip to content

Commit d16e12a

Browse files
committed
---
yaml --- r: 3760 b: refs/heads/master c: 36c4cb3 h: refs/heads/master v: v3
1 parent 6ba8d8b commit d16e12a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
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: 91d45b91e64c4db6f07b9dd21837dac84f0a1255
2+
refs/heads/master: 36c4cb37ad3d96897f229f2af48c76c018bb680e

trunk/src/comp/middle/ty.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -959,16 +959,17 @@ fn type_is_tup_like(&ctxt cx, &t ty) -> bool {
959959
}
960960

961961
fn get_element_type(&ctxt cx, &t ty, uint i) -> t {
962-
assert (type_is_tup_like(cx, ty));
963962
alt (struct(cx, ty)) {
964963
case (ty_tup(?mts)) { ret mts.(i).ty; }
965964
case (ty_rec(?flds)) { ret flds.(i).mt.ty; }
965+
case (_) {
966+
cx.sess.bug("get_element_type called on type "
967+
+ ty_to_str(cx, ty) + " - expected a \
968+
tuple or record");
969+
}
966970
}
967971
// NB: This is not exhaustive -- struct(cx, ty) could be a box or a
968972
// tag.
969-
970-
cx.sess.bug("get_element_type called on a value other than a " +
971-
"tuple or record");
972973
}
973974

974975
fn type_is_box(&ctxt cx, &t ty) -> bool {

0 commit comments

Comments
 (0)