Skip to content

Commit 992a864

Browse files
committed
Cleanup: remove useless span_is_local() calls in manual_slice_fill
In both instances, `!assign_val.span.from_expansion()` – which is more restrictive than `span_is_local(assign_val.span)` – has been required already.
1 parent b7ec4c1 commit 992a864

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

clippy_lints/src/loops/manual_slice_fill.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use clippy_utils::diagnostics::span_lint_and_sugg;
22
use clippy_utils::eager_or_lazy::switch_to_eager_eval;
3-
use clippy_utils::macros::span_is_local;
43
use clippy_utils::msrvs::{self, Msrv};
54
use clippy_utils::source::{HasSession, snippet_with_applicability};
65
use clippy_utils::ty::implements_trait;
@@ -54,7 +53,6 @@ pub(super) fn check<'tcx>(
5453
&& !assignval.span.from_expansion()
5554
// It is generally not equivalent to use the `fill` method if `assignval` can have side effects
5655
&& switch_to_eager_eval(cx, assignval)
57-
&& span_is_local(assignval.span)
5856
// The `fill` method requires that the slice's element type implements the `Clone` trait.
5957
&& let Some(clone_trait) = cx.tcx.lang_items().clone_trait()
6058
&& implements_trait(cx, cx.typeck_results().expr_ty(slice), clone_trait, &[])
@@ -73,7 +71,6 @@ pub(super) fn check<'tcx>(
7371
&& local == pat.hir_id
7472
&& !assignval.span.from_expansion()
7573
&& switch_to_eager_eval(cx, assignval)
76-
&& span_is_local(assignval.span)
7774
// The `fill` method cannot be used if the slice's element type does not implement the `Clone` trait.
7875
&& let Some(clone_trait) = cx.tcx.lang_items().clone_trait()
7976
&& implements_trait(cx, cx.typeck_results().expr_ty(recv), clone_trait, &[])

0 commit comments

Comments
 (0)