diff options
Diffstat (limited to 'src/tools/clippy/src/docs/shadow_same.txt')
-rw-r--r-- | src/tools/clippy/src/docs/shadow_same.txt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/shadow_same.txt b/src/tools/clippy/src/docs/shadow_same.txt new file mode 100644 index 000000000..3cd96f560 --- /dev/null +++ b/src/tools/clippy/src/docs/shadow_same.txt @@ -0,0 +1,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 +```
\ No newline at end of file |