1
Fork 0

librustc: Obsolete the old external crate renaming syntax.

Instead of `extern crate foo = bar`, write `extern crate bar as foo`.
Instead of `extern crate baz = "quux"`, write `extern crate "quux" as
baz`.

Closes #16461.

[breaking-change]
This commit is contained in:
Patrick Walton 2014-09-06 11:54:11 -07:00
parent a1f4973090
commit 1bce8698cd
3 changed files with 10 additions and 7 deletions

View file

@ -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};