replace if-let and while-let with if let
and while let
This commit is contained in:
parent
ee88f46bb5
commit
0f04875d2e
18 changed files with 45 additions and 45 deletions
|
@ -368,9 +368,9 @@ fn unreachable_pattern(tcx: TyCtxt<'_>, span: Span, id: HirId, catchall: Option<
|
|||
fn irrefutable_let_pattern(tcx: TyCtxt<'_>, span: Span, id: HirId, source: hir::MatchSource) {
|
||||
tcx.struct_span_lint_hir(IRREFUTABLE_LET_PATTERNS, id, span, |lint| {
|
||||
let msg = match source {
|
||||
hir::MatchSource::IfLetDesugar { .. } => "irrefutable if-let pattern",
|
||||
hir::MatchSource::WhileLetDesugar => "irrefutable while-let pattern",
|
||||
hir::MatchSource::IfLetGuardDesugar => "irrefutable if-let guard",
|
||||
hir::MatchSource::IfLetDesugar { .. } => "irrefutable `if let` pattern",
|
||||
hir::MatchSource::WhileLetDesugar => "irrefutable `while let` pattern",
|
||||
hir::MatchSource::IfLetGuardDesugar => "irrefutable `if let` guard",
|
||||
_ => bug!(),
|
||||
};
|
||||
lint.build(msg).emit()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue