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:
parent
2d1dec78e7
commit
6ba4eacddf
16 changed files with 223 additions and 257 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue