-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add diagnostic when using public instead of pub
- Loading branch information
Gimgim
committed
Jul 29, 2022
1 parent
7dfdd64
commit d0e881e
Showing
4 changed files
with
40 additions
and
0 deletions.
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,8 @@ | ||
// Checks what happens when `public` is used instead of the correct, `pub` | ||
// edition:2018 | ||
// run-rustfix | ||
pub struct X; | ||
//~^ ERROR expected one of `!` or `::`, found keyword `struct` | ||
//~^^ HELP write `pub` instead of `public` to make the item public | ||
|
||
fn main() {} |
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 @@ | ||
// Checks what happens when `public` is used instead of the correct, `pub` | ||
// edition:2018 | ||
// run-rustfix | ||
public struct X; | ||
//~^ ERROR expected one of `!` or `::`, found keyword `struct` | ||
//~^^ HELP write `pub` instead of `public` to make the item public | ||
|
||
fn main() {} |
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,13 @@ | ||
error: expected one of `!` or `::`, found keyword `struct` | ||
--> $DIR/public-instead-of-pub.rs:4:8 | ||
| | ||
LL | public struct X; | ||
| ^^^^^^ expected one of `!` or `::` | ||
| | ||
help: write `pub` instead of `public` to make the item public | ||
| | ||
LL | pub struct X; | ||
| ~~~ | ||
|
||
error: aborting due to previous error | ||
|