about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-09-19 04:51:13 +0000
committerbors <bors@rust-lang.org>2015-09-19 04:51:13 +0000
commitd97be7bd70903350e75c6ae9ca41a92aa3a5e362 (patch)
treea72fc2227dc7bc12399191689f92210d281f4b96 /src/libsyntax/parse
parent2915f891673f9c8c8be3cc06aeb3bebf7df66115 (diff)
parent269c59d3414027c2194fb5deb1d26845d088afb9 (diff)
downloadrust-d97be7bd70903350e75c6ae9ca41a92aa3a5e362.tar.gz
rust-d97be7bd70903350e75c6ae9ca41a92aa3a5e362.zip
Auto merge of #28486 - nrc:pub-extern-crate, r=alexcrichton
Temporary 'fix' for #26775

r? @brson
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 87500142ccd..7f57170c2ef 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -5101,12 +5101,19 @@ impl<'a> Parser<'a> {
         try!(self.expect(&token::Semi));
 
         let last_span = self.last_span;
+
+        if visibility == ast::Public {
+            self.span_warn(mk_sp(lo, last_span.hi),
+                           "`pub extern crate` does not work as expected and should not be used. \
+                            Likely to become an error. Prefer `extern crate` and `pub use`.");
+        }
+
         Ok(self.mk_item(lo,
-                     last_span.hi,
-                     ident,
-                     ItemExternCrate(maybe_path),
-                     visibility,
-                     attrs))
+                        last_span.hi,
+                        ident,
+                        ItemExternCrate(maybe_path),
+                        visibility,
+                        attrs))
     }
 
     /// Parse `extern` for foreign ABIs