Skip to content

Commit f6e62ac

Browse files
committed
Address Alex’s comments
1 parent c9ead84 commit f6e62ac

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/librustc_trans/trans/base.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -2172,28 +2172,27 @@ pub fn is_entry_fn(sess: &Session, node_id: ast::NodeId) -> bool {
21722172
/// Create the `main` function which will initialise the rust runtime and call users’ main
21732173
/// function.
21742174
pub fn create_entry_wrapper(ccx: &CrateContext,
2175-
_sp: Span,
2175+
sp: Span,
21762176
main_llfn: ValueRef) {
21772177
let et = ccx.sess().entry_type.get().unwrap();
21782178
match et {
21792179
config::EntryMain => {
2180-
create_entry_fn(ccx, _sp, main_llfn, true);
2180+
create_entry_fn(ccx, sp, main_llfn, true);
21812181
}
2182-
config::EntryStart => create_entry_fn(ccx, _sp, main_llfn, false),
2182+
config::EntryStart => create_entry_fn(ccx, sp, main_llfn, false),
21832183
config::EntryNone => {} // Do nothing.
21842184
}
21852185

2186-
#[inline(never)]
21872186
fn create_entry_fn(ccx: &CrateContext,
2188-
_sp: Span,
2187+
sp: Span,
21892188
rust_main: ValueRef,
21902189
use_start_lang_item: bool) {
21912190
let llfty = Type::func(&[ccx.int_type(), Type::i8p(ccx).ptr_to()],
21922191
&ccx.int_type());
21932192

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

src/librustc_trans/trans/declare.rs

-2
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)