diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 75a48fdd596..ce262bf449a 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -42,8 +42,8 @@ extern crate getopts; extern crate graphviz; extern crate libc; -extern crate "rustc_llvm" as llvm; -extern crate "rustc_back" as rustc_back; +extern crate rustc_llvm; +extern crate rustc_back; extern crate serialize; extern crate rbml; extern crate time; @@ -53,6 +53,8 @@ #[cfg(test)] extern crate test; +pub use rustc_llvm as llvm; + mod diagnostics; pub mod back { diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs index ec6fd013d08..9ed9e626c3d 100644 --- a/src/libsyntax/parse/obsolete.rs +++ b/src/libsyntax/parse/obsolete.rs @@ -36,6 +36,7 @@ pub enum ObsoleteSyntax { ObsoleteManagedExpr, ObsoleteImportRenaming, ObsoleteSubsliceMatch, + ObsoleteExternCrateRenaming, } pub trait ParserObsoleteMethods { @@ -92,6 +93,10 @@ fn obsolete(&mut self, sp: Span, kind: ObsoleteSyntax) { ObsoleteSubsliceMatch => ( "subslice match syntax", "instead of `..xs`, write `xs..` in a pattern" + ), + ObsoleteExternCrateRenaming => ( + "`extern crate foo = bar` syntax", + "write `extern crate bar as foo` instead" ) }; diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 6aff1152f7e..073e88bc4a1 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4783,11 +4783,7 @@ fn parse_item_extern_crate(&mut self, self.bump(); let path = self.parse_str(); let span = self.span; - self.span_warn(span, - format!("this extern crate syntax is deprecated. \ - Use: extern crate \"{}\" as {};", - path.ref0().get(), the_ident.as_str() ).as_slice() - ); + self.obsolete(span, ObsoleteExternCrateRenaming); Some(path) } else {None};