Skip to content

Commit 169eb87

Browse files
committed
Remove expect collapsible_span_lint_calls from span_lint_and_then
1 parent 696d96d commit 169eb87

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

clippy_lints/src/uninit_vec.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use clippy_utils::diagnostics::{span_lint, span_lint_and_then};
1+
use clippy_utils::diagnostics::{span_lint, span_lint_and_help};
22
use clippy_utils::higher::{VecInitKind, get_vec_init_kind};
33
use clippy_utils::ty::{is_type_diagnostic_item, is_uninit_value_valid_for_ty};
44
use clippy_utils::{SpanlessEq, is_integer_literal, is_lint_allowed, path_to_local_id, peel_hir_expr_while, sym};
@@ -95,16 +95,13 @@ fn handle_uninit_vec_pair<'tcx>(
9595

9696
// Check T of Vec<T>
9797
if !is_uninit_value_valid_for_ty(cx, args.type_at(0)) {
98-
// FIXME: #7698, false positive of the internal lints
99-
#[expect(clippy::collapsible_span_lint_calls)]
100-
span_lint_and_then(
98+
span_lint_and_help(
10199
cx,
102100
UNINIT_VEC,
103101
vec![call_span, maybe_init_or_reserve.span],
104102
"calling `set_len()` immediately after reserving a buffer creates uninitialized values",
105-
|diag| {
106-
diag.help("initialize the buffer or wrap the content in `MaybeUninit`");
107-
},
103+
None,
104+
"initialize the buffer or wrap the content in `MaybeUninit`",
108105
);
109106
}
110107
} else {

0 commit comments

Comments
 (0)