]> git.lizzy.rs Git - rust.git/commitdiff
Hint correct extern constant syntax
authorKornel <kornel@geekhood.net>
Mon, 7 Aug 2017 17:23:15 +0000 (18:23 +0100)
committerKornel <kornel@geekhood.net>
Mon, 7 Aug 2017 17:23:15 +0000 (18:23 +0100)
src/libsyntax/parse/parser.rs

index ca362ec93683d62c001e3f4f28ff395a6e7322e0..c34317e649d8c41a48bb9b8022b4d3ce29b780e2 100644 (file)
@@ -6007,7 +6007,9 @@ fn parse_foreign_item(&mut self) -> PResult<'a, Option<ForeignItem>> {
         }
 
         if self.check_keyword(keywords::Const) {
-            return Err(self.span_fatal(self.span, "extern items cannot be `const`"));
+            let mut err = self.span_fatal(self.span, "extern items cannot be `const`");
+            err.help("use `static` instead");
+            return Err(err);
         }
 
         // FIXME #5668: this will occur for a macro invocation: