Skip to content

Commit 1f2a5eb

Browse files
committed
---
yaml --- r: 41963 b: refs/heads/master c: ce954d1 h: refs/heads/master i: 41961: 0e8ee57 41959: fef9b59 v: v3
1 parent a1e8fc1 commit 1f2a5eb

File tree

4 files changed

+2
-16
lines changed

4 files changed

+2
-16
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 8b2e7fc529526e24779e5cabd0c3b1a90e1da245
2+
refs/heads/master: ce954d117fd1e8b0ab320ed905726b658ccb7db0
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
55
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650

trunk/src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ use middle::trans::shape::*;
6262
use middle::trans::tvec;
6363
use middle::trans::type_of::*;
6464
use util::common::indenter;
65-
use util::common::is_main_name;
6665
use util::ppaux::{ty_to_str, ty_to_short_str};
6766
use util::ppaux;
6867

@@ -2191,14 +2190,9 @@ fn is_main_fn(sess: &Session, node_id: ast::node_id) -> bool {
21912190

21922191
// Create a _rust_main(args: ~[str]) function which will be called from the
21932192
// runtime rust_start function
2194-
fn create_main_wrapper(ccx: @crate_ctxt, sp: span, main_llfn: ValueRef) {
2195-
2196-
if ccx.main_fn != None::<ValueRef> {
2197-
ccx.sess.span_fatal(sp, ~"multiple 'main' functions");
2198-
}
2193+
fn create_main_wrapper(ccx: @crate_ctxt, _sp: span, main_llfn: ValueRef) {
21992194

22002195
let llfn = create_main(ccx, main_llfn);
2201-
ccx.main_fn = Some(llfn);
22022196
create_entry_fn(ccx, llfn);
22032197

22042198
fn create_main(ccx: @crate_ctxt, main_llfn: ValueRef) -> ValueRef {
@@ -3008,7 +3002,6 @@ fn trans_crate(sess: session::Session,
30083002
exp_map2: emap2,
30093003
reachable: reachable,
30103004
item_symbols: HashMap(),
3011-
mut main_fn: None::<ValueRef>,
30123005
link_meta: link_meta,
30133006
enum_sizes: ty::new_ty_hash(),
30143007
discrims: HashMap(),

trunk/src/librustc/middle/trans/common.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ struct crate_ctxt {
163163
exp_map2: resolve::ExportMap2,
164164
reachable: reachable::map,
165165
item_symbols: HashMap<ast::node_id, ~str>,
166-
mut main_fn: Option<ValueRef>,
167166
link_meta: link_meta,
168167
enum_sizes: HashMap<ty::t, uint>,
169168
discrims: HashMap<ast::def_id, ValueRef>,

trunk/src/librustc/util/common.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,6 @@ fn local_rhs_span(l: @ast::local, def: span) -> span {
101101
}
102102
}
103103

104-
fn is_main_name(path: syntax::ast_map::path) -> bool {
105-
vec::last(path) == syntax::ast_map::path_name(
106-
syntax::parse::token::special_idents::main
107-
)
108-
}
109-
110104
fn pluralize(n: uint, +s: ~str) -> ~str {
111105
if n == 1 { s }
112106
else { str::concat([s, ~"s"]) }

0 commit comments

Comments
 (0)