]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/mut_key.rs
modify code
[rust.git] / clippy_lints / src / mut_key.rs
index 8476257f086fb9455c52c08aa62f5be009e00c8e..1bdd805f658549801dec79a6bfd63d1d14e6e66f 100644 (file)
@@ -72,6 +72,7 @@
     ///     let _: HashSet<Bad> = HashSet::new();
     /// }
     /// ```
+    #[clippy::version = "1.42.0"]
     pub MUTABLE_KEY_TYPE,
     suspicious,
     "Check for mutable `Map`/`Set` key type"
@@ -88,7 +89,7 @@ fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'tcx>) {
 
     fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::ImplItem<'tcx>) {
         if let hir::ImplItemKind::Fn(ref sig, ..) = item.kind {
-            if trait_ref_of_method(cx, item.hir_id()).is_none() {
+            if trait_ref_of_method(cx, item.def_id).is_none() {
                 check_sig(cx, item.hir_id(), sig.decl);
             }
         }