1
Fork 0

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:
Brian Anderson 2011-12-08 20:08:00 -08:00
parent 9e6ff44d93
commit fd81fb6a24
6 changed files with 28 additions and 16 deletions

View file

@ -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);