mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
manual_let_else
: Delay msrv and macro checks.
This commit is contained in:
parent
95348adcb9
commit
2d9e67ea8a
1 changed files with 2 additions and 4 deletions
|
@ -49,16 +49,14 @@ declare_clippy_lint! {
|
|||
|
||||
impl<'tcx> QuestionMark {
|
||||
pub(crate) fn check_manual_let_else(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'tcx>) {
|
||||
if !self.msrv.meets(msrvs::LET_ELSE) || in_external_macro(cx.sess(), stmt.span) {
|
||||
return;
|
||||
}
|
||||
|
||||
if let StmtKind::Let(local) = stmt.kind
|
||||
&& let Some(init) = local.init
|
||||
&& local.els.is_none()
|
||||
&& local.ty.is_none()
|
||||
&& init.span.eq_ctxt(stmt.span)
|
||||
&& let Some(if_let_or_match) = IfLetOrMatch::parse(cx, init)
|
||||
&& self.msrv.meets(msrvs::LET_ELSE)
|
||||
&& !in_external_macro(cx.sess(), stmt.span)
|
||||
{
|
||||
match if_let_or_match {
|
||||
IfLetOrMatch::IfLet(if_let_expr, let_pat, if_then, if_else, ..) => {
|
||||
|
|
Loading…
Reference in a new issue