aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-04-15 18:14:29 -0700
committerPatrick Walton <[email protected]>2011-04-15 18:14:29 -0700
commit0c288720b6d02f67a6f8002041a305f1986abc5c (patch)
tree02bf7928870af373db76c5256399e810012fe8d8 /src/test
parentrustc: Use a regular vector instead of a hash table for type descriptors (diff)
downloadrust-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.rs11
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() {}
+