]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/types/box_vec.rs
Add flags to detect lints are triggered
[rust.git] / clippy_lints / src / types / box_vec.rs
index 14f09ab837f34d5a282fec1621c7bdfde85fdf5d..4eb032cae6b1a678b7d1c08319ec071dd00c6f6b 100644 (file)
@@ -6,7 +6,7 @@
 
 use super::BOX_VEC;
 
-pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_>, def_id: DefId) {
+pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_>, def_id: DefId) -> bool {
     if Some(def_id) == cx.tcx.lang_items().owned_box() {
         if is_ty_param_diagnostic_item(cx, qpath, sym::vec_type).is_some() {
             span_lint_and_help(
@@ -17,6 +17,8 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_
                 None,
                 "`Vec<T>` is already on the heap, `Box<Vec<T>>` makes an extra allocation",
             );
+            return true;
         }
     }
+    false
 }