Don't need a span on "main function not found" error. Issue #2707.
This commit is contained in:
parent
5cf99e02b5
commit
47b1b7a207
@ -271,12 +271,12 @@ fn check_main_fn_ty(ccx: @crate_ctxt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_for_main_fn(ccx: @crate_ctxt, crate: @ast::crate) {
|
fn check_for_main_fn(ccx: @crate_ctxt) {
|
||||||
let tcx = ccx.tcx;
|
let tcx = ccx.tcx;
|
||||||
if !tcx.sess.building_library {
|
if !tcx.sess.building_library {
|
||||||
alt copy tcx.sess.main_fn {
|
alt copy tcx.sess.main_fn {
|
||||||
some((id, sp)) { check_main_fn_ty(ccx, id, sp); }
|
some((id, sp)) { check_main_fn_ty(ccx, id, sp); }
|
||||||
none { tcx.sess.span_err(crate.span, "main function not found"); }
|
none { tcx.sess.err("main function not found"); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -289,7 +289,7 @@ fn check_crate(tcx: ty::ctxt, impl_map: resolve::impl_map,
|
|||||||
tcx: tcx};
|
tcx: tcx};
|
||||||
collect::collect_item_types(ccx, crate);
|
collect::collect_item_types(ccx, crate);
|
||||||
check::check_item_types(ccx, crate);
|
check::check_item_types(ccx, crate);
|
||||||
check_for_main_fn(ccx, crate);
|
check_for_main_fn(ccx);
|
||||||
tcx.sess.abort_if_errors();
|
tcx.sess.abort_if_errors();
|
||||||
(ccx.method_map, ccx.vtable_map)
|
(ccx.method_map, ccx.vtable_map)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user