Skip to content

Commit deeb3ff

Browse files
committed
---
yaml --- r: 1499 b: refs/heads/master c: 2a241ec h: refs/heads/master i: 1497: f316cde 1495: b179414 v: v3
1 parent 223a8e1 commit deeb3ff

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-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: 5dba7a77d2c7396989262da3de5ea055bed151bc
2+
refs/heads/master: 2a241ece3a8fdaa536946b29eeab4524da164903

trunk/src/comp/middle/trans.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,17 @@ fn T_opaque_obj_ptr(type_names tn) -> TypeRef {
417417
}
418418

419419

420+
// This function now fails if called on a type with dynamic size (as its
421+
// return value was always meaningless in that case anyhow). Beware!
422+
//
423+
// TODO: Enforce via a predicate.
420424
fn type_of(@crate_ctxt cx, @ty.t t) -> TypeRef {
425+
if (ty.type_has_dynamic_size(t)) {
426+
log "type_of() called on a type with dynamic size: " +
427+
ty.ty_to_str(t);
428+
fail;
429+
}
430+
421431
ret type_of_inner(cx, t);
422432
}
423433

0 commit comments

Comments
 (0)