@@ -24,9 +24,9 @@ Closure expressions are most useful when passing functions as arguments to other
24
24
functions, as an abbreviation for defining and capturing a separate function.
25
25
26
26
Significantly, closure expressions _ capture their environment_ , which regular
27
- [ function definitions] do not. Without the ` move `
28
- keyword, the closure expression infers how it captures each variable from its
29
- environment, preferring to capture by shared reference, effectively borrowing
27
+ [ function definitions] do not. Without the ` move ` keyword, the closure expression
28
+ [ infers how it captures each variable from its environment ] ( types.html#capture-modes ) ,
29
+ preferring to capture by shared reference, effectively borrowing
30
30
all outer variables mentioned inside the closure's body. If needed the compiler
31
31
will infer that instead mutable references should be taken, or that the values
32
32
should be moved or copied (depending on their type) from the environment. A
@@ -35,7 +35,7 @@ prefixing it with the `move` keyword. This is often used to ensure that the
35
35
closure's type is ` 'static ` .
36
36
37
37
The compiler will determine which of the [ closure
38
- traits] ( types.html#closure-types ) the closure's type will implement by how it
38
+ traits] ( types.html#call-traits-and-coercions ) the closure's type will implement by how it
39
39
acts on its captured variables. The closure will also implement
40
40
[ ` Send ` ] ( special-types-and-traits.html#send ) and/or
41
41
[ ` Sync ` ] ( special-types-and-traits.html#sync ) if all of its captured types do.
0 commit comments