File tree 1 file changed +4
-6
lines changed
src/librustc_error_codes/error_codes
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 1
- This error indicates that a variable usage inside an inner function is invalid
2
- because the variable comes from a dynamic environment. Inner functions do not
3
- have access to their containing environment.
1
+ A variable used inside an inner function comes from a dynamic environment.
4
2
5
3
Erroneous code example:
6
4
@@ -14,8 +12,8 @@ fn foo() {
14
12
}
15
13
```
16
14
17
- Functions do not capture local variables . To fix this error, you can replace the
18
- function with a closure:
15
+ Inner functions do not have access to their containing environment . To fix this
16
+ error, you can replace the function with a closure:
19
17
20
18
```
21
19
fn foo() {
@@ -26,7 +24,7 @@ fn foo() {
26
24
}
27
25
```
28
26
29
- or replace the captured variable with a constant or a static item:
27
+ Or replace the captured variable with a constant or a static item:
30
28
31
29
```
32
30
fn foo() {
You can’t perform that action at this time.
0 commit comments