Expand incorrect_fn_null_check lint with reference null checking

This commit is contained in:
Urgau 2023-07-12 16:17:58 +02:00
parent c435af0d5c
commit 743ae5a2eb
5 changed files with 133 additions and 23 deletions

View file

@ -615,9 +615,17 @@ pub struct ExpectationNote {
// fn_null_check.rs
#[derive(LintDiagnostic)]
#[diag(lint_fn_null_check)]
#[help]
pub struct FnNullCheckDiag;
pub enum FnNullCheckDiag<'a> {
#[diag(lint_fn_null_check_fn_ptr)]
#[help(lint_help)]
FnPtr,
#[diag(lint_fn_null_check_ref)]
Ref {
orig_ty: Ty<'a>,
#[label]
label: Span,
},
}
// for_loops_over_fallibles.rs
#[derive(LintDiagnostic)]