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

@ -44,11 +44,7 @@ tag def {
def_use(def_id);
def_native_ty(def_id);
def_native_fn(def_id);
/* A "fake" def for upvars. This never appears in the def_map, but
* freevars::def_lookup will return it for a def that is an upvar.
* It contains the actual def. */
def_upvar(def_id, @def);
def_upvar(def_id, @def, bool /* writable */);
}
// The set of meta_items that define the compilation environment of the crate,