Rename `upvars` query to `upvars_mentioned`

This commit is contained in:
Yuki Okushi 2020-05-27 00:21:56 +09:00 committed by Who? Me?!
parent c2561c4351
commit f53fc666ea
1 changed files with 3 additions and 2 deletions

View File

@ -115,9 +115,10 @@ Let's start with defining a term that we will be using quite a bit in the rest o
*upvar*. An **upvar** is a variable that is local to the function where the closure is defined. So, *upvar*. An **upvar** is a variable that is local to the function where the closure is defined. So,
in the above examples, **x** will be an upvar to the closure. They are also sometimes referred to as in the above examples, **x** will be an upvar to the closure. They are also sometimes referred to as
the *free variables* meaning they are not bound to the context of the closure. the *free variables* meaning they are not bound to the context of the closure.
[`src/librustc_middle/ty/query/mod.rs`][upvars] defines a query called *upvars* for this purpose. [`src/librustc_middle/ty/query/mod.rs`][upvars] defines a query called *upvars_mentioned*
for this purpose.
[upvars]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/query/queries/struct.upvars.html [upvars]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/query/queries/struct.upvars_mentioned.html
Other than lazy invocation, one other thing that the distinguishes a closure from a Other than lazy invocation, one other thing that the distinguishes a closure from a
normal function is that it can use the upvars. It borrows these upvars from its surrounding normal function is that it can use the upvars. It borrows these upvars from its surrounding