Skip to content

Commit aa000d2

Browse files
committed
---
yaml --- r: 1138 b: refs/heads/master c: daac7a8 h: refs/heads/master v: v3
1 parent cdf9d75 commit aa000d2

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-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: 3f3a121043f72a1662f0b0ad24ca2fd09f4b4f27
2+
refs/heads/master: daac7a8b130f8f2dfbdeaf38ff39541adfd74736

trunk/src/comp/middle/ty.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,27 @@ fn type_is_scalar(@t ty) -> bool {
379379
fail;
380380
}
381381

382+
fn type_has_dynamic_size(@t ty) -> bool {
383+
alt (ty.struct) {
384+
case (ty_tup(?ts)) {
385+
auto i = 0u;
386+
while (i < _vec.len[@t](ts)) {
387+
if (type_has_dynamic_size(ts.(i))) { ret true; }
388+
i += 1u;
389+
}
390+
}
391+
case (ty_rec(?fields)) {
392+
auto i = 0u;
393+
while (i < _vec.len[field](fields)) {
394+
if (type_has_dynamic_size(fields.(i).ty)) { ret true; }
395+
i += 1u;
396+
}
397+
}
398+
case (ty_param(_)) { ret true; }
399+
case (_) { /* fall through */ }
400+
}
401+
ret false;
402+
}
382403

383404
fn type_is_integral(@t ty) -> bool {
384405
alt (ty.struct) {

0 commit comments

Comments
 (0)