Skip to content

Commit 0ca9a3e

Browse files
committed
---
yaml --- r: 4557 b: refs/heads/master c: 0cddcac h: refs/heads/master i: 4555: f6d3b02 v: v3
1 parent 19a48d1 commit 0ca9a3e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 612fe3d2d6fa0dcb3d92a0d83ec7f2418dd8c7ce
2+
refs/heads/master: 0cddcac0169a33163dc434eb325d48d7f193efc4

trunk/src/comp/middle/typeck.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -2681,13 +2681,15 @@ fn check_main_fn_ty(tcx: &ty::ctxt, main_id: &ast::node_id) {
26812681
ok &=
26822682
num_args == 0u || num_args == 1u && arg_is_argv_ty(tcx, args.(0));
26832683
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));
26862687
}
26872688
}
26882689
_ {
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));
26912693
}
26922694
}
26932695
}

0 commit comments

Comments
 (0)