diff options
| author | Patrick Walton <[email protected]> | 2011-04-15 18:14:29 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-04-15 18:14:29 -0700 |
| commit | 0c288720b6d02f67a6f8002041a305f1986abc5c (patch) | |
| tree | 02bf7928870af373db76c5256399e810012fe8d8 /src/test | |
| parent | rustc: Use a regular vector instead of a hash table for type descriptors (diff) | |
| download | rust-0c288720b6d02f67a6f8002041a305f1986abc5c.tar.xz rust-0c288720b6d02f67a6f8002041a305f1986abc5c.zip | |
rustc: Capture type parameters into for-each blocks. Add a test case.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/type-params-in-for-each.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/run-pass/type-params-in-for-each.rs b/src/test/run-pass/type-params-in-for-each.rs new file mode 100644 index 00000000..74f69aca --- /dev/null +++ b/src/test/run-pass/type-params-in-for-each.rs @@ -0,0 +1,11 @@ +use std; +import std._uint; + +fn create_index[T](vec[tup(T, uint)] index, fn(&T) -> uint hash_fn) { + for each (uint i in _uint.range(0u, 256u)) { + let vec[T] bucket = vec(); + } +} + +fn main() {} + |