diff options
| author | Roy Frostig <[email protected]> | 2010-08-12 16:21:08 -0700 |
|---|---|---|
| committer | Roy Frostig <[email protected]> | 2010-08-12 16:21:08 -0700 |
| commit | 4e376852e709844d67f94430d9dc954d5be722b4 (patch) | |
| tree | fb23b6a4ffc16914b89ab161ad4ace54c1a2b7ff /src/test | |
| parent | Address FIXME in _vec waiting on closed issue #108. (diff) | |
| download | rust-4e376852e709844d67f94430d9dc954d5be722b4.tar.xz rust-4e376852e709844d67f94430d9dc954d5be722b4.zip | |
Fix max_sz bug that ended up causing us to index incorrectly into a vec of tag types. Add a testcase.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/size-and-align.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/run-pass/size-and-align.rs b/src/test/run-pass/size-and-align.rs new file mode 100644 index 00000000..94fa3bc1 --- /dev/null +++ b/src/test/run-pass/size-and-align.rs @@ -0,0 +1,18 @@ +// -*- rust -*- + +use std; +import std._vec; + +type clam[T] = tag(a(T, int), b()); + +fn uhoh[T](vec[clam[T]] v) { + alt (v.(1)) { + case (a[T](t, u)) { log "incorrect"; log u; fail; } + case (b[T]()) { log "correct"; } + } +} + +fn main() { + let vec[clam[int]] v = vec(b[int](), b[int](), a[int](42, 17)); + uhoh[int](v); +} |