提交 47d650e2 编写于 作者: P Patrick Walton

rustc: Box the tuples returned by hashmap.items() for now since we don't have alias iterators yet

上级 ebee4931
......@@ -5698,7 +5698,7 @@ fn find_main_fn(@crate_ctxt cx) -> ValueRef {
auto e = sep() + "main";
let ValueRef v = C_nil();
let uint n = 0u;
for each (tup(str,ValueRef) i in cx.item_names.items()) {
for each (@tup(str,ValueRef) i in cx.item_names.items()) {
if (_str.ends_with(i._0, e)) {
n += 1u;
v = i._1;
......
......@@ -14,7 +14,7 @@
fn find(&K key) -> option.t[V];
fn remove(&K key) -> option.t[V];
fn rehash();
iter items() -> tup(K,V);
iter items() -> @tup(K,V);
};
fn mk_hashmap[K, V](&hashfn[K] hasher, &eqfn[K] eqer) -> hashmap[K, V] {
......@@ -216,11 +216,11 @@ fn rehash() {
bkts = newbkts;
}
iter items() -> tup(K,V) {
iter items() -> @tup(K,V) {
for (bucket[K,V] b in bkts) {
alt (b) {
case(some[K,V](?k,?v)) {
put tup(k,v);
put @tup(k,v);
}
case (_) { }
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册