move lint documentation into macro invocations

This commit is contained in:
Andy Russell
2019-03-05 11:50:33 -05:00
parent a8f61e70a8
commit fe96ffeac9
132 changed files with 5405 additions and 5390 deletions

View File

@@ -5,19 +5,19 @@ use rustc::ty::subst::Subst;
use rustc::ty::{self, Ty};
use rustc::{declare_tool_lint, lint_array};
/// **What it does:** 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:**
/// ```rust
/// my_vec.push(&mut value)
/// ```
declare_clippy_lint! {
/// **What it does:** 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:**
/// ```rust
/// my_vec.push(&mut value)
/// ```
pub UNNECESSARY_MUT_PASSED,
style,
"an argument passed as a mutable reference although the callee only demands an immutable reference"