1 use clippy_utils::diagnostics::span_lint_and_help;
2 use clippy_utils::is_ty_param_diagnostic_item;
3 use rustc_hir::{self as hir, def_id::DefId, QPath};
4 use rustc_lint::LateContext;
5 use rustc_span::symbol::sym;
9 pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_>, def_id: DefId) -> bool {
10 if Some(def_id) == cx.tcx.lang_items().owned_box()
11 && is_ty_param_diagnostic_item(cx, qpath, sym::vec_type).is_some()
17 "you seem to be trying to use `Box<Vec<T>>`. Consider using just `Vec<T>`",
19 "`Vec<T>` is already on the heap, `Box<Vec<T>>` makes an extra allocation",