summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/shadow_same.txt
blob: 3cd96f560a5e2cc792ef3e6a3e4635a959eb9115 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
### What it does
Checks for bindings that shadow other bindings already in
scope, while just changing reference level or mutability.

### Why is this bad?
Not much, in fact it's a very common pattern in Rust
code. Still, some may opt to avoid it in their code base, they can set this
lint to `Warn`.

### Example
```
let x = &x;
```

Use instead:
```
let y = &x; // use different variable name
```