about summary refs log tree commit diff
diff options
context:
space:
mode:
authorwickerwaka <martin.donlon@gmail.com>2014-09-01 08:59:23 -0700
committerwickerwaka <martin.donlon@gmail.com>2014-09-01 09:02:00 -0700
commit2cb210d2c671582a97c75d446bf2312af362b1cc (patch)
treeff71e04887f9a2d4683269672dbfde1e5ac231d8
parentb42e079c6f6445b4e2adfaf9a30e8a06403f75c8 (diff)
downloadrust-2cb210d2c671582a97c75d446bf2312af362b1cc.tar.gz
rust-2cb210d2c671582a97c75d446bf2312af362b1cc.zip
Updated to new extern crate syntax.
Added warning for old deprecated syntax
-rw-r--r--src/driver/driver.rs4
-rw-r--r--src/libregex/lib.rs2
-rw-r--r--src/librustc/front/std_inject.rs2
-rw-r--r--src/librustc/lib.rs4
-rw-r--r--src/librustdoc/lib.rs2
-rw-r--r--src/librustrt/lib.rs2
-rw-r--r--src/librustuv/lib.rs2
-rw-r--r--src/libstd/lib.rs8
-rw-r--r--src/libsyntax/parse/parser.rs11
-rw-r--r--src/test/compile-fail/issue-16725.rs2
-rw-r--r--src/test/compile-fail/regions-bounded-method-type-parameters-cross-crate.rs2
-rw-r--r--src/test/run-pass/issue-15562.rs2
-rw-r--r--src/test/run-pass/issue-16643.rs2
13 files changed, 25 insertions, 20 deletions
diff --git a/src/driver/driver.rs b/src/driver/driver.rs
index ca462fc7a39..8ac09ed909b 100644
--- a/src/driver/driver.rs
+++ b/src/driver/driver.rs
@@ -9,9 +9,9 @@
 // except according to those terms.
 
 #[cfg(rustdoc)]
-extern crate this = "rustdoc";
+extern crate "rustdoc" as this;
 
 #[cfg(rustc)]
-extern crate this = "rustc";
+extern crate "rustc" as this;
 
 fn main() { this::main() }
diff --git a/src/libregex/lib.rs b/src/libregex/lib.rs
index 1d25a0c31d8..c79905b9595 100644
--- a/src/libregex/lib.rs
+++ b/src/libregex/lib.rs
@@ -372,7 +372,7 @@
 #![deny(missing_doc)]
 
 #[cfg(test)]
-extern crate stdtest = "test";
+extern crate "test" as stdtest;
 #[cfg(test)]
 extern crate rand;
 
diff --git a/src/librustc/front/std_inject.rs b/src/librustc/front/std_inject.rs
index ff8711c5df0..32e0c323d1f 100644
--- a/src/librustc/front/std_inject.rs
+++ b/src/librustc/front/std_inject.rs
@@ -62,7 +62,7 @@ struct StandardLibraryInjector<'a> {
 impl<'a> fold::Folder for StandardLibraryInjector<'a> {
     fn fold_crate(&mut self, mut krate: ast::Crate) -> ast::Crate {
 
-        // The name to use in `extern crate std = "name";`
+        // The name to use in `extern crate "name" as std;`
         let actual_crate_name = match self.sess.opts.alt_std_name {
             Some(ref s) => token::intern_and_get_ident(s.as_slice()),
             None => token::intern_and_get_ident("std"),
diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs
index 0d4f4f556e1..03dfcec18db 100644
--- a/src/librustc/lib.rs
+++ b/src/librustc/lib.rs
@@ -42,8 +42,8 @@ extern crate flate;
 extern crate getopts;
 extern crate graphviz;
 extern crate libc;
-extern crate llvm = "rustc_llvm";
-extern crate rustc_back = "rustc_back";
+extern crate "rustc_llvm" as llvm;
+extern crate "rustc_back" as rustc_back;
 extern crate serialize;
 extern crate rbml;
 extern crate time;
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index 2f140aa8a68..29e7c051162 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -23,7 +23,7 @@ extern crate libc;
 extern crate rustc;
 extern crate serialize;
 extern crate syntax;
-extern crate testing = "test";
+extern crate "test" as testing;
 extern crate time;
 #[phase(plugin, link)] extern crate log;
 
diff --git a/src/librustrt/lib.rs b/src/librustrt/lib.rs
index 594e50d9913..b4ad1f23154 100644
--- a/src/librustrt/lib.rs
+++ b/src/librustrt/lib.rs
@@ -27,7 +27,7 @@ extern crate alloc;
 extern crate libc;
 extern crate collections;
 
-#[cfg(test)] extern crate realrustrt = "rustrt";
+#[cfg(test)] extern crate "rustrt" as realrustrt;
 #[cfg(test)] extern crate test;
 #[cfg(test)] extern crate native;
 
diff --git a/src/librustuv/lib.rs b/src/librustuv/lib.rs
index 561a4dffe82..abc55b67b3b 100644
--- a/src/librustuv/lib.rs
+++ b/src/librustuv/lib.rs
@@ -52,7 +52,7 @@ via `close` and `delete` methods.
 
 #[cfg(test)] extern crate green;
 #[cfg(test)] extern crate debug;
-#[cfg(test)] extern crate realrustuv = "rustuv";
+#[cfg(test)] extern crate "rustuv" as realrustuv;
 extern crate libc;
 extern crate alloc;
 
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 7fed4c94164..b29e5b7c148 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -129,14 +129,14 @@
 extern crate alloc;
 extern crate unicode;
 extern crate core;
-extern crate core_collections = "collections";
-extern crate core_rand = "rand";
-extern crate core_sync = "sync";
+extern crate "collections" as core_collections;
+extern crate "rand" as core_rand;
+extern crate "sync" as core_sync;
 extern crate libc;
 extern crate rustrt;
 
 // Make std testable by not duplicating lang items. See #2912
-#[cfg(test)] extern crate realstd = "std";
+#[cfg(test)] extern crate "std" as realstd;
 #[cfg(test)] pub use realstd::kinds;
 #[cfg(test)] pub use realstd::ops;
 #[cfg(test)] pub use realstd::cmp;
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index d3700059862..66807c4639e 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -4773,11 +4773,16 @@ impl<'a> Parser<'a> {
             token::IDENT(..) => {
                 let the_ident = self.parse_ident();
                 self.expect_one_of(&[], &[token::EQ, token::SEMI]);
-                // NOTE - #16689 change this to a warning once
-                //        the 'as' support is in stage0
                 let path = if self.token == token::EQ {
                     self.bump();
-                    Some(self.parse_str())
+                    let path = self.parse_str();
+                    let span = self.span;
+                    self.span_warn(span,
+                            format!("this extern crate syntax is deprecated. \
+                            Use: extern create \"{}\" as {};",
+                            the_ident.as_str(), path.ref0().get() ).as_slice()
+                    );
+                    Some(path)
                 } else {None};
 
                 self.expect(&token::SEMI);
diff --git a/src/test/compile-fail/issue-16725.rs b/src/test/compile-fail/issue-16725.rs
index f70d88a41cd..218e9dba065 100644
--- a/src/test/compile-fail/issue-16725.rs
+++ b/src/test/compile-fail/issue-16725.rs
@@ -10,7 +10,7 @@
 
 // aux-build:issue-16725.rs
 
-extern crate foo = "issue-16725";
+extern crate "issue-16725" as foo;
 
 fn main() {
     unsafe { foo::bar(); }
diff --git a/src/test/compile-fail/regions-bounded-method-type-parameters-cross-crate.rs b/src/test/compile-fail/regions-bounded-method-type-parameters-cross-crate.rs
index ab97bad5bc2..06f26800b50 100644
--- a/src/test/compile-fail/regions-bounded-method-type-parameters-cross-crate.rs
+++ b/src/test/compile-fail/regions-bounded-method-type-parameters-cross-crate.rs
@@ -12,7 +12,7 @@
 
 // Check explicit region bounds on methods in the cross crate case.
 
-extern crate lib = "regions-bounded-method-type-parameters-cross-crate-lib";
+extern crate "regions-bounded-method-type-parameters-cross-crate-lib" as lib;
 
 use lib::Inv;
 use lib::MaybeOwned;
diff --git a/src/test/run-pass/issue-15562.rs b/src/test/run-pass/issue-15562.rs
index 96de6c90b66..82f53ea7cd4 100644
--- a/src/test/run-pass/issue-15562.rs
+++ b/src/test/run-pass/issue-15562.rs
@@ -10,7 +10,7 @@
 
 // aux-build:issue-15562.rs
 
-extern crate i = "issue-15562";
+extern crate "issue-15562" as i;
 
 pub fn main() {
     extern {
diff --git a/src/test/run-pass/issue-16643.rs b/src/test/run-pass/issue-16643.rs
index db877aaafca..b118c9573cd 100644
--- a/src/test/run-pass/issue-16643.rs
+++ b/src/test/run-pass/issue-16643.rs
@@ -10,7 +10,7 @@
 
 // aux-build:issue-16643.rs
 
-extern crate i = "issue-16643";
+extern crate "issue-16643" as i;
 
 pub fn main() {
     i::TreeBuilder::<uint>.process_token();