File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -2681,13 +2681,15 @@ fn check_main_fn_ty(tcx: &ty::ctxt, main_id: &ast::node_id) {
2681
2681
ok &=
2682
2682
num_args == 0 u || num_args == 1 u && arg_is_argv_ty ( tcx, args. ( 0 ) ) ;
2683
2683
if !ok {
2684
- tcx. sess . err ( "wrong type in main function: found " +
2685
- ty_to_str ( tcx, main_t) ) ;
2684
+ let span = ast_map:: node_span ( tcx. items . get ( main_id) ) ;
2685
+ tcx. sess . span_err ( span, "wrong type in main function: found " +
2686
+ ty_to_str ( tcx, main_t) ) ;
2686
2687
}
2687
2688
}
2688
2689
_ {
2689
- tcx. sess . bug ( "main has a non-function type: found" +
2690
- ty_to_str ( tcx, main_t) ) ;
2690
+ let span = ast_map:: node_span ( tcx. items . get ( main_id) ) ;
2691
+ tcx. sess . span_bug ( span, "main has a non-function type: found" +
2692
+ ty_to_str ( tcx, main_t) ) ;
2691
2693
}
2692
2694
}
2693
2695
}
You can’t perform that action at this time.
0 commit comments