Adjust function signatures to allow for vecs being immediate

Some code was relying on vectors being implicitly by-reference (as
non-immediate value). This adds the necessary &&-sigils.

Closes #1021
This commit is contained in:
Marijn Haverbeke 2011-10-10 13:54:03 +02:00
parent b4bae8fea5
commit 33167f7dec
15 changed files with 34 additions and 38 deletions

View file

@ -245,7 +245,7 @@ fn follow_for_trans(cx: ext_ctxt, mmaybe: option::t<arb_depth<matchable>>,
/* helper for transcribe_exprs: what vars from `b` occur in `e`? */
iter free_vars(b: bindings, e: @expr) -> ident {
let idents: hashmap<ident, ()> = new_str_hash::<()>();
fn mark_ident(i: ident, _fld: ast_fold, b: bindings,
fn mark_ident(&&i: ident, _fld: ast_fold, b: bindings,
idents: hashmap<ident, ()>) -> ident {
if b.contains_key(i) { idents.insert(i, ()); }
ret i;
@ -325,7 +325,7 @@ fn transcribe_exprs(cx: ext_ctxt, b: bindings, idx_path: @mutable [uint],
// substitute, in a position that's required to be an ident
fn transcribe_ident(cx: ext_ctxt, b: bindings, idx_path: @mutable [uint],
i: ident, _fld: ast_fold) -> ident {
&&i: ident, _fld: ast_fold) -> ident {
ret alt follow_for_trans(cx, b.find(i), idx_path) {
some(match_ident(a_id)) { a_id.node }
some(m) { match_error(cx, m, "an identifier") }