diff options
| author | wickerwaka <martin.donlon@gmail.com> | 2014-09-01 08:59:23 -0700 |
|---|---|---|
| committer | wickerwaka <martin.donlon@gmail.com> | 2014-09-01 09:02:00 -0700 |
| commit | 2cb210d2c671582a97c75d446bf2312af362b1cc (patch) | |
| tree | ff71e04887f9a2d4683269672dbfde1e5ac231d8 /src/libsyntax/parse/parser.rs | |
| parent | b42e079c6f6445b4e2adfaf9a30e8a06403f75c8 (diff) | |
| download | rust-2cb210d2c671582a97c75d446bf2312af362b1cc.tar.gz rust-2cb210d2c671582a97c75d446bf2312af362b1cc.zip | |
Updated to new extern crate syntax.
Added warning for old deprecated syntax
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index d3700059862..66807c4639e 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -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); |
