11#![ allow( rustc:: default_hash_types) ]
22
33mod box_vec;
4+ mod linked_list;
45mod option_option;
56mod rc_buffer;
67mod redundant_allocation;
@@ -39,10 +40,9 @@ use crate::utils::paths;
3940use crate :: utils:: sugg:: Sugg ;
4041use crate :: utils:: {
4142 clip, comparisons, differing_macro_contexts, higher, in_constant, indent_of, int_bits, is_hir_ty_cfg_dependant,
42- is_ty_param_diagnostic_item, is_type_diagnostic_item, match_def_path, match_path, meets_msrv, method_chain_args,
43- multispan_sugg, numeric_literal:: NumericLiteral , reindent_multiline, sext, snippet, snippet_opt,
44- snippet_with_applicability, snippet_with_macro_callsite, span_lint, span_lint_and_help, span_lint_and_sugg,
45- span_lint_and_then, unsext,
43+ is_type_diagnostic_item, match_path, meets_msrv, method_chain_args, multispan_sugg,
44+ numeric_literal:: NumericLiteral , reindent_multiline, sext, snippet, snippet_opt, snippet_with_applicability,
45+ snippet_with_macro_callsite, span_lint, span_lint_and_help, span_lint_and_sugg, span_lint_and_then, unsext,
4646} ;
4747
4848declare_clippy_lint ! {
@@ -313,7 +313,6 @@ impl Types {
313313 ///
314314 /// The parameter `is_local` distinguishes the context of the type; types from
315315 /// local bindings should only be checked for the `BORROWED_BOX` lint.
316- #[ allow( clippy:: too_many_lines) ]
317316 fn check_ty ( & mut self , cx : & LateContext < ' _ > , hir_ty : & hir:: Ty < ' _ > , is_local : bool ) {
318317 if hir_ty. span . from_expansion ( ) {
319318 return ;
@@ -329,18 +328,7 @@ impl Types {
329328 triggered |= rc_buffer:: check ( cx, hir_ty, qpath, def_id) ;
330329 triggered |= vec_box:: check ( cx, hir_ty, qpath, def_id, self . vec_box_size_threshold ) ;
331330 triggered |= option_option:: check ( cx, hir_ty, qpath, def_id) ;
332-
333- if match_def_path ( cx, def_id, & paths:: LINKED_LIST ) {
334- span_lint_and_help (
335- cx,
336- LINKEDLIST ,
337- hir_ty. span ,
338- "you seem to be using a `LinkedList`! Perhaps you meant some other data structure?" ,
339- None ,
340- "a `VecDeque` might work" ,
341- ) ;
342- return ; // don't recurse into the type
343- }
331+ triggered |= linked_list:: check ( cx, hir_ty, def_id) ;
344332
345333 if triggered {
346334 return ;
@@ -389,7 +377,6 @@ impl Types {
389377 }
390378 } ,
391379 TyKind :: Rptr ( ref lt, ref mut_ty) => self . check_ty_rptr ( cx, hir_ty, is_local, lt, mut_ty) ,
392- // recurse
393380 TyKind :: Slice ( ref ty) | TyKind :: Array ( ref ty, _) | TyKind :: Ptr ( MutTy { ref ty, .. } ) => {
394381 self . check_ty ( cx, ty, is_local)
395382 } ,
0 commit comments