summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/used_underscore_binding.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/src/docs/used_underscore_binding.txt')
-rw-r--r--src/tools/clippy/src/docs/used_underscore_binding.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/used_underscore_binding.txt b/src/tools/clippy/src/docs/used_underscore_binding.txt
new file mode 100644
index 000000000..ed67c41eb
--- /dev/null
+++ b/src/tools/clippy/src/docs/used_underscore_binding.txt
@@ -0,0 +1,19 @@
+### What it does
+Checks for the use of bindings with a single leading
+underscore.
+
+### Why is this bad?
+A single leading underscore is usually used to indicate
+that a binding will not be used. Using such a binding breaks this
+expectation.
+
+### Known problems
+The lint does not work properly with desugaring and
+macro, it has been allowed in the mean time.
+
+### Example
+```
+let _x = 0;
+let y = _x + 1; // Here we are using `_x`, even though it has a leading
+ // underscore. We should rename `_x` to `x`
+``` \ No newline at end of file