1
1
use clippy_utils:: diagnostics:: span_lint_and_sugg;
2
2
use clippy_utils:: eager_or_lazy:: switch_to_eager_eval;
3
- use clippy_utils:: macros:: span_is_local;
4
3
use clippy_utils:: msrvs:: { self , Msrv } ;
5
4
use clippy_utils:: source:: { HasSession , snippet_with_applicability} ;
6
5
use clippy_utils:: ty:: implements_trait;
@@ -54,7 +53,6 @@ pub(super) fn check<'tcx>(
54
53
&& !assignval. span . from_expansion ( )
55
54
// It is generally not equivalent to use the `fill` method if `assignval` can have side effects
56
55
&& switch_to_eager_eval ( cx, assignval)
57
- && span_is_local ( assignval. span )
58
56
// The `fill` method requires that the slice's element type implements the `Clone` trait.
59
57
&& let Some ( clone_trait) = cx. tcx . lang_items ( ) . clone_trait ( )
60
58
&& implements_trait ( cx, cx. typeck_results ( ) . expr_ty ( slice) , clone_trait, & [ ] )
@@ -73,7 +71,6 @@ pub(super) fn check<'tcx>(
73
71
&& local == pat. hir_id
74
72
&& !assignval. span . from_expansion ( )
75
73
&& switch_to_eager_eval ( cx, assignval)
76
- && span_is_local ( assignval. span )
77
74
// The `fill` method cannot be used if the slice's element type does not implement the `Clone` trait.
78
75
&& let Some ( clone_trait) = cx. tcx . lang_items ( ) . clone_trait ( )
79
76
&& implements_trait ( cx, cx. typeck_results ( ) . expr_ty ( recv) , clone_trait, & [ ] )
0 commit comments