Skip to content

Commit ad8126a

Browse files
committed
use span_lint_and_note
1 parent 9b1d0b2 commit ad8126a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

clippy_lints/src/large_stack_frames.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::ops::AddAssign;
22

3-
use clippy_utils::diagnostics::span_lint_and_then;
3+
use clippy_utils::diagnostics::span_lint_and_note;
44
use rustc_hir::def_id::LocalDefId;
55
use rustc_hir::intravisit::FnKind;
66
use rustc_hir::Body;
@@ -146,14 +146,13 @@ impl<'tcx> LateLintPass<'tcx> for LargeStackFrames {
146146
}
147147

148148
if frame_size.exceeds_limit(self.maximum_allowed_size) {
149-
span_lint_and_then(
149+
span_lint_and_note(
150150
cx,
151151
LARGE_STACK_FRAMES,
152152
span,
153153
"this function allocates a large amount of stack space",
154-
|diag| {
155-
diag.note("allocating large amounts of stack space can overflow the stack");
156-
},
154+
None,
155+
"allocating large amounts of stack space can overflow the stack",
157156
);
158157
}
159158
}

0 commit comments

Comments
 (0)