Skip to content

Commit 2061ce9

Browse files
committed
auto merge of #6741 : pcwalton/rust/intra-crate-start, r=graydon
r? @brson
2 parents e6a838d + cf34f9f commit 2061ce9

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/librustc/middle/trans/base.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2339,9 +2339,7 @@ pub fn create_entry_wrapper(ccx: @CrateContext,
23392339
llvm::LLVMPositionBuilderAtEnd(bld, llbb);
23402340
23412341
let start_def_id = ccx.tcx.lang_items.start_fn();
2342-
if start_def_id.crate == ast::local_crate {
2343-
ccx.sess.bug("start lang item is never in the local crate")
2344-
} else {
2342+
if start_def_id.crate != ast::local_crate {
23452343
let start_fn_type = csearch::get_type(ccx.tcx,
23462344
start_def_id).ty;
23472345
trans_external_path(ccx, start_def_id, start_fn_type);
@@ -2358,8 +2356,7 @@ pub fn create_entry_wrapper(ccx: @CrateContext,
23582356
let (start_fn, args) = if use_start_lang_item {
23592357
let start_def_id = ccx.tcx.lang_items.start_fn();
23602358
let start_fn = if start_def_id.crate == ast::local_crate {
2361-
ccx.sess.bug("start lang item is never in the local \
2362-
crate")
2359+
get_item_val(ccx, start_def_id.node)
23632360
} else {
23642361
let start_fn_type = csearch::get_type(ccx.tcx,
23652362
start_def_id).ty;

0 commit comments

Comments
 (0)