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
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue