Skip to content

Commit

Permalink
use span_lint_and_note
Browse files Browse the repository at this point in the history
  • Loading branch information
y21 committed May 25, 2023
1 parent 9b1d0b2 commit ad8126a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions clippy_lints/src/large_stack_frames.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::ops::AddAssign;

use clippy_utils::diagnostics::span_lint_and_then;
use clippy_utils::diagnostics::span_lint_and_note;
use rustc_hir::def_id::LocalDefId;
use rustc_hir::intravisit::FnKind;
use rustc_hir::Body;
Expand Down Expand Up @@ -146,14 +146,13 @@ impl<'tcx> LateLintPass<'tcx> for LargeStackFrames {
}

if frame_size.exceeds_limit(self.maximum_allowed_size) {
span_lint_and_then(
span_lint_and_note(
cx,
LARGE_STACK_FRAMES,
span,
"this function allocates a large amount of stack space",
|diag| {
diag.note("allocating large amounts of stack space can overflow the stack");
},
None,
"allocating large amounts of stack space can overflow the stack",
);
}
}
Expand Down

0 comments on commit ad8126a

Please sign in to comment.