about summary refs log tree commit diff
diff options
context:
space:
mode:
authory21 <30553356+y21@users.noreply.github.com>2023-09-02 15:46:15 +0200
committery21 <30553356+y21@users.noreply.github.com>2023-09-02 15:46:15 +0200
commit78983d9e3f5a1de6355fc33ca56e8dbb94c6cf56 (patch)
treee5d9e9ee40c72659049313d7804cff5b9c6940f1
parentb9906aca5ac29d6b4bfeda81fc44a40b24c1c392 (diff)
downloadrust-78983d9e3f5a1de6355fc33ca56e8dbb94c6cf56.tar.gz
rust-78983d9e3f5a1de6355fc33ca56e8dbb94c6cf56.zip
[`slow_vector_initialization`]: use the source span of `vec![]` macro
-rw-r--r--clippy_lints/src/slow_vector_initialization.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/slow_vector_initialization.rs b/clippy_lints/src/slow_vector_initialization.rs
index c9ab622ad25..0ef7e05de6e 100644
--- a/clippy_lints/src/slow_vector_initialization.rs
+++ b/clippy_lints/src/slow_vector_initialization.rs
@@ -205,7 +205,7 @@ impl SlowVectorInit {
 
         span_lint_and_then(cx, SLOW_VECTOR_INITIALIZATION, slow_fill.span, msg, |diag| {
             diag.span_suggestion(
-                vec_alloc.allocation_expr.span,
+                vec_alloc.allocation_expr.span.source_callsite(),
                 "consider replacing this with",
                 format!("vec![0; {len_expr}]"),
                 Applicability::Unspecified,