summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/unnecessary_mut_passed.txt
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tools/clippy/src/docs/unnecessary_mut_passed.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/unnecessary_mut_passed.txt b/src/tools/clippy/src/docs/unnecessary_mut_passed.txt
new file mode 100644
index 000000000..2f8bdd113
--- /dev/null
+++ b/src/tools/clippy/src/docs/unnecessary_mut_passed.txt
@@ -0,0 +1,17 @@
+### What it does
+Detects passing a mutable reference to a function that only
+requires an immutable reference.
+
+### Why is this bad?
+The mutable reference rules out all other references to
+the value. Also the code misleads about the intent of the call site.
+
+### Example
+```
+vec.push(&mut value);
+```
+
+Use instead:
+```
+vec.push(&value);
+``` \ No newline at end of file