about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-12-18 05:01:47 -0800
committerbors <bors@rust-lang.org>2013-12-18 05:01:47 -0800
commit5cea7db2a5f009ac9e192b0c6195b02496bee140 (patch)
treef413dadd5cc2eefafb41c2f7263accfa0550204b
parentf43402fd66d22842978e952c548125db66b3491f (diff)
parentc11f29019995a16c702111d0cfb927c795720fc0 (diff)
downloadrust-5cea7db2a5f009ac9e192b0c6195b02496bee140.tar.gz
rust-5cea7db2a5f009ac9e192b0c6195b02496bee140.zip
auto merge of #10915 : alexcrichton/rust/fixes, r=ILyoan
Just a little cleanup.
-rw-r--r--src/librustc/middle/entry.rs10
-rw-r--r--src/librustc/middle/trans/base.rs27
-rw-r--r--src/libsyntax/parse/obsolete.rs5
-rw-r--r--src/libsyntax/parse/parser.rs1
4 files changed, 15 insertions, 28 deletions
diff --git a/src/librustc/middle/entry.rs b/src/librustc/middle/entry.rs
index c2d7878a081..4103812d361 100644
--- a/src/librustc/middle/entry.rs
+++ b/src/librustc/middle/entry.rs
@@ -11,7 +11,6 @@
 
 use driver::session;
 use driver::session::Session;
-use syntax::abi;
 use syntax::ast::{Crate, NodeId, item, item_fn};
 use syntax::ast_map;
 use syntax::attr;
@@ -46,10 +45,7 @@ impl Visitor<()> for EntryContext {
 }
 
 pub fn find_entry_point(session: Session, crate: &Crate, ast_map: ast_map::map) {
-
-    // FIXME #4404 android JNI hacks
-    if *session.building_library &&
-        session.targ_cfg.os != abi::OsAndroid {
+    if *session.building_library {
         // No need to find a main function
         return;
     }
@@ -149,10 +145,6 @@ fn configure_main(this: &mut EntryContext) {
                 }
             }
             this.session.abort_if_errors();
-        } else {
-            // If we *are* building a library, then we're on android where we still might
-            // optionally want to translate main $4404
-            assert_eq!(this.session.targ_cfg.os, abi::OsAndroid);
         }
     }
 }
diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs
index c8be404f5ff..b3d326d727b 100644
--- a/src/librustc/middle/trans/base.rs
+++ b/src/librustc/middle/trans/base.rs
@@ -84,7 +84,7 @@ use syntax::parse::token::{special_idents};
 use syntax::print::pprust::stmt_to_str;
 use syntax::{ast, ast_util, codemap, ast_map};
 use syntax::attr::AttrMetaMethods;
-use syntax::abi::{X86, X86_64, Arm, Mips, Rust, RustIntrinsic, OsWin32, OsAndroid};
+use syntax::abi::{X86, X86_64, Arm, Mips, Rust, RustIntrinsic, OsWin32};
 use syntax::visit;
 use syntax::visit::Visitor;
 
@@ -2289,11 +2289,7 @@ fn finish_register_fn(ccx: @mut CrateContext, sp: Span, sym: ~str, node_id: ast:
         lib::llvm::SetLinkage(llfn, lib::llvm::InternalLinkage);
     }
 
-    // FIXME #4404 android JNI hacks
-    let is_entry = is_entry_fn(&ccx.sess, node_id) && (!*ccx.sess.building_library ||
-                      (*ccx.sess.building_library &&
-                       ccx.sess.targ_cfg.os == OsAndroid));
-    if is_entry {
+    if is_entry_fn(&ccx.sess, node_id) && !*ccx.sess.building_library {
         create_entry_wrapper(ccx, sp, llfn);
     }
 }
@@ -2361,13 +2357,7 @@ pub fn create_entry_wrapper(ccx: @mut CrateContext,
         let llfty = Type::func([ccx.int_type, Type::i8().ptr_to().ptr_to()],
                                &ccx.int_type);
 
-        // FIXME #4404 android JNI hacks
-        let main_name = if *ccx.sess.building_library {
-            "amain"
-        } else {
-            "main"
-        };
-        let llfn = decl_cdecl_fn(ccx.llmod, main_name, llfty);
+        let llfn = decl_cdecl_fn(ccx.llmod, "main", llfty);
         let llbb = "top".with_c_str(|buf| {
             unsafe {
                 llvm::LLVMAppendBasicBlockInContext(ccx.llcx, llfn, buf)
@@ -3199,14 +3189,13 @@ pub fn trans_crate(sess: session::Session,
     }).to_owned_vec();
 
     // Make sure that some other crucial symbols are not eliminated from the
-    // module. This includes the main function (main/amain elsewhere), the crate
-    // map (used for debug log settings and I/O), and finally the curious
-    // rust_stack_exhausted symbol. This symbol is required for use by the
-    // libmorestack library that we link in, so we must ensure that this symbol
-    // is not internalized (if defined in the crate).
+    // module. This includes the main function, the crate map (used for debug
+    // log settings and I/O), and finally the curious rust_stack_exhausted
+    // symbol. This symbol is required for use by the libmorestack library that
+    // we link in, so we must ensure that this symbol is not internalized (if
+    // defined in the crate).
     reachable.push(ccx.crate_map_name.to_owned());
     reachable.push(~"main");
-    reachable.push(~"amain");
     reachable.push(~"rust_stack_exhausted");
 
     return CrateTranslation {
diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs
index 8e291ca6705..d739fca99da 100644
--- a/src/libsyntax/parse/obsolete.rs
+++ b/src/libsyntax/parse/obsolete.rs
@@ -44,6 +44,7 @@ pub enum ObsoleteSyntax {
     ObsoleteVecDotDotWildcard,
     ObsoleteBoxedClosure,
     ObsoleteClosureType,
+    ObsoleteMultipleImport,
 }
 
 impl to_bytes::IterBytes for ObsoleteSyntax {
@@ -140,6 +141,10 @@ impl ParserObsoleteMethods for Parser {
                 "closures are now written `|A| -> B` rather than `&fn(A) -> \
                  B`."
             ),
+            ObsoleteMultipleImport => (
+                "multiple imports",
+                "only one import is allowed per `use` statement"
+            ),
         };
 
         self.report(sp, kind, kind_str, desc);
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 9ab6cc96d33..35ea06d62ca 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -4968,6 +4968,7 @@ impl Parser {
         let mut vp = ~[self.parse_view_path()];
         while *self.token == token::COMMA {
             self.bump();
+            self.obsolete(*self.last_span, ObsoleteMultipleImport);
             vp.push(self.parse_view_path());
         }
         return vp;