Fix dogfood

This commit is contained in:
Cameron Steffen 2021-01-21 19:25:22 -06:00
parent 66afdd1f42
commit 50abde20c9
4 changed files with 4 additions and 8 deletions

View file

@ -43,8 +43,7 @@ impl LateLintPass<'_> for MainRecursion {
if_chain! {
if let ExprKind::Call(func, _) = &expr.kind;
if let ExprKind::Path(path) = &func.kind;
if let QPath::Resolved(_, path) = &path;
if let ExprKind::Path(QPath::Resolved(_, path)) = &func.kind;
if let Some(def_id) = path.res.opt_def_id();
if is_entrypoint_fn(cx, def_id);
then {

View file

@ -263,8 +263,7 @@ fn check_fn(cx: &LateContext<'_>, decl: &FnDecl<'_>, fn_id: HirId, opt_body_id:
} else if match_type(cx, ty, &paths::COW) {
if_chain! {
if let TyKind::Rptr(_, MutTy { ref ty, ..} ) = arg.kind;
if let TyKind::Path(ref path) = ty.kind;
if let QPath::Resolved(None, ref pp) = *path;
if let TyKind::Path(QPath::Resolved(None, ref pp)) = ty.kind;
if let [ref bx] = *pp.segments;
if let Some(ref params) = bx.args;
if !params.parenthesized;

View file

@ -158,8 +158,7 @@ pub fn for_loop<'tcx>(
/// `while cond { body }` becomes `(cond, body)`.
pub fn while_loop<'tcx>(expr: &'tcx hir::Expr<'tcx>) -> Option<(&'tcx hir::Expr<'tcx>, &'tcx hir::Expr<'tcx>)> {
if_chain! {
if let hir::ExprKind::Loop(block, _, hir::LoopSource::While) = &expr.kind;
if let hir::Block { expr: Some(expr), .. } = &**block;
if let hir::ExprKind::Loop(hir::Block { expr: Some(expr), .. }, _, hir::LoopSource::While) = &expr.kind;
if let hir::ExprKind::Match(cond, arms, hir::MatchSource::WhileDesugar) = &expr.kind;
if let hir::ExprKind::DropTemps(cond) = &cond.kind;
if let [hir::Arm { body, .. }, ..] = &arms[..];

View file

@ -1126,8 +1126,7 @@ pub fn is_self(slf: &Param<'_>) -> bool {
pub fn is_self_ty(slf: &hir::Ty<'_>) -> bool {
if_chain! {
if let TyKind::Path(ref qp) = slf.kind;
if let QPath::Resolved(None, ref path) = *qp;
if let TyKind::Path(QPath::Resolved(None, ref path)) = slf.kind;
if let Res::SelfTy(..) = path.res;
then {
return true