about summary refs log tree commit diff
path: root/compiler/rustc_lint/src
diff options
context:
space:
mode:
authorRyan Levick <me@ryanlevick.com>2021-02-16 15:12:19 +0100
committerRyan Levick <me@ryanlevick.com>2021-03-03 11:23:14 +0100
commitda3995f0ec3085de42dcce9e91dbb5662b2c99d3 (patch)
tree2c7481d1f267b94a86b97872b149cdbee15c71be /compiler/rustc_lint/src
parent6bf6652616ca75dde30cbdd021942433ae519730 (diff)
downloadrust-da3995f0ec3085de42dcce9e91dbb5662b2c99d3.tar.gz
rust-da3995f0ec3085de42dcce9e91dbb5662b2c99d3.zip
Remove lint pass on borrow and deref
Diffstat (limited to 'compiler/rustc_lint/src')
-rw-r--r--compiler/rustc_lint/src/noop_method_call.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/compiler/rustc_lint/src/noop_method_call.rs b/compiler/rustc_lint/src/noop_method_call.rs
index b4ee1f9157c..335c3c575e7 100644
--- a/compiler/rustc_lint/src/noop_method_call.rs
+++ b/compiler/rustc_lint/src/noop_method_call.rs
@@ -50,9 +50,7 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall {
             Some((DefKind::AssocFn, did)) => match cx.tcx.trait_of_item(did) {
                 // Check that we're dealing with a trait method for one of the traits we care about.
                 Some(trait_id)
-                    if [sym::Clone, sym::Deref, sym::Borrow]
-                        .iter()
-                        .any(|s| cx.tcx.is_diagnostic_item(*s, trait_id)) =>
+                    if [sym::Clone].iter().any(|s| cx.tcx.is_diagnostic_item(*s, trait_id)) =>
                 {
                     (trait_id, did)
                 }
@@ -73,13 +71,7 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall {
             _ => return,
         };
         // (Re)check that it implements the noop diagnostic.
-        for (s, peel_ref) in [
-            (sym::noop_method_borrow, true),
-            (sym::noop_method_clone, false),
-            (sym::noop_method_deref, true),
-        ]
-        .iter()
-        {
+        for (s, peel_ref) in [(sym::noop_method_clone, false)].iter() {
             if cx.tcx.is_diagnostic_item(*s, i.def_id()) {
                 let method = &call.ident.name;
                 let receiver = &elements[0];