Updated to new extern crate syntax.
Added warning for old deprecated syntax
This commit is contained in:
parent
b42e079c6f
commit
2cb210d2c6
13 changed files with 25 additions and 20 deletions
|
@ -4773,11 +4773,16 @@ impl<'a> Parser<'a> {
|
|||
token::IDENT(..) => {
|
||||
let the_ident = self.parse_ident();
|
||||
self.expect_one_of(&[], &[token::EQ, token::SEMI]);
|
||||
// NOTE - #16689 change this to a warning once
|
||||
// the 'as' support is in stage0
|
||||
let path = if self.token == token::EQ {
|
||||
self.bump();
|
||||
Some(self.parse_str())
|
||||
let path = self.parse_str();
|
||||
let span = self.span;
|
||||
self.span_warn(span,
|
||||
format!("this extern crate syntax is deprecated. \
|
||||
Use: extern create \"{}\" as {};",
|
||||
the_ident.as_str(), path.ref0().get() ).as_slice()
|
||||
);
|
||||
Some(path)
|
||||
} else {None};
|
||||
|
||||
self.expect(&token::SEMI);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue