diff options
| author | y21 <30553356+y21@users.noreply.github.com> | 2023-05-25 20:30:38 +0200 |
|---|---|---|
| committer | y21 <30553356+y21@users.noreply.github.com> | 2023-06-12 12:21:38 +0200 |
| commit | 6b232fdee9c8d65ca40ce112a83e92a8c395c398 (patch) | |
| tree | 248972dae827642f13bd8698f4e46dc6db35a1ce | |
| parent | 52c6ef77fd620f9efc486280fd237adaddd9fc29 (diff) | |
| download | rust-6b232fdee9c8d65ca40ce112a83e92a8c395c398.tar.gz rust-6b232fdee9c8d65ca40ce112a83e92a8c395c398.zip | |
use span_lint_and_note
| -rw-r--r-- | clippy_lints/src/large_stack_frames.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clippy_lints/src/large_stack_frames.rs b/clippy_lints/src/large_stack_frames.rs index 0da953e6917..87daa2e7da0 100644 --- a/clippy_lints/src/large_stack_frames.rs +++ b/clippy_lints/src/large_stack_frames.rs @@ -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; @@ -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", ); } } |
