Skip to content

Commit 47b1b7a

Browse files
committed
Don't need a span on "main function not found" error. Issue #2707.
1 parent 5cf99e0 commit 47b1b7a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rustc/middle/typeck.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,12 @@ fn check_main_fn_ty(ccx: @crate_ctxt,
271271
}
272272
}
273273

274-
fn check_for_main_fn(ccx: @crate_ctxt, crate: @ast::crate) {
274+
fn check_for_main_fn(ccx: @crate_ctxt) {
275275
let tcx = ccx.tcx;
276276
if !tcx.sess.building_library {
277277
alt copy tcx.sess.main_fn {
278278
some((id, sp)) { check_main_fn_ty(ccx, id, sp); }
279-
none { tcx.sess.span_err(crate.span, "main function not found"); }
279+
none { tcx.sess.err("main function not found"); }
280280
}
281281
}
282282
}
@@ -289,7 +289,7 @@ fn check_crate(tcx: ty::ctxt, impl_map: resolve::impl_map,
289289
tcx: tcx};
290290
collect::collect_item_types(ccx, crate);
291291
check::check_item_types(ccx, crate);
292-
check_for_main_fn(ccx, crate);
292+
check_for_main_fn(ccx);
293293
tcx.sess.abort_if_errors();
294294
(ccx.method_map, ccx.vtable_map)
295295
}

0 commit comments

Comments
 (0)