forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 0
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 rust-lang#100188 - chenyukang:fix-issue-100165, r=est…
…ebank Parser will not suggest invalid expression when use public Fixes rust-lang#100165
- Loading branch information
Showing
7 changed files
with
65 additions
and
10 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
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,11 @@ | ||
// Checks what happens when `public` is used instead of the correct, `pub` | ||
// run-rustfix | ||
|
||
pub enum Test { | ||
//~^ ERROR expected one of `!` or `::`, found keyword `enum` | ||
//~^^ HELP write `pub` instead of `public` to make the item public | ||
A, | ||
B, | ||
} | ||
|
||
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,11 @@ | ||
// Checks what happens when `public` is used instead of the correct, `pub` | ||
// run-rustfix | ||
|
||
public enum Test { | ||
//~^ ERROR expected one of `!` or `::`, found keyword `enum` | ||
//~^^ HELP write `pub` instead of `public` to make the item public | ||
A, | ||
B, | ||
} | ||
|
||
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 `enum` | ||
--> $DIR/public-instead-of-pub-1.rs:4:8 | ||
| | ||
LL | public enum Test { | ||
| ^^^^ expected one of `!` or `::` | ||
| | ||
help: write `pub` instead of `public` to make the item public | ||
| | ||
LL | pub enum Test { | ||
| ~~~ | ||
|
||
error: aborting due to previous error | ||
|
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,7 @@ | ||
// Checks what happens when `public` is used instead of the correct, `pub` | ||
// Won't give help message for this case | ||
|
||
public let x = 1; | ||
//~^ ERROR expected one of `!` or `::`, found keyword `let` | ||
|
||
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 @@ | ||
error: expected one of `!` or `::`, found keyword `let` | ||
--> $DIR/public-instead-of-pub-2.rs:4:8 | ||
| | ||
LL | public let x = 1; | ||
| ^^^ expected one of `!` or `::` | ||
|
||
error: aborting due to previous error | ||
|