@@ -1370,7 +1370,14 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
13701370 }
13711371 // FIXME: check the values
13721372 }
1373- TerminatorKind :: Call { func, args, destination, call_source, target, .. } => {
1373+ TerminatorKind :: Call { func, args, .. }
1374+ | TerminatorKind :: TailCall { func, args, .. } => {
1375+ let call_source = match term. kind {
1376+ TerminatorKind :: Call { call_source, .. } => call_source,
1377+ TerminatorKind :: TailCall { .. } => CallSource :: Normal ,
1378+ _ => unreachable ! ( ) ,
1379+ } ;
1380+
13741381 self . check_operand ( func, term_location) ;
13751382 for arg in args {
13761383 self . check_operand ( arg, term_location) ;
@@ -1428,7 +1435,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
14281435 ConstraintCategory :: Boring ,
14291436 ) ;
14301437 let sig = self . normalize ( sig, term_location) ;
1431- self . check_call_dest ( body, term, & sig, * destination, * target, term_location) ;
1438+
1439+ if let TerminatorKind :: Call { destination, target, .. } = term. kind {
1440+ self . check_call_dest ( body, term, & sig, destination, target, term_location) ;
1441+ }
14321442
14331443 // The ordinary liveness rules will ensure that all
14341444 // regions in the type of the callee are live here. We
@@ -1446,7 +1456,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
14461456 . add_element ( region_vid, term_location) ;
14471457 }
14481458
1449- self . check_call_inputs ( body, term, & sig, args, term_location, * call_source) ;
1459+ self . check_call_inputs ( body, term, & sig, args, term_location, call_source) ;
14501460 }
14511461 TerminatorKind :: Assert { cond, msg, .. } => {
14521462 self . check_operand ( cond, term_location) ;
@@ -1639,6 +1649,11 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
16391649 span_mirbug ! ( self , block_data, "return on cleanup block" )
16401650 }
16411651 }
1652+ TerminatorKind :: TailCall { .. } => {
1653+ if is_cleanup {
1654+ span_mirbug ! ( self , block_data, "tailcall on cleanup block" )
1655+ }
1656+ }
16421657 TerminatorKind :: GeneratorDrop { .. } => {
16431658 if is_cleanup {
16441659 span_mirbug ! ( self , block_data, "generator_drop in cleanup block" )
0 commit comments