]> git.lizzy.rs Git - rust.git/blob - src/docs/shadow_same.txt
Merge remote-tracking branch 'upstream/auto' into rustup
[rust.git] / src / docs / shadow_same.txt
1 ### What it does
2 Checks for bindings that shadow other bindings already in
3 scope, while just changing reference level or mutability.
4
5 ### Why is this bad?
6 Not much, in fact it's a very common pattern in Rust
7 code. Still, some may opt to avoid it in their code base, they can set this
8 lint to `Warn`.
9
10 ### Example
11 ```
12 let x = &x;
13 ```
14
15 Use instead:
16 ```
17 let y = &x; // use different variable name
18 ```