Skip to content

Commit

Permalink
Rollup merge of #69974 - GuillaumeGomez:cleanup-e0434, r=Dylan-DPC
Browse files Browse the repository at this point in the history
Clean up E0434 explanation

r? @Dylan-DPC
  • Loading branch information
JohnTitor committed Mar 13, 2020
2 parents b0d1fc5 + a36bf9c commit 1d8f5f0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/librustc_error_codes/error_codes/E0434.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
This error indicates that a variable usage inside an inner function is invalid
because the variable comes from a dynamic environment. Inner functions do not
have access to their containing environment.
A variable used inside an inner function comes from a dynamic environment.

Erroneous code example:

Expand All @@ -14,8 +12,8 @@ fn foo() {
}
```

Functions do not capture local variables. To fix this error, you can replace the
function with a closure:
Inner functions do not have access to their containing environment. To fix this
error, you can replace the function with a closure:

```
fn foo() {
Expand All @@ -26,7 +24,7 @@ fn foo() {
}
```

or replace the captured variable with a constant or a static item:
Or replace the captured variable with a constant or a static item:

```
fn foo() {
Expand Down

0 comments on commit 1d8f5f0

Please sign in to comment.