-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #59031 - estebank:recover-from-comaless, r=petrochenkov
- Loading branch information
Showing
11 changed files
with
78 additions
and
43 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 |
---|---|---|
@@ -1,13 +1,14 @@ | ||
// compile-flags: -Z continue-parse-after-error | ||
|
||
enum bird { | ||
pub duck, | ||
//~^ ERROR: expected identifier, found keyword `pub` | ||
//~| ERROR: expected | ||
goose | ||
enum Bird { | ||
pub Duck, | ||
//~^ ERROR unnecessary visibility qualifier | ||
Goose, | ||
pub(crate) Dove | ||
//~^ ERROR unnecessary visibility qualifier | ||
} | ||
|
||
|
||
fn main() { | ||
let y = bird::goose; | ||
let y = Bird::Goose; | ||
} |
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 |
---|---|---|
@@ -1,18 +1,14 @@ | ||
error: expected identifier, found keyword `pub` | ||
error: unnecessary visibility qualifier | ||
--> $DIR/issue-28433.rs:4:5 | ||
| | ||
LL | pub duck, | ||
| ^^^ expected identifier, found keyword | ||
help: you can escape reserved keywords to use them as identifiers | ||
| | ||
LL | r#pub duck, | ||
| ^^^^^ | ||
LL | pub Duck, | ||
| ^^^ `pub` not permitted here | ||
|
||
error: expected one of `(`, `,`, `=`, `{`, or `}`, found `duck` | ||
--> $DIR/issue-28433.rs:4:9 | ||
error: unnecessary visibility qualifier | ||
--> $DIR/issue-28433.rs:7:5 | ||
| | ||
LL | pub duck, | ||
| ^^^^ expected one of `(`, `,`, `=`, `{`, or `}` here | ||
LL | pub(crate) Dove | ||
| ^^^^^^^^^^ `pub` not permitted here | ||
|
||
error: aborting due to 2 previous errors | ||
|
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 |
---|---|---|
@@ -1,10 +1,20 @@ | ||
error: expected one of `(`, `,`, `=`, `{`, or `}`, found `Bad` | ||
--> $DIR/recover-enum.rs:6:9 | ||
error: missing comma | ||
--> $DIR/recover-enum.rs:5:13 | ||
| | ||
LL | Very | ||
| - expected one of `(`, `,`, `=`, `{`, or `}` here | ||
LL | Bad | ||
| ^^^ unexpected token | ||
| ^ help: missing comma | ||
|
||
error: aborting due to previous error | ||
error: missing comma | ||
--> $DIR/recover-enum.rs:7:19 | ||
| | ||
LL | Bad(usize) | ||
| ^ help: missing comma | ||
|
||
error: missing comma | ||
--> $DIR/recover-enum.rs:9:27 | ||
| | ||
LL | Stuff { a: usize } | ||
| ^ help: missing comma | ||
|
||
error: aborting due to 3 previous errors | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
trait Foo { | ||
pub const Foo: u32; | ||
//~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found | ||
//~^ ERROR unnecessary visibility qualifier | ||
} | ||
|
||
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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub` | ||
error: unnecessary visibility qualifier | ||
--> $DIR/trait-pub-assoc-const.rs:2:5 | ||
| | ||
LL | trait Foo { | ||
| - expected one of 7 possible tokens here | ||
LL | pub const Foo: u32; | ||
| ^^^ unexpected token | ||
| ^^^ `pub` not permitted here | ||
|
||
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
trait Foo { | ||
pub type Foo; | ||
//~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found | ||
//~^ ERROR unnecessary visibility qualifier | ||
} | ||
|
||
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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub` | ||
error: unnecessary visibility qualifier | ||
--> $DIR/trait-pub-assoc-ty.rs:2:5 | ||
| | ||
LL | trait Foo { | ||
| - expected one of 7 possible tokens here | ||
LL | pub type Foo; | ||
| ^^^ unexpected token | ||
| ^^^ `pub` not permitted here | ||
|
||
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
trait Foo { | ||
pub fn foo(); | ||
//~^ ERROR expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found | ||
//~^ ERROR unnecessary visibility qualifier | ||
} | ||
|
||
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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
error: expected one of `async`, `const`, `extern`, `fn`, `type`, `unsafe`, or `}`, found `pub` | ||
error: unnecessary visibility qualifier | ||
--> $DIR/trait-pub-method.rs:2:5 | ||
| | ||
LL | trait Foo { | ||
| - expected one of 7 possible tokens here | ||
LL | pub fn foo(); | ||
| ^^^ unexpected token | ||
| ^^^ `pub` not permitted here | ||
|
||
error: aborting due to previous error | ||
|