@@ -452,15 +452,15 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
452
452
453
453
let tcx = self . tcx ;
454
454
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) ,
457
457
ExprKind :: Assign ( lhs, rhs, span) => {
458
458
self . check_expr_assign ( expr, expected, lhs, rhs, span)
459
459
}
460
460
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)
462
462
}
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) ,
464
464
ExprKind :: AddrOf ( kind, mutbl, oprnd) => {
465
465
self . check_expr_addr_of ( kind, mutbl, oprnd, expected, expr)
466
466
}
@@ -473,7 +473,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
473
473
self . deferred_asm_checks . borrow_mut ( ) . push ( ( asm, expr. hir_id ) ) ;
474
474
self . check_expr_asm ( asm)
475
475
}
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
+ }
477
479
ExprKind :: Break ( destination, ref expr_opt) => {
478
480
self . check_expr_break ( destination, expr_opt. as_deref ( ) , expr)
479
481
}
@@ -492,13 +494,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
492
494
self . check_expr_loop ( body, source, expected, expr)
493
495
}
494
496
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)
496
498
}
497
499
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) ,
500
502
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)
502
504
}
503
505
ExprKind :: Cast ( e, t) => self . check_expr_cast ( e, t, expr) ,
504
506
ExprKind :: Type ( e, t) => {
@@ -508,7 +510,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
508
510
ascribed_ty
509
511
}
510
512
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)
512
514
}
513
515
ExprKind :: DropTemps ( e) => self . check_expr_with_expectation ( e, expected) ,
514
516
ExprKind :: Array ( args) => self . check_expr_array ( args, expected, expr) ,
@@ -520,7 +522,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
520
522
ExprKind :: Struct ( qpath, fields, ref base_expr) => {
521
523
self . check_expr_struct ( expr, expected, qpath, fields, base_expr)
522
524
}
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) ,
524
526
ExprKind :: Index ( base, idx, brackets_span) => {
525
527
self . check_expr_index ( base, idx, expr, brackets_span)
526
528
}
@@ -529,7 +531,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
529
531
}
530
532
}
531
533
532
- fn check_expr_unary (
534
+ fn check_expr_unop (
533
535
& self ,
534
536
unop : hir:: UnOp ,
535
537
oprnd : & ' tcx hir:: Expr < ' tcx > ,
@@ -952,7 +954,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
952
954
if self . ret_coercion_span . get ( ) . is_none ( ) {
953
955
self . ret_coercion_span . set ( Some ( e. span ) ) ;
954
956
}
955
- self . check_return_expr ( e, true ) ;
957
+ self . check_return_or_body_tail ( e, true ) ;
956
958
} else {
957
959
let mut coercion = self . ret_coercion . as_ref ( ) . unwrap ( ) . borrow_mut ( ) ;
958
960
if self . ret_coercion_span . get ( ) . is_none ( ) {
@@ -1015,7 +1017,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1015
1017
///
1016
1018
/// `explicit_return` is `true` if we're checking an explicit `return expr`,
1017
1019
/// 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 (
1019
1021
& self ,
1020
1022
return_expr : & ' tcx hir:: Expr < ' tcx > ,
1021
1023
explicit_return : bool ,
@@ -1239,7 +1241,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1239
1241
1240
1242
// A generic function for checking the 'then' and 'else' clauses in an 'if'
1241
1243
// or 'if-else' expression.
1242
- fn check_then_else (
1244
+ fn check_expr_if (
1243
1245
& self ,
1244
1246
cond_expr : & ' tcx hir:: Expr < ' tcx > ,
1245
1247
then_expr : & ' tcx hir:: Expr < ' tcx > ,
@@ -1522,7 +1524,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1522
1524
}
1523
1525
1524
1526
/// Checks a method call.
1525
- fn check_method_call (
1527
+ fn check_expr_method_call (
1526
1528
& self ,
1527
1529
expr : & ' tcx hir:: Expr < ' tcx > ,
1528
1530
segment : & ' tcx hir:: PathSegment < ' tcx > ,
@@ -2574,7 +2576,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
2574
2576
}
2575
2577
2576
2578
// Check field access expressions
2577
- fn check_field (
2579
+ fn check_expr_field (
2578
2580
& self ,
2579
2581
expr : & ' tcx hir:: Expr < ' tcx > ,
2580
2582
base : & ' tcx hir:: Expr < ' tcx > ,
@@ -3515,8 +3517,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3515
3517
let previous_diverges = self . diverges . get ( ) ;
3516
3518
3517
3519
// 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 ) ) ;
3520
3521
if !ty. is_never ( ) {
3521
3522
self . demand_suptype ( block. span , self . tcx . types . unit , ty) ;
3522
3523
diverge = false ;
@@ -3531,7 +3532,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3531
3532
if diverge { self . tcx . types . never } else { self . tcx . types . unit }
3532
3533
}
3533
3534
3534
- fn check_offset_of (
3535
+ fn check_expr_offset_of (
3535
3536
& self ,
3536
3537
container : & ' tcx hir:: Ty < ' tcx > ,
3537
3538
fields : & [ Ident ] ,
0 commit comments