Skip to content

Commit

Permalink
Update E0384.md
Browse files Browse the repository at this point in the history
Add an example for the shadowing usage.
  • Loading branch information
JimmyOhn committed Apr 12, 2024
1 parent ab71ee7 commit 28b0977
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions compiler/rustc_error_codes/src/error_codes/E0384.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,13 @@ fn main() {
x = 5;
}
```

Otherwise you can use the shadowing instead. declared variable will be destroyed
when declaring the same variable. For example:

```
fn main() {
let x = 3;
let x = 5;
}
```

0 comments on commit 28b0977

Please sign in to comment.