Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librustc: Obsolete the old external crate renaming syntax. #17048

Merged
merged 1 commit into from
Sep 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -53,6 +53,8 @@ extern crate time;
#[cfg(test)]
extern crate test;

pub use rustc_llvm as llvm;

mod diagnostics;

pub mod back {
Expand Down
5 changes: 5 additions & 0 deletions src/libsyntax/parse/obsolete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub enum ObsoleteSyntax {
ObsoleteManagedExpr,
ObsoleteImportRenaming,
ObsoleteSubsliceMatch,
ObsoleteExternCrateRenaming,
}

pub trait ParserObsoleteMethods {
Expand Down Expand Up @@ -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"
)
};

Expand Down
6 changes: 1 addition & 5 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down