1
Fork 0

Use bool in favor of Option<()> for diagnostics

This commit is contained in:
Michael Goulet 2024-08-21 00:57:58 -04:00
parent 4d5b3b1962
commit 25ff9b6bcb
48 changed files with 106 additions and 121 deletions

View file

@ -2619,8 +2619,7 @@ fn check_duplicates(
warning: matches!(
duplicates,
FutureWarnFollowing | FutureWarnPreceding
)
.then_some(()),
),
},
);
}

View file

@ -49,7 +49,7 @@ fn report_duplicate_item(
orig_span,
crate_name: tcx.crate_name(item_def_id.krate),
orig_crate_name: tcx.crate_name(original_def_id.krate),
different_crates: (item_def_id.krate != original_def_id.krate).then_some(()),
different_crates: (item_def_id.krate != original_def_id.krate),
name,
});
}

View file

@ -752,7 +752,7 @@ pub struct UnusedDuplicate {
#[note]
pub other: Span,
#[warning]
pub warning: Option<()>,
pub warning: bool,
}
#[derive(Diagnostic)]
@ -911,7 +911,7 @@ pub struct DuplicateDiagnosticItemInCrate {
#[note(passes_diagnostic_item_first_defined)]
pub orig_span: Option<Span>,
#[note]
pub different_crates: Option<()>,
pub different_crates: bool,
pub crate_name: Symbol,
pub orig_crate_name: Symbol,
pub name: Symbol,