-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #100396 - chenyukang:fix-100394, r=petrochenkov
Suggest const and static for global variable Fixing #100394
- Loading branch information
Showing
3 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
let X: i32 = 12; | ||
//~^ ERROR expected item, found keyword `let` | ||
|
||
fn main() { | ||
println!("{}", X); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: expected item, found keyword `let` | ||
--> $DIR/suggest-const-for-global-var.rs:1:1 | ||
| | ||
LL | let X: i32 = 12; | ||
| ^^^ consider using `const` or `static` instead of `let` for global variables | ||
|
||
error: aborting due to previous error | ||
|