about summary refs log tree commit diff
path: root/src/comp/util
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2010-10-18 18:19:16 -0700
committerGraydon Hoare <graydon@mozilla.com>2010-10-18 18:19:16 -0700
commit4a3edb320dd515fd98431997d4bdb1ffa31446bd (patch)
tree40c4741c51e070a326cbc7643657cd288260bcbb /src/comp/util
parent865bbae685fbf9bd1583a3f1715dd8093c0cbda2 (diff)
downloadrust-4a3edb320dd515fd98431997d4bdb1ffa31446bd.tar.gz
rust-4a3edb320dd515fd98431997d4bdb1ffa31446bd.zip
Store items and decls in vecs to preserve input order, index externally. Implement block-local name lookup.
Diffstat (limited to 'src/comp/util')
-rw-r--r--src/comp/util/common.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/comp/util/common.rs b/src/comp/util/common.rs
index cbf7aadfa51..a5b77c0e793 100644
--- a/src/comp/util/common.rs
+++ b/src/comp/util/common.rs
@@ -47,6 +47,15 @@ fn istr(int i) -> str {
     ret _int.to_str(i, 10u);
 }
 
+
+// FIXME: Weird bug. Due to the way we auto-deref + in +=, we can't append a
+// boxed value to a vector-of-boxes using +=.  Best to figure out a way to fix
+// this. Deref-on-demand or something? It's a hazard of the ambiguity between
+// single-element and vector append.
+fn append[T](&vec[T] v, &T t) {
+    v += t;
+}
+
 //
 // Local Variables:
 // mode: rust