@@ -1352,7 +1352,14 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
13521352 }
13531353 // FIXME: check the values
13541354 }
1355- TerminatorKind :: Call { func, args, destination, call_source, target, .. } => {
1355+ TerminatorKind :: Call { func, args, .. }
1356+ | TerminatorKind :: TailCall { func, args, .. } => {
1357+ let call_source = match term. kind {
1358+ TerminatorKind :: Call { call_source, .. } => call_source,
1359+ TerminatorKind :: TailCall { .. } => CallSource :: Normal ,
1360+ _ => unreachable ! ( ) ,
1361+ } ;
1362+
13561363 self . check_operand ( func, term_location) ;
13571364 for arg in args {
13581365 self . check_operand ( & arg. node , term_location) ;
@@ -1425,7 +1432,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
14251432 ) ;
14261433 }
14271434
1428- self . check_call_dest ( body, term, & sig, * destination, * target, term_location) ;
1435+ if let TerminatorKind :: Call { destination, target, .. } = term. kind {
1436+ self . check_call_dest ( body, term, & sig, destination, target, term_location) ;
1437+ }
14291438
14301439 // The ordinary liveness rules will ensure that all
14311440 // regions in the type of the callee are live here. We
@@ -1443,7 +1452,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
14431452 . add_location ( region_vid, term_location) ;
14441453 }
14451454
1446- self . check_call_inputs ( body, term, func, & sig, args, term_location, * call_source) ;
1455+ self . check_call_inputs ( body, term, func, & sig, args, term_location, call_source) ;
14471456 }
14481457 TerminatorKind :: Assert { cond, msg, .. } => {
14491458 self . check_operand ( cond, term_location) ;
@@ -1675,6 +1684,11 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
16751684 span_mirbug ! ( self , block_data, "return on cleanup block" )
16761685 }
16771686 }
1687+ TerminatorKind :: TailCall { .. } => {
1688+ if is_cleanup {
1689+ span_mirbug ! ( self , block_data, "tailcall on cleanup block" )
1690+ }
1691+ }
16781692 TerminatorKind :: CoroutineDrop { .. } => {
16791693 if is_cleanup {
16801694 span_mirbug ! ( self , block_data, "coroutine_drop in cleanup block" )
0 commit comments