Skip to content

Commit cf34f9f

Browse files
committed
librustc: Allow intra-crate start functions, for runtimeless operation.
1 parent e2f8b51 commit cf34f9f

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
@@ -2329,9 +2329,7 @@ pub fn create_entry_wrapper(ccx: @CrateContext,
23292329
llvm::LLVMPositionBuilderAtEnd(bld, llbb);
23302330
23312331
let start_def_id = ccx.tcx.lang_items.start_fn();
2332-
if start_def_id.crate == ast::local_crate {
2333-
ccx.sess.bug("start lang item is never in the local crate")
2334-
} else {
2332+
if start_def_id.crate != ast::local_crate {
23352333
let start_fn_type = csearch::get_type(ccx.tcx,
23362334
start_def_id).ty;
23372335
trans_external_path(ccx, start_def_id, start_fn_type);
@@ -2348,8 +2346,7 @@ pub fn create_entry_wrapper(ccx: @CrateContext,
23482346
let (start_fn, args) = if use_start_lang_item {
23492347
let start_def_id = ccx.tcx.lang_items.start_fn();
23502348
let start_fn = if start_def_id.crate == ast::local_crate {
2351-
ccx.sess.bug("start lang item is never in the local \
2352-
crate")
2349+
get_item_val(ccx, start_def_id.node)
23532350
} else {
23542351
let start_fn_type = csearch::get_type(ccx.tcx,
23552352
start_def_id).ty;

0 commit comments

Comments
 (0)