suggest fix for attempted integer identifier in patterns
This commit is contained in:
parent
61a415be59
commit
1babece1e8
8 changed files with 99 additions and 4 deletions
|
@ -770,6 +770,8 @@ pub(crate) struct PatternNotCovered<'s, 'tcx> {
|
|||
#[subdiagnostic]
|
||||
pub let_suggestion: Option<SuggestLet>,
|
||||
#[subdiagnostic]
|
||||
pub misc_suggestion: Option<MiscPatternSuggestion>,
|
||||
#[subdiagnostic]
|
||||
pub res_defined_here: Option<ResDefinedHere>,
|
||||
}
|
||||
|
||||
|
@ -848,3 +850,16 @@ pub enum SuggestLet {
|
|||
count: usize,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
pub enum MiscPatternSuggestion {
|
||||
#[suggestion(
|
||||
mir_build_suggest_attempted_int_lit,
|
||||
code = "_",
|
||||
applicability = "maybe-incorrect"
|
||||
)]
|
||||
AttemptedIntegerLiteral {
|
||||
#[primary_span]
|
||||
start_span: Span,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue