]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/used_underscore_binding.txt
Auto merge of #101615 - compiler-errors:rpitit-perf, r=oli-obk
[rust.git] / src / tools / clippy / src / docs / used_underscore_binding.txt
1 ### What it does
2 Checks for the use of bindings with a single leading
3 underscore.
4
5 ### Why is this bad?
6 A single leading underscore is usually used to indicate
7 that a binding will not be used. Using such a binding breaks this
8 expectation.
9
10 ### Known problems
11 The lint does not work properly with desugaring and
12 macro, it has been allowed in the mean time.
13
14 ### Example
15 ```
16 let _x = 0;
17 let y = _x + 1; // Here we are using `_x`, even though it has a leading
18                 // underscore. We should rename `_x` to `x`
19 ```