@@ -61,38 +61,38 @@ fn extract_call<'a, 'tcx>(cx: &'a LateContext<'a, 'tcx>, e: &'tcx Expr<'_>) -> O
61
61
if block. stmts. len( ) == 1 ;
62
62
if let StmtKind :: Semi ( ref matchexpr) = block. stmts[ 0 ] . kind;
63
63
then {
64
+ // debug_assert
64
65
if_chain! {
65
66
if let ExprKind :: Match ( ref ifclause, _, _) = matchexpr. kind;
66
67
if let ExprKind :: DropTemps ( ref droptmp) = ifclause. kind;
67
68
if let ExprKind :: Unary ( UnOp :: UnNot , ref condition) = droptmp. kind;
68
69
then {
69
- // debug_assert
70
70
let mut visitor = MutArgVisitor :: new( cx) ;
71
71
visitor. visit_expr( condition) ;
72
72
return visitor. expr_span( ) ;
73
- } else {
74
- // debug_assert_{eq,ne }
75
- if_chain! {
76
- if let ExprKind :: Block ( ref matchblock , _ ) = matchexpr . kind ;
77
- if let Some ( ref matchheader ) = matchblock . expr ;
78
- if let ExprKind :: Match ( ref headerexpr , _, _ ) = matchheader . kind;
79
- if let ExprKind :: Tup ( ref conditions ) = headerexpr . kind ;
80
- if conditions . len ( ) == 2 ;
81
- then {
82
- if let ExprKind :: AddrOf ( BorrowKind :: Ref , _ , ref lhs ) = conditions [ 0 ] . kind {
83
- let mut visitor = MutArgVisitor :: new ( cx ) ;
84
- visitor . visit_expr ( lhs ) ;
85
- if let Some ( span ) = visitor . expr_span ( ) {
86
- return Some ( span ) ;
87
- }
88
- }
89
- if let ExprKind :: AddrOf ( BorrowKind :: Ref , _ , ref rhs ) = conditions [ 1 ] . kind {
90
- let mut visitor = MutArgVisitor :: new ( cx ) ;
91
- visitor . visit_expr ( rhs ) ;
92
- if let Some ( span ) = visitor . expr_span ( ) {
93
- return Some ( span ) ;
94
- }
95
- }
73
+ }
74
+ }
75
+
76
+ // debug_assert_{eq,ne}
77
+ if_chain! {
78
+ if let ExprKind :: Block ( ref matchblock , _) = matchexpr . kind;
79
+ if let Some ( ref matchheader ) = matchblock . expr ;
80
+ if let ExprKind :: Match ( ref headerexpr , _ , _ ) = matchheader . kind ;
81
+ if let ExprKind :: Tup ( ref conditions ) = headerexpr . kind ;
82
+ if conditions . len ( ) == 2 ;
83
+ then {
84
+ if let ExprKind :: AddrOf ( BorrowKind :: Ref , _ , ref lhs ) = conditions [ 0 ] . kind {
85
+ let mut visitor = MutArgVisitor :: new ( cx ) ;
86
+ visitor . visit_expr ( lhs ) ;
87
+ if let Some ( span ) = visitor . expr_span ( ) {
88
+ return Some ( span ) ;
89
+ }
90
+ }
91
+ if let ExprKind :: AddrOf ( BorrowKind :: Ref , _ , ref rhs ) = conditions [ 1 ] . kind {
92
+ let mut visitor = MutArgVisitor :: new ( cx ) ;
93
+ visitor . visit_expr ( rhs ) ;
94
+ if let Some ( span ) = visitor . expr_span ( ) {
95
+ return Some ( span ) ;
96
96
}
97
97
}
98
98
}
0 commit comments