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 3f3a121 commit daac7a8Copy full SHA for daac7a8
src/comp/middle/ty.rs
@@ -379,6 +379,27 @@ fn type_is_scalar(@t ty) -> bool {
379
fail;
380
}
381
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
393
+ while (i < _vec.len[field](fields)) {
394
+ if (type_has_dynamic_size(fields.(i).ty)) { ret true; }
395
396
397
398
+ case (ty_param(_)) { ret true; }
399
+ case (_) { /* fall through */ }
400
401
+ ret false;
402
+}
403
404
fn type_is_integral(@t ty) -> bool {
405
alt (ty.struct) {
0 commit comments