add OR_PATTERNS_BACK_COMPAT lint

test: add more cases

test: add comments

refine msg
This commit is contained in:
hi-rustin 2021-03-25 21:42:21 +08:00
parent 803ddb8359
commit 2c66e15468
7 changed files with 162 additions and 3 deletions

View file

@ -709,6 +709,9 @@ pub trait LintContext: Sized {
BuiltinLintDiagnostics::ProcMacroBackCompat(note) => {
db.note(&note);
}
BuiltinLintDiagnostics::OrPatternsBackCompat(span,suggestion) => {
db.span_suggestion(span, "use pat2015 to preserve semantics", suggestion, Applicability::MachineApplicable);
}
}
// Rewrap `db`, and pass control to the user.
decorate(LintDiagnosticBuilder::new(db));