Skip to content

Commit d8d59a9

Browse files
committed
Address Alex’s comments
1 parent 8943709 commit d8d59a9

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/librustc_trans/trans/base.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,28 +2127,27 @@ pub fn is_entry_fn(sess: &Session, node_id: ast::NodeId) -> bool {
21272127
/// Create the `main` function which will initialise the rust runtime and call users’ main
21282128
/// function.
21292129
pub fn create_entry_wrapper(ccx: &CrateContext,
2130-
_sp: Span,
2130+
sp: Span,
21312131
main_llfn: ValueRef) {
21322132
let et = ccx.sess().entry_type.get().unwrap();
21332133
match et {
21342134
config::EntryMain => {
2135-
create_entry_fn(ccx, _sp, main_llfn, true);
2135+
create_entry_fn(ccx, sp, main_llfn, true);
21362136
}
2137-
config::EntryStart => create_entry_fn(ccx, _sp, main_llfn, false),
2137+
config::EntryStart => create_entry_fn(ccx, sp, main_llfn, false),
21382138
config::EntryNone => {} // Do nothing.
21392139
}
21402140

2141-
#[inline(never)]
21422141
fn create_entry_fn(ccx: &CrateContext,
2143-
_sp: Span,
2142+
sp: Span,
21442143
rust_main: ValueRef,
21452144
use_start_lang_item: bool) {
21462145
let llfty = Type::func(&[ccx.int_type(), Type::i8p(ccx).ptr_to()],
21472146
&ccx.int_type());
21482147

21492148
let llfn = declare::define_cfn(ccx, "main", llfty,
21502149
ty::mk_nil(ccx.tcx())).unwrap_or_else(||{
2151-
ccx.sess().span_err(_sp, "entry symbol `main` defined multiple times");
2150+
ccx.sess().span_err(sp, "entry symbol `main` defined multiple times");
21522151
// FIXME: We should be smart and show a better diagnostic here.
21532152
ccx.sess().help("did you use #[no_mangle] on `fn main`? Use #[start] instead");
21542153
ccx.sess().abort_if_errors();

src/librustc_trans/trans/declare.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
//! ValueRef they return.
2020
//! * Use define_* family of methods when you might be defining the ValueRef.
2121
//! * When in doubt, define.
22-
#![allow(dead_code)]
23-
2422
use llvm::{self, ValueRef};
2523
use middle::ty::{self, ClosureTyper};
2624
use syntax::abi;

0 commit comments

Comments
 (0)