@@ -511,7 +511,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
511
511
}
512
512
513
513
fn check_stmt ( & mut self , cx : & LateContext < ' a , ' tcx > , stmt : & ' tcx Stmt ) {
514
- if let StmtSemi ( ref expr, _) = stmt. node {
514
+ if let StmtKind :: Semi ( ref expr, _) = stmt. node {
515
515
if let ExprKind :: MethodCall ( ref method, _, ref args) = expr. node {
516
516
if args. len ( ) == 1 && method. ident . name == "collect" && match_trait_method ( cx, expr, & paths:: ITERATOR ) {
517
517
span_lint (
@@ -584,8 +584,8 @@ fn never_loop_block(block: &Block, main_loop_id: NodeId) -> NeverLoopResult {
584
584
585
585
fn stmt_to_expr ( stmt : & Stmt ) -> Option < & Expr > {
586
586
match stmt. node {
587
- StmtSemi ( ref e, ..) | StmtExpr ( ref e, ..) => Some ( e) ,
588
- StmtDecl ( ref d, ..) => decl_to_expr ( d) ,
587
+ StmtKind :: Semi ( ref e, ..) | StmtKind :: Expr ( ref e, ..) => Some ( e) ,
588
+ StmtKind :: Decl ( ref d, ..) => decl_to_expr ( d) ,
589
589
}
590
590
}
591
591
@@ -859,8 +859,8 @@ fn get_indexed_assignments<'a, 'tcx>(
859
859
stmts
860
860
. iter ( )
861
861
. map ( |stmt| match stmt. node {
862
- Stmt_ :: StmtDecl ( ..) => None ,
863
- Stmt_ :: StmtExpr ( ref e, _node_id) | Stmt_ :: StmtSemi ( ref e, _node_id) => Some ( get_assignment ( cx, e, var) ) ,
862
+ StmtKind :: Decl ( ..) => None ,
863
+ StmtKind :: Expr ( ref e, _node_id) | StmtKind :: Semi ( ref e, _node_id) => Some ( get_assignment ( cx, e, var) ) ,
864
864
} )
865
865
. chain (
866
866
expr. as_ref ( )
@@ -1809,7 +1809,7 @@ fn extract_expr_from_first_stmt(block: &Block) -> Option<&Expr> {
1809
1809
if block. stmts . is_empty ( ) {
1810
1810
return None ;
1811
1811
}
1812
- if let StmtDecl ( ref decl, _) = block. stmts [ 0 ] . node {
1812
+ if let StmtKind :: Decl ( ref decl, _) = block. stmts [ 0 ] . node {
1813
1813
if let DeclLocal ( ref local) = decl. node {
1814
1814
if let Some ( ref expr) = local. init {
1815
1815
Some ( expr)
@@ -1829,8 +1829,8 @@ fn extract_first_expr(block: &Block) -> Option<&Expr> {
1829
1829
match block. expr {
1830
1830
Some ( ref expr) if block. stmts . is_empty ( ) => Some ( expr) ,
1831
1831
None if !block. stmts . is_empty ( ) => match block. stmts [ 0 ] . node {
1832
- StmtExpr ( ref expr, _) | StmtSemi ( ref expr, _) => Some ( expr) ,
1833
- StmtDecl ( ..) => None ,
1832
+ StmtKind :: Expr ( ref expr, _) | StmtKind :: Semi ( ref expr, _) => Some ( expr) ,
1833
+ StmtKind :: Decl ( ..) => None ,
1834
1834
} ,
1835
1835
_ => None ,
1836
1836
}
0 commit comments