From 47b1b7a207c6fa1c0af0dfc789c253f6c40bbf7f Mon Sep 17 00:00:00 2001 From: Lindsey Kuper Date: Fri, 22 Jun 2012 15:33:29 -0700 Subject: [PATCH] Don't need a span on "main function not found" error. Issue #2707. --- src/rustc/middle/typeck.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rustc/middle/typeck.rs b/src/rustc/middle/typeck.rs index 636a0b0c9b9..ad1a613e739 100644 --- a/src/rustc/middle/typeck.rs +++ b/src/rustc/middle/typeck.rs @@ -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; if !tcx.sess.building_library { alt copy tcx.sess.main_fn { 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}; collect::collect_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(); (ccx.method_map, ccx.vtable_map) }