rustc: Mark tags that have subtypes with dynamic size as dynamic

This commit is contained in:
Patrick Walton 2011-02-28 19:07:26 -08:00
parent 687d328d7c
commit 8d8b3d985a

View file

@ -471,6 +471,13 @@ fn type_has_dynamic_size(@t ty) -> bool {
i += 1u;
}
}
case (ty_tag(_, ?subtys)) {
auto i = 0u;
while (i < _vec.len[@t](subtys)) {
if (type_has_dynamic_size(subtys.(i))) { ret true; }
i += 1u;
}
}
case (ty_param(_)) { ret true; }
case (_) { /* fall through */ }
}