diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 75a48fdd596ea..ce262bf449a15 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 "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 @@ extern crate time; #[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 ec6fd013d08ae..9ed9e626c3d32 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 @@ impl<'a> ParserObsoleteMethods for parser::Parser<'a> { 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 6aff1152f7e1d..073e88bc4a1b5 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4783,11 +4783,7 @@ impl<'a> Parser<'a> { 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};