@@ -5,7 +5,7 @@ effectively "desugared" into structs that contain the values they use (or
5
5
references to the values they use) from their creator's stack frame. rustc has
6
6
the job of figuring out which values a closure uses and how, so it can decide
7
7
whether to capture a given variable by shared reference, mutable reference, or
8
- by move. rustc also has to figure out which the closure traits ([ ` Fn ` ] [ fn ] ,
8
+ by move. rustc also has to figure out which of the closure traits ([ ` Fn ` ] [ fn ] ,
9
9
[ ` FnMut ` ] [ fn_mut ] , or [ ` FnOnce ` ] [ fn_once ] ) a closure is capable of
10
10
implementing.
11
11
@@ -120,7 +120,7 @@ for this purpose.
120
120
121
121
[ upvars ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/query/queries/struct.upvars_mentioned.html
122
122
123
- Other than lazy invocation, one other thing that the distinguishes a closure from a
123
+ Other than lazy invocation, one other thing that distinguishes a closure from a
124
124
normal function is that it can use the upvars. It borrows these upvars from its surrounding
125
125
context; therefore the compiler has to determine the upvar's borrow type. The compiler starts with
126
126
assigning an immutable borrow type and lowers the restriction (that is, changes it from
@@ -189,7 +189,7 @@ can be `ByValue` (moved) or `ByRef` (borrowed). For `ByRef` borrows, it can be
189
189
[ mir_mod ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/index.html
190
190
191
191
` Delegate ` defines a few different methods (the different callbacks):
192
- ** consume** : for * move* of a variable, ** borrow** for a * borrow* of some kind
192
+ ** consume** for * move* of a variable, ** borrow** for a * borrow* of some kind
193
193
(shared or mutable), and ** mutate** when we see an * assignment* of something.
194
194
195
195
All of these callbacks have a common argument * cmt* which stands for Category,
0 commit comments