about summary refs log tree commit diff
diff options
context:
space:
mode:
authorflip1995 <philipp.krones@embecosm.com>2021-03-11 10:57:49 +0100
committerflip1995 <philipp.krones@embecosm.com>2021-03-11 10:57:49 +0100
commit9c1dd0c22721029dc47e5fe73d85670abab9adfc (patch)
treee2fa5ed4904a03e60afd1c81ecaa16c382f6264c
parentae6be4f36182722e7a3b021868ee913f1a97200e (diff)
downloadrust-9c1dd0c22721029dc47e5fe73d85670abab9adfc.tar.gz
rust-9c1dd0c22721029dc47e5fe73d85670abab9adfc.zip
Fix remaining dogfood errors (internal lints)
-rw-r--r--clippy_lints/src/loops/explicit_iter_loop.rs8
-rw-r--r--clippy_lints/src/loops/for_kv_map.rs3
-rw-r--r--clippy_lints/src/loops/manual_memcpy.rs2
-rw-r--r--clippy_lints/src/loops/needless_collect.rs6
-rw-r--r--clippy_lints/src/methods/iter_count.rs6
-rw-r--r--clippy_utils/src/eager_or_lazy.rs5
6 files changed, 16 insertions, 14 deletions
diff --git a/clippy_lints/src/loops/explicit_iter_loop.rs b/clippy_lints/src/loops/explicit_iter_loop.rs
index 44d08916891..9683e59a396 100644
--- a/clippy_lints/src/loops/explicit_iter_loop.rs
+++ b/clippy_lints/src/loops/explicit_iter_loop.rs
@@ -4,7 +4,7 @@ use rustc_errors::Applicability;
 use rustc_hir::{Expr, Mutability};
 use rustc_lint::LateContext;
 use rustc_middle::ty::{self, Ty, TyS};
-use rustc_span::symbol::sym;
+use rustc_span::sym;
 
 use crate::utils::{is_type_diagnostic_item, match_type, paths};
 
@@ -55,9 +55,9 @@ fn is_ref_iterable_type(cx: &LateContext<'_>, e: &Expr<'_>) -> bool {
     is_iterable_array(ty, cx) ||
     is_type_diagnostic_item(cx, ty, sym::vec_type) ||
     match_type(cx, ty, &paths::LINKED_LIST) ||
-    is_type_diagnostic_item(cx, ty, sym!(hashmap_type)) ||
-    is_type_diagnostic_item(cx, ty, sym!(hashset_type)) ||
-    is_type_diagnostic_item(cx, ty, sym!(vecdeque_type)) ||
+    is_type_diagnostic_item(cx, ty, sym::hashmap_type) ||
+    is_type_diagnostic_item(cx, ty, sym::hashset_type) ||
+    is_type_diagnostic_item(cx, ty, sym::vecdeque_type) ||
     match_type(cx, ty, &paths::BINARY_HEAP) ||
     match_type(cx, ty, &paths::BTREEMAP) ||
     match_type(cx, ty, &paths::BTREESET)
diff --git a/clippy_lints/src/loops/for_kv_map.rs b/clippy_lints/src/loops/for_kv_map.rs
index eb53c3179ca..6ee9b95a3b6 100644
--- a/clippy_lints/src/loops/for_kv_map.rs
+++ b/clippy_lints/src/loops/for_kv_map.rs
@@ -4,6 +4,7 @@ use crate::utils::{is_type_diagnostic_item, match_type, multispan_sugg, paths, s
 use rustc_hir::{BorrowKind, Expr, ExprKind, Mutability, Pat, PatKind};
 use rustc_lint::LateContext;
 use rustc_middle::ty;
+use rustc_span::sym;
 
 /// Checks for the `FOR_KV_MAP` lint.
 pub(super) fn check<'tcx>(
@@ -35,7 +36,7 @@ pub(super) fn check<'tcx>(
                 _ => arg,
             };
 
-            if is_type_diagnostic_item(cx, ty, sym!(hashmap_type)) || match_type(cx, ty, &paths::BTREEMAP) {
+            if is_type_diagnostic_item(cx, ty, sym::hashmap_type) || match_type(cx, ty, &paths::BTREEMAP) {
                 span_lint_and_then(
                     cx,
                     FOR_KV_MAP,
diff --git a/clippy_lints/src/loops/manual_memcpy.rs b/clippy_lints/src/loops/manual_memcpy.rs
index c41eb32f9d8..fad96c2d5c0 100644
--- a/clippy_lints/src/loops/manual_memcpy.rs
+++ b/clippy_lints/src/loops/manual_memcpy.rs
@@ -328,7 +328,7 @@ fn is_slice_like<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'_>) -> bool {
         _ => false,
     };
 
-    is_slice || is_type_diagnostic_item(cx, ty, sym::vec_type) || is_type_diagnostic_item(cx, ty, sym!(vecdeque_type))
+    is_slice || is_type_diagnostic_item(cx, ty, sym::vec_type) || is_type_diagnostic_item(cx, ty, sym::vecdeque_type)
 }
 
 fn fetch_cloned_expr<'tcx>(expr: &'tcx Expr<'tcx>) -> &'tcx Expr<'tcx> {
diff --git a/clippy_lints/src/loops/needless_collect.rs b/clippy_lints/src/loops/needless_collect.rs
index 6f271309105..92560c80629 100644
--- a/clippy_lints/src/loops/needless_collect.rs
+++ b/clippy_lints/src/loops/needless_collect.rs
@@ -29,9 +29,9 @@ fn check_needless_collect_direct_usage<'tcx>(expr: &'tcx Expr<'_>, cx: &LateCont
         then {
             let ty = cx.typeck_results().node_type(ty.hir_id);
             if is_type_diagnostic_item(cx, ty, sym::vec_type) ||
-                is_type_diagnostic_item(cx, ty, sym!(vecdeque_type)) ||
+                is_type_diagnostic_item(cx, ty, sym::vecdeque_type) ||
                 match_type(cx, ty, &paths::BTREEMAP) ||
-                is_type_diagnostic_item(cx, ty, sym!(hashmap_type)) {
+                is_type_diagnostic_item(cx, ty, sym::hashmap_type) {
                 if method.ident.name == sym!(len) {
                     let span = shorten_needless_collect_span(expr);
                     span_lint_and_sugg(
@@ -99,7 +99,7 @@ fn check_needless_collect_indirect_usage<'tcx>(expr: &'tcx Expr<'_>, cx: &LateCo
                 if let Some(GenericArg::Type(ref ty)) = generic_args.args.get(0);
                 if let ty = cx.typeck_results().node_type(ty.hir_id);
                 if is_type_diagnostic_item(cx, ty, sym::vec_type) ||
-                    is_type_diagnostic_item(cx, ty, sym!(vecdeque_type)) ||
+                    is_type_diagnostic_item(cx, ty, sym::vecdeque_type) ||
                     match_type(cx, ty, &paths::LINKED_LIST);
                 if let Some(iter_calls) = detect_iter_and_into_iters(block, *ident);
                 if iter_calls.len() == 1;
diff --git a/clippy_lints/src/methods/iter_count.rs b/clippy_lints/src/methods/iter_count.rs
index 1b99bacc3f1..71d65a01d3e 100644
--- a/clippy_lints/src/methods/iter_count.rs
+++ b/clippy_lints/src/methods/iter_count.rs
@@ -14,11 +14,11 @@ pub(crate) fn lints<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'_>, iter_args: &'
         "slice"
     } else if is_type_diagnostic_item(cx, ty, sym::vec_type) {
         "Vec"
-    } else if is_type_diagnostic_item(cx, ty, sym!(vecdeque_type)) {
+    } else if is_type_diagnostic_item(cx, ty, sym::vecdeque_type) {
         "VecDeque"
-    } else if is_type_diagnostic_item(cx, ty, sym!(hashset_type)) {
+    } else if is_type_diagnostic_item(cx, ty, sym::hashset_type) {
         "HashSet"
-    } else if is_type_diagnostic_item(cx, ty, sym!(hashmap_type)) {
+    } else if is_type_diagnostic_item(cx, ty, sym::hashmap_type) {
         "HashMap"
     } else if match_type(cx, ty, &paths::BTREEMAP) {
         "BTreeMap"
diff --git a/clippy_utils/src/eager_or_lazy.rs b/clippy_utils/src/eager_or_lazy.rs
index f54a35a0a18..8013c4e4fcb 100644
--- a/clippy_utils/src/eager_or_lazy.rs
+++ b/clippy_utils/src/eager_or_lazy.rs
@@ -9,7 +9,7 @@
 //!  - or-fun-call
 //!  - option-if-let-else
 
-use crate::{is_ctor_or_promotable_const_function, is_type_diagnostic_item, match_type, paths};
+use crate::{is_ctor_or_promotable_const_function, is_type_diagnostic_item};
 use rustc_hir::def::{DefKind, Res};
 
 use rustc_hir::intravisit;
@@ -100,7 +100,8 @@ fn identify_some_potentially_expensive_patterns<'tcx>(cx: &LateContext<'tcx>, ex
                 ExprKind::Call(..) => !is_ctor_or_promotable_const_function(self.cx, expr),
                 ExprKind::Index(obj, _) => {
                     let ty = self.cx.typeck_results().expr_ty(obj);
-                    is_type_diagnostic_item(self.cx, ty, sym::hashmap_type) || match_type(self.cx, ty, &paths::BTREEMAP)
+                    is_type_diagnostic_item(self.cx, ty, sym::hashmap_type)
+                        || is_type_diagnostic_item(self.cx, ty, sym::BTreeMap)
                 },
                 ExprKind::MethodCall(..) => true,
                 _ => false,