@@ -452,15 +452,15 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
452452
453453 let tcx = self . tcx ;
454454 match expr. kind {
455- ExprKind :: Lit ( ref lit) => self . check_lit ( lit, expected) ,
456- ExprKind :: Binary ( op, lhs, rhs) => self . check_binop ( expr, op, lhs, rhs, expected) ,
455+ ExprKind :: Lit ( ref lit) => self . check_expr_lit ( lit, expected) ,
456+ ExprKind :: Binary ( op, lhs, rhs) => self . check_expr_binop ( expr, op, lhs, rhs, expected) ,
457457 ExprKind :: Assign ( lhs, rhs, span) => {
458458 self . check_expr_assign ( expr, expected, lhs, rhs, span)
459459 }
460460 ExprKind :: AssignOp ( op, lhs, rhs) => {
461- self . check_binop_assign ( expr, op, lhs, rhs, expected)
461+ self . check_expr_binop_assign ( expr, op, lhs, rhs, expected)
462462 }
463- ExprKind :: Unary ( unop, oprnd) => self . check_expr_unary ( unop, oprnd, expected, expr) ,
463+ ExprKind :: Unary ( unop, oprnd) => self . check_expr_unop ( unop, oprnd, expected, expr) ,
464464 ExprKind :: AddrOf ( kind, mutbl, oprnd) => {
465465 self . check_expr_addr_of ( kind, mutbl, oprnd, expected, expr)
466466 }
@@ -473,7 +473,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
473473 self . deferred_asm_checks . borrow_mut ( ) . push ( ( asm, expr. hir_id ) ) ;
474474 self . check_expr_asm ( asm)
475475 }
476- ExprKind :: OffsetOf ( container, fields) => self . check_offset_of ( container, fields, expr) ,
476+ ExprKind :: OffsetOf ( container, fields) => {
477+ self . check_expr_offset_of ( container, fields, expr)
478+ }
477479 ExprKind :: Break ( destination, ref expr_opt) => {
478480 self . check_expr_break ( destination, expr_opt. as_deref ( ) , expr)
479481 }
@@ -492,13 +494,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
492494 self . check_expr_loop ( body, source, expected, expr)
493495 }
494496 ExprKind :: Match ( discrim, arms, match_src) => {
495- self . check_match ( expr, discrim, arms, expected, match_src)
497+ self . check_expr_match ( expr, discrim, arms, expected, match_src)
496498 }
497499 ExprKind :: Closure ( closure) => self . check_expr_closure ( closure, expr. span , expected) ,
498- ExprKind :: Block ( body, _) => self . check_block_with_expected ( body, expected) ,
499- ExprKind :: Call ( callee, args) => self . check_call ( expr, callee, args, expected) ,
500+ ExprKind :: Block ( body, _) => self . check_expr_block ( body, expected) ,
501+ ExprKind :: Call ( callee, args) => self . check_expr_call ( expr, callee, args, expected) ,
500502 ExprKind :: MethodCall ( segment, receiver, args, _) => {
501- self . check_method_call ( expr, segment, receiver, args, expected)
503+ self . check_expr_method_call ( expr, segment, receiver, args, expected)
502504 }
503505 ExprKind :: Cast ( e, t) => self . check_expr_cast ( e, t, expr) ,
504506 ExprKind :: Type ( e, t) => {
@@ -508,7 +510,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
508510 ascribed_ty
509511 }
510512 ExprKind :: If ( cond, then_expr, opt_else_expr) => {
511- self . check_then_else ( cond, then_expr, opt_else_expr, expr. span , expected)
513+ self . check_expr_if ( cond, then_expr, opt_else_expr, expr. span , expected)
512514 }
513515 ExprKind :: DropTemps ( e) => self . check_expr_with_expectation ( e, expected) ,
514516 ExprKind :: Array ( args) => self . check_expr_array ( args, expected, expr) ,
@@ -520,7 +522,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
520522 ExprKind :: Struct ( qpath, fields, ref base_expr) => {
521523 self . check_expr_struct ( expr, expected, qpath, fields, base_expr)
522524 }
523- ExprKind :: Field ( base, field) => self . check_field ( expr, base, field, expected) ,
525+ ExprKind :: Field ( base, field) => self . check_expr_field ( expr, base, field, expected) ,
524526 ExprKind :: Index ( base, idx, brackets_span) => {
525527 self . check_expr_index ( base, idx, expr, brackets_span)
526528 }
@@ -529,7 +531,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
529531 }
530532 }
531533
532- fn check_expr_unary (
534+ fn check_expr_unop (
533535 & self ,
534536 unop : hir:: UnOp ,
535537 oprnd : & ' tcx hir:: Expr < ' tcx > ,
@@ -952,7 +954,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
952954 if self . ret_coercion_span . get ( ) . is_none ( ) {
953955 self . ret_coercion_span . set ( Some ( e. span ) ) ;
954956 }
955- self . check_return_expr ( e, true ) ;
957+ self . check_return_or_body_tail ( e, true ) ;
956958 } else {
957959 let mut coercion = self . ret_coercion . as_ref ( ) . unwrap ( ) . borrow_mut ( ) ;
958960 if self . ret_coercion_span . get ( ) . is_none ( ) {
@@ -1015,7 +1017,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10151017 ///
10161018 /// `explicit_return` is `true` if we're checking an explicit `return expr`,
10171019 /// and `false` if we're checking a trailing expression.
1018- pub ( super ) fn check_return_expr (
1020+ pub ( super ) fn check_return_or_body_tail (
10191021 & self ,
10201022 return_expr : & ' tcx hir:: Expr < ' tcx > ,
10211023 explicit_return : bool ,
@@ -1239,7 +1241,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12391241
12401242 // A generic function for checking the 'then' and 'else' clauses in an 'if'
12411243 // or 'if-else' expression.
1242- fn check_then_else (
1244+ fn check_expr_if (
12431245 & self ,
12441246 cond_expr : & ' tcx hir:: Expr < ' tcx > ,
12451247 then_expr : & ' tcx hir:: Expr < ' tcx > ,
@@ -1522,7 +1524,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
15221524 }
15231525
15241526 /// Checks a method call.
1525- fn check_method_call (
1527+ fn check_expr_method_call (
15261528 & self ,
15271529 expr : & ' tcx hir:: Expr < ' tcx > ,
15281530 segment : & ' tcx hir:: PathSegment < ' tcx > ,
@@ -2574,7 +2576,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
25742576 }
25752577
25762578 // Check field access expressions
2577- fn check_field (
2579+ fn check_expr_field (
25782580 & self ,
25792581 expr : & ' tcx hir:: Expr < ' tcx > ,
25802582 base : & ' tcx hir:: Expr < ' tcx > ,
@@ -3515,8 +3517,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
35153517 let previous_diverges = self . diverges . get ( ) ;
35163518
35173519 // The label blocks should have unit return value or diverge.
3518- let ty =
3519- self . check_block_with_expected ( block, ExpectHasType ( self . tcx . types . unit ) ) ;
3520+ let ty = self . check_expr_block ( block, ExpectHasType ( self . tcx . types . unit ) ) ;
35203521 if !ty. is_never ( ) {
35213522 self . demand_suptype ( block. span , self . tcx . types . unit , ty) ;
35223523 diverge = false ;
@@ -3531,7 +3532,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
35313532 if diverge { self . tcx . types . never } else { self . tcx . types . unit }
35323533 }
35333534
3534- fn check_offset_of (
3535+ fn check_expr_offset_of (
35353536 & self ,
35363537 container : & ' tcx hir:: Ty < ' tcx > ,
35373538 fields : & [ Ident ] ,
0 commit comments