Skip to content

Commit 1d8f5f0

Browse files
authored
Rollup merge of #69974 - GuillaumeGomez:cleanup-e0434, r=Dylan-DPC
Clean up E0434 explanation r? @Dylan-DPC
2 parents b0d1fc5 + a36bf9c commit 1d8f5f0

File tree

1 file changed

+4
-6
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+4
-6
lines changed

src/librustc_error_codes/error_codes/E0434.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
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.
42

53
Erroneous code example:
64

@@ -14,8 +12,8 @@ fn foo() {
1412
}
1513
```
1614

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:
1917

2018
```
2119
fn foo() {
@@ -26,7 +24,7 @@ fn foo() {
2624
}
2725
```
2826

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:
3028

3129
```
3230
fn foo() {

0 commit comments

Comments
 (0)