rustc: Add support for extern crate foo as bar

The compiler will now issue a warning for crates that have syntax of the form
`extern crate "foo" as bar`, but it will still continue to accept this syntax.
Additionally, the string `foo-bar` will match the crate name `foo_bar` to assist
in the transition period as well.

This patch will land hopefully in tandem with a Cargo patch that will start
translating all crate names to have underscores instead of hyphens.

cc #23533
This commit is contained in:
Alex Crichton
2015-03-19 15:39:03 -07:00
parent ed81038504
commit eb2f1d925f
67 changed files with 144 additions and 145 deletions

View File

@@ -1771,8 +1771,8 @@ pub struct Item {
pub enum Item_ {
/// An`extern crate` item, with optional original crate name,
///
/// e.g. `extern crate foo` or `extern crate "foo-bar" as foo`
ItemExternCrate(Option<(InternedString, StrStyle)>),
/// e.g. `extern crate foo` or `extern crate foo_bar as foo`
ItemExternCrate(Option<Name>),
/// A `use` or `pub use` item
ItemUse(P<ViewPath>),