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 5dba7a7 commit 2a241ecCopy full SHA for 2a241ec
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