Skip to content

Commit

Permalink
Unrolled build for rust-lang#123849
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#123849 - JimmyOhn:first_contribution, r=pnkfelix

Update E0384.md

Add an example for the shadowing usage.
  • Loading branch information
rust-timer authored Apr 12, 2024
2 parents bd71213 + 0b5653f commit dc1b23f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 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,16 @@ fn main() {
x = 5;
}
```

Alternatively, you might consider initializing a new variable: either with a new
bound name or (by [shadowing]) with the bound name of your existing variable.
For example:

[shadowing]: https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html#shadowing

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

0 comments on commit dc1b23f

Please sign in to comment.