about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-06-02 22:19:08 +0000
committerbors <bors@rust-lang.org>2017-06-02 22:19:08 +0000
commitbb907adbbd1727938245a67db1c92be7e4dec3e6 (patch)
treea6229fb68940fbe7bd2c7fae09b92fa10500c81d /src/libsyntax/parse/parser.rs
parent107bd67ef7fb3e8027d7234d687cdd27c3efaa0d (diff)
parente05f1c12901e26f75a92f441f636942a8a3bf7c1 (diff)
downloadrust-bb907adbbd1727938245a67db1c92be7e4dec3e6.tar.gz
rust-bb907adbbd1727938245a67db1c92be7e4dec3e6.zip
Auto merge of #42381 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 10 pull requests

- Successful merges: #41981, #42225, #42310, #42319, #42335, #42343, #42355, #42360, #42370, #42372
- Failed merges:
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 936a2e8b2e1..d9cb2b4ab7d 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -5985,6 +5985,10 @@ impl<'a> Parser<'a> {
             return Ok(Some(self.parse_item_foreign_fn(visibility, lo, attrs)?));
         }
 
+        if self.check_keyword(keywords::Const) {
+            return Err(self.span_fatal(self.span, "extern items cannot be `const`"));
+        }
+
         // FIXME #5668: this will occur for a macro invocation:
         match self.parse_macro_use_or_failure(attrs, true, false, lo, visibility)? {
             Some(item) => {