Skip to content

Commit 28b0977

Browse files
committed
Update E0384.md
Add an example for the shadowing usage.
1 parent ab71ee7 commit 28b0977

File tree

1 file changed

+10
-0
lines changed
  • compiler/rustc_error_codes/src/error_codes

1 file changed

+10
-0
lines changed

Diff for: compiler/rustc_error_codes/src/error_codes/E0384.md

+10
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,13 @@ fn main() {
1818
x = 5;
1919
}
2020
```
21+
22+
Otherwise you can use the shadowing instead. declared variable will be destroyed
23+
when declaring the same variable. For example:
24+
25+
```
26+
fn main() {
27+
let x = 3;
28+
let x = 5;
29+
}
30+
```

0 commit comments

Comments
 (0)