We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 612fe3d commit 0cddcacCopy full SHA for 0cddcac
src/comp/middle/typeck.rs
@@ -2681,13 +2681,15 @@ fn check_main_fn_ty(tcx: &ty::ctxt, main_id: &ast::node_id) {
2681
ok &=
2682
num_args == 0u || num_args == 1u && arg_is_argv_ty(tcx, args.(0));
2683
if !ok {
2684
- tcx.sess.err("wrong type in main function: found " +
2685
- ty_to_str(tcx, main_t));
+ let span = ast_map::node_span(tcx.items.get(main_id));
+ tcx.sess.span_err(span, "wrong type in main function: found " +
2686
+ ty_to_str(tcx, main_t));
2687
}
2688
2689
_ {
- tcx.sess.bug("main has a non-function type: found" +
2690
2691
+ tcx.sess.span_bug(span, "main has a non-function type: found" +
2692
2693
2694
2695
0 commit comments