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:
@@ -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>),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user