//! Clippy wrappers around rustc's diagnostic functions.
+//!
+//! These functions are used by the `INTERNAL_METADATA_COLLECTOR` lint to collect the corresponding
+//! lint applicability. Please make sure that you update the `LINT_EMISSION_FUNCTIONS` variable in
+//! `clippy_lints::utils::internal_lints::metadata_collector` when a new function is added
+//! or renamed.
+//!
+//! Thank you!
+//! ~The `INTERNAL_METADATA_COLLECTOR` lint
use rustc_errors::{Applicability, DiagnosticBuilder};
use rustc_hir::HirId;
///
/// # Example
///
-/// ```ignore
+/// ```text
/// error: constant division of 0.0 with 0.0 will always result in NaN
/// --> $DIR/zero_div_zero.rs:6:25
/// |
///
/// # Example
///
-/// ```ignore
+/// ```text
/// error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
/// --> $DIR/drop_forget_ref.rs:10:5
/// |
cx: &LateContext<'_>,
lint: &'static Lint,
hir_id: HirId,
- sp: Span,
+ sp: impl Into<MultiSpan>,
msg: &str,
f: impl FnOnce(&mut DiagnosticBuilder<'_>),
) {
///
/// # Example
///
-/// ```ignore
+/// ```text
/// error: This `.fold` can be more succinctly expressed as `.any`
/// --> $DIR/methods.rs:390:13
/// |
where
I: IntoIterator<Item = (Span, String)>,
{
- multispan_sugg_with_applicability(diag, help_msg, Applicability::Unspecified, sugg)
+ multispan_sugg_with_applicability(diag, help_msg, Applicability::Unspecified, sugg);
}
/// Create a suggestion made from several `span → replacement`.