Function clippy_utils::diagnostics::span_lint_and_help
source · pub fn span_lint_and_help<'a, T: LintContext>(
cx: &'a T,
lint: &'static Lint,
span: impl Into<MultiSpan>,
msg: &str,
help_span: Option<Span>,
help: &str
)
Expand description
Same as span_lint
but with an extra help
message.
Use this if you want to provide some general help but can’t provide a specific machine applicable suggestion.
The help
message can be optionally attached to a Span
.
If you change the signature, remember to update the internal lint CollapsibleCalls
Example
error: constant division of 0.0 with 0.0 will always result in NaN
--> $DIR/zero_div_zero.rs:6:25
|
6 | let other_f64_nan = 0.0f64 / 0.0;
| ^^^^^^^^^^^^
|
= help: consider using `f64::NAN` if you would like a constant representing NaN