Use bool in favor of Option<()> for diagnostics
This commit is contained in:
parent
4d5b3b1962
commit
25ff9b6bcb
48 changed files with 106 additions and 121 deletions
|
@ -2619,8 +2619,7 @@ fn check_duplicates(
|
|||
warning: matches!(
|
||||
duplicates,
|
||||
FutureWarnFollowing | FutureWarnPreceding
|
||||
)
|
||||
.then_some(()),
|
||||
),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue