rustc: Determine the crate type (lib/bin) in the session, not session opts
This is in preparation for adding a #[crate_type] attribute
This commit is contained in:
parent
9e6ff44d93
commit
fd81fb6a24
6 changed files with 28 additions and 16 deletions
|
@ -362,7 +362,7 @@ fn visit_fn_with_scope(e: @env, f: ast::_fn, tp: [ast::ty_param], sp: span,
|
|||
// is this a main fn declaration?
|
||||
alt name {
|
||||
some(nm) {
|
||||
if is_main_name([nm]) && !e.sess.get_opts().library {
|
||||
if is_main_name([nm]) && !e.sess.building_library() {
|
||||
// This is a main function -- set it in the session
|
||||
// as the main ID
|
||||
e.sess.set_main_id(id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue