@@ -645,18 +645,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
645
645
self . typeck_results . borrow ( ) . qpath_res ( qpath, callee_expr. hir_id )
646
646
}
647
647
hir:: ExprKind :: Call ( ref inner_callee, _) => {
648
- // If the call spans more than one line and the callee kind is
649
- // itself another `ExprCall`, that's a clue that we might just be
650
- // missing a semicolon (Issue #51055)
651
- let call_is_multiline = self . tcx . sess . source_map ( ) . is_multiline ( call_expr. span ) ;
652
- if call_is_multiline {
653
- err. span_suggestion (
654
- callee_expr. span . shrink_to_hi ( ) ,
655
- "consider using a semicolon here" ,
656
- ";" ,
657
- Applicability :: MaybeIncorrect ,
658
- ) ;
659
- }
660
648
if let hir:: ExprKind :: Path ( ref inner_qpath) = inner_callee. kind {
661
649
inner_callee_path = Some ( inner_qpath) ;
662
650
self . typeck_results . borrow ( ) . qpath_res ( inner_qpath, inner_callee. hir_id )
@@ -668,6 +656,23 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
668
656
} ;
669
657
670
658
if !self . maybe_suggest_bad_array_definition ( & mut err, call_expr, callee_expr) {
659
+ // If the call spans more than one line and the callee kind is
660
+ // itself another `ExprCall`, that's a clue that we might just be
661
+ // missing a semicolon (#51055, #106515).
662
+ let call_is_multiline = self
663
+ . tcx
664
+ . sess
665
+ . source_map ( )
666
+ . is_multiline ( call_expr. span . with_lo ( callee_expr. span . hi ( ) ) )
667
+ && call_expr. span . ctxt ( ) == callee_expr. span . ctxt ( ) ;
668
+ if call_is_multiline {
669
+ err. span_suggestion (
670
+ callee_expr. span . shrink_to_hi ( ) ,
671
+ "consider using a semicolon here to finish the statement" ,
672
+ ";" ,
673
+ Applicability :: MaybeIncorrect ,
674
+ ) ;
675
+ }
671
676
if let Some ( ( maybe_def, output_ty, _) ) = self . extract_callable_info ( callee_ty)
672
677
&& !self . type_is_sized_modulo_regions ( self . param_env , output_ty)
673
678
{
0 commit comments