]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/trivially_copy_pass_by_ref.rs
Merge commit '7ea7cd165ad6705603852771bf82cc2fd6560db5' into clippyup2
[rust.git] / clippy_lints / src / trivially_copy_pass_by_ref.rs
index 194e11ac9bdf92a4c4056c5d2a99f1101875dbfd..8e0cb94317affc2ce1bf3c0e81d3407fda751bf9 100644 (file)
@@ -2,13 +2,12 @@
 
 use crate::utils::{is_copy, is_self_ty, snippet, span_lint_and_sugg};
 use if_chain::if_chain;
-use matches::matches;
-use rustc::ty;
 use rustc_errors::Applicability;
 use rustc_hir as hir;
 use rustc_hir::intravisit::FnKind;
 use rustc_hir::{Body, FnDecl, HirId, ItemKind, MutTy, Mutability, Node};
 use rustc_lint::{LateContext, LateLintPass};
+use rustc_middle::ty;
 use rustc_session::config::Config as SessionConfig;
 use rustc_session::{declare_tool_lint, impl_lint_pass};
 use rustc_span::Span;
@@ -50,7 +49,7 @@
     /// fn foo(v: u32) {}
     /// ```
     pub TRIVIALLY_COPY_PASS_BY_REF,
-    perf,
+    pedantic,
     "functions taking small copyable arguments by reference"
 }
 
@@ -162,7 +161,7 @@ fn check_fn(
                 }
             },
             FnKind::Method(..) => (),
-            _ => return,
+            FnKind::Closure(..) => return,
         }
 
         // Exclude non-inherent impls