Make resolve recognize upvars

Upvars are now marked with def_upvar throughout, not just when going
through freevars::lookup_def. This makes things less error-prone. One
thing to watch out for is that def_upvar is used in `for each` bodies
too, when they refer to a local outside the body.
This commit is contained in:
Marijn Haverbeke 2011-09-01 14:35:00 +02:00
parent 2d1dec78e7
commit 6ba4eacddf
16 changed files with 223 additions and 257 deletions

View file

@ -42,7 +42,7 @@ fn def_id_of_def(d: def) -> def_id {
def_use(id) { ret id; }
def_native_ty(id) { ret id; }
def_native_fn(id) { ret id; }
def_upvar(id, _) { ret id; }
def_upvar(id, _, _) { ret id; }
}
}
@ -216,3 +216,12 @@ fn ternary_to_if(e: &@expr) -> @expr {
_ { fail; }
}
}
// Local Variables:
// mode: rust
// fill-column: 78;
// indent-tabs-mode: nil
// c-basic-offset: 4
// buffer-file-coding-system: utf-8-unix
// compile-command: "make -k -C $RBUILD 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
// End: