Skip to content

Commit

Permalink
Clippy: cfg out validate_diag on release builds
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed Nov 8, 2024
1 parent 6ced8c3 commit c21c781
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions clippy_utils/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
//! Thank you!
//! ~The `INTERNAL_METADATA_COLLECTOR` lint
use rustc_errors::{
Applicability, Diag, DiagMessage, EmissionGuarantee, MultiSpan, SubdiagMessage, SubstitutionPart, Suggestions,
};
use rustc_errors::{Applicability, Diag, DiagMessage, MultiSpan, SubdiagMessage};
#[cfg(debug_assertions)]
use rustc_errors::{EmissionGuarantee, SubstitutionPart, Suggestions};
use rustc_hir::HirId;
use rustc_lint::{LateContext, Lint, LintContext};
use rustc_span::Span;
Expand Down Expand Up @@ -38,6 +38,7 @@ fn docs_link(diag: &mut Diag<'_, ()>, lint: &'static Lint) {
/// only started triggered there.
///
/// This function makes sure we also validate them in debug clippy builds.
#[cfg(debug_assertions)]
fn validate_diag(diag: &Diag<'_, impl EmissionGuarantee>) {
let suggestions = match &diag.suggestions {
Suggestions::Enabled(suggs) => &**suggs,
Expand Down

0 comments on commit c21c781

Please sign in to comment.