File tree 2 files changed +3
-2
lines changed
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -6002,7 +6002,8 @@ impl<'a> Parser<'a> {
6002
6002
if self . token . is_keyword ( keywords:: Const ) {
6003
6003
self . diagnostic ( )
6004
6004
. struct_span_err ( self . span , "extern items cannot be `const`" )
6005
- . span_label ( self . span , "use `static` instead" ) . emit ( ) ;
6005
+ . span_suggestion ( self . span , "instead try using" , "static" . to_owned ( ) )
6006
+ . emit ( ) ;
6006
6007
}
6007
6008
self . bump ( ) ; // `static` or `const`
6008
6009
return Ok ( Some ( self . parse_item_foreign_static ( visibility, lo, attrs) ?) ) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ error: extern items cannot be `const`
2
2
--> $DIR/extern-const.rs:14:5
3
3
|
4
4
14 | const C: u8; //~ ERROR extern items cannot be `const`
5
- | ^^^^^ use `static` instead
5
+ | ^^^^^ help: instead try using: `static`
6
6
7
7
error: aborting due to previous error
8
8
You can’t perform that action at this time.
0 commit comments