We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 223a8e1 commit deeb3ffCopy full SHA for deeb3ff
[refs]
@@ -1,2 +1,2 @@
1
---
2
-refs/heads/master: 5dba7a77d2c7396989262da3de5ea055bed151bc
+refs/heads/master: 2a241ece3a8fdaa536946b29eeab4524da164903
trunk/src/comp/middle/trans.rs
@@ -417,7 +417,17 @@ fn T_opaque_obj_ptr(type_names tn) -> TypeRef {
417
}
418
419
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.
424
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
+
431
ret type_of_inner(cx, t);
432
433
0 commit comments