]> git.lizzy.rs Git - rust.git/blobdiff - src/mut_reference.rs
added wiki comments + wiki-generating python script
[rust.git] / src / mut_reference.rs
index 8e089378929a7717c6987339ab27d0fadca5e24a..9ba9782336a277ed842a62c9a582d99156fc53c1 100644 (file)
@@ -4,6 +4,13 @@
 use rustc::middle::ty::{TypeAndMut, TypeVariants, MethodCall, TyS};
 use syntax::ptr::P;
 
+/// **What it does:** This lint detects giving a mutable reference to a function that only requires an immutable reference.
+///
+/// **Why is this bad?** The immutable reference rules out all other references to the value. Also the code misleads about the intent of the call site.
+///
+/// **Known problems:** None
+///
+/// **Example** `my_vec.push(&mut value)`
 declare_lint! {
     pub UNNECESSARY_MUT_PASSED,
     Warn,