Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 78983d9

Browse files
committed
[slow_vector_initialization]: use the source span of vec![] macro
1 parent b9906ac commit 78983d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/slow_vector_initialization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl SlowVectorInit {
205205

206206
span_lint_and_then(cx, SLOW_VECTOR_INITIALIZATION, slow_fill.span, msg, |diag| {
207207
diag.span_suggestion(
208-
vec_alloc.allocation_expr.span,
208+
vec_alloc.allocation_expr.span.source_callsite(),
209209
"consider replacing this with",
210210
format!("vec![0; {len_expr}]"),
211211
Applicability::Unspecified,

0 commit comments

Comments
 (0)