Skip to content

Commit ff0513c

Browse files
committed
Hint correct extern constant syntax
1 parent e8f5585 commit ff0513c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libsyntax/parse/parser.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -6007,7 +6007,9 @@ impl<'a> Parser<'a> {
60076007
}
60086008

60096009
if self.check_keyword(keywords::Const) {
6010-
return Err(self.span_fatal(self.span, "extern items cannot be `const`"));
6010+
let mut err = self.span_fatal(self.span, "extern items cannot be `const`");
6011+
err.help("use `static` instead");
6012+
return Err(err);
60116013
}
60126014

60136015
// FIXME #5668: this will occur for a macro invocation:

0 commit comments

Comments
 (0)