11use clippy_utils:: diagnostics:: span_lint_and_sugg;
22use clippy_utils:: eager_or_lazy:: switch_to_eager_eval;
3- use clippy_utils:: macros:: span_is_local;
43use clippy_utils:: msrvs:: { self , Msrv } ;
54use clippy_utils:: source:: { HasSession , snippet_with_applicability} ;
65use clippy_utils:: ty:: implements_trait;
@@ -55,7 +54,6 @@ pub(super) fn check<'tcx>(
5554 && !assignval. span . from_expansion ( )
5655 // It is generally not equivalent to use the `fill` method if `assignval` can have side effects
5756 && switch_to_eager_eval ( cx, assignval)
58- && span_is_local ( assignval. span )
5957 // The `fill` method requires that the slice's element type implements the `Clone` trait.
6058 && let Some ( clone_trait) = cx. tcx . lang_items ( ) . clone_trait ( )
6159 && implements_trait ( cx, cx. typeck_results ( ) . expr_ty ( slice) , clone_trait, & [ ] )
@@ -78,7 +76,6 @@ pub(super) fn check<'tcx>(
7876 && local == pat. hir_id
7977 && !assignval. span . from_expansion ( )
8078 && switch_to_eager_eval ( cx, assignval)
81- && span_is_local ( assignval. span )
8279 // The `fill` method cannot be used if the slice's element type does not implement the `Clone` trait.
8380 && let Some ( clone_trait) = cx. tcx . lang_items ( ) . clone_trait ( )
8481 && implements_trait ( cx, cx. typeck_results ( ) . expr_ty ( recv) , clone_trait, & [ ] )
0 commit comments