diff options
Diffstat (limited to 'src/comp/util/common.rs')
| -rw-r--r-- | src/comp/util/common.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/comp/util/common.rs b/src/comp/util/common.rs index cbf7aadf..a5b77c0e 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 |