提交 1f8f6054 编写于 作者: B Brian Anderson

rustc: Box tag variants to avoid copies

上级 26db74c8
......@@ -244,7 +244,7 @@ fn get_tag_variants(_data: @[u8], def: ast::def_id, tcx: ty::ctxt,
}
}
infos += [{args: arg_tys, ctor_ty: ctor_ty, id: did}];
infos += [@{args: arg_tys, ctor_ty: ctor_ty, id: did}];
}
ret infos;
}
......
......@@ -2721,7 +2721,7 @@ fn def_has_ty_params(def: ast::def) -> bool {
// Tag information
type variant_info = {args: [ty::t], ctor_ty: ty::t, id: ast::def_id};
type variant_info = @{args: [ty::t], ctor_ty: ty::t, id: ast::def_id};
fn tag_variants(cx: ctxt, id: ast::def_id) -> @mutable [variant_info] {
if ast::local_crate != id.crate {
......@@ -2752,9 +2752,9 @@ fn tag_variants(cx: ctxt, id: ast::def_id) -> @mutable [variant_info] {
}
let did = variant.node.id;
*result +=
[{args: arg_tys,
ctor_ty: ctor_ty,
id: ast_util::local_def(did)}];
[@{args: arg_tys,
ctor_ty: ctor_ty,
id: ast_util::local_def(did)}];
}
smallintmap::insert(*cx.tag_var_cache, id.node as uint, result);
ret result;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册