]> git.lizzy.rs Git - rust.git/commitdiff
Merge pull request #2917 from mikerite/issue2894
authorPhilipp Krones <uwdkn@student.kit.edu>
Sun, 29 Jul 2018 21:54:03 +0000 (23:54 +0200)
committerGitHub <noreply@github.com>
Sun, 29 Jul 2018 21:54:03 +0000 (23:54 +0200)
Fix #2894

clippy_lints/src/needless_borrow.rs

index 7986b43919c80fbf70417cffd962eb95967f5dfc..cb2c572743db87831c23b9690b5544028043927c 100644 (file)
 /// **Why is this bad?** Suggests that the receiver of the expression borrows
 /// the expression.
 ///
-/// **Known problems:** None.
-///
 /// **Example:**
 /// ```rust
 /// let x: &i32 = &&&&&&5;
 /// ```
+///
+/// **Known problems:** This will cause false positives in code generated by `derive`.
+/// For instance in the following snippet:
+/// ```rust
+/// #[derive(Debug)]
+/// pub enum Error {
+///     Type(
+///         &'static str,
+///     ),
+/// }
+/// ```
+/// A warning will be emitted that `&'static str` should be replaced with `&'static str`,
+/// however there is nothing that can or should be done to fix this.
 declare_clippy_lint! {
     pub NEEDLESS_BORROW,
     nursery,