1
1
#![ allow( rustc:: default_hash_types) ]
2
2
3
3
mod box_vec;
4
+ mod linked_list;
4
5
mod option_option;
5
6
mod rc_buffer;
6
7
mod redundant_allocation;
@@ -39,10 +40,9 @@ use crate::utils::paths;
39
40
use crate :: utils:: sugg:: Sugg ;
40
41
use crate :: utils:: {
41
42
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,
46
46
} ;
47
47
48
48
declare_clippy_lint ! {
@@ -313,7 +313,6 @@ impl Types {
313
313
///
314
314
/// The parameter `is_local` distinguishes the context of the type; types from
315
315
/// local bindings should only be checked for the `BORROWED_BOX` lint.
316
- #[ allow( clippy:: too_many_lines) ]
317
316
fn check_ty ( & mut self , cx : & LateContext < ' _ > , hir_ty : & hir:: Ty < ' _ > , is_local : bool ) {
318
317
if hir_ty. span . from_expansion ( ) {
319
318
return ;
@@ -329,18 +328,7 @@ impl Types {
329
328
triggered |= rc_buffer:: check ( cx, hir_ty, qpath, def_id) ;
330
329
triggered |= vec_box:: check ( cx, hir_ty, qpath, def_id, self . vec_box_size_threshold ) ;
331
330
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) ;
344
332
345
333
if triggered {
346
334
return ;
@@ -389,7 +377,6 @@ impl Types {
389
377
}
390
378
} ,
391
379
TyKind :: Rptr ( ref lt, ref mut_ty) => self . check_ty_rptr ( cx, hir_ty, is_local, lt, mut_ty) ,
392
- // recurse
393
380
TyKind :: Slice ( ref ty) | TyKind :: Array ( ref ty, _) | TyKind :: Ptr ( MutTy { ref ty, .. } ) => {
394
381
self . check_ty ( cx, ty, is_local)
395
382
} ,
0 commit comments