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.
parser: misc small item related improvements & cleanups.
- Loading branch information
Showing
36 changed files
with
233 additions
and
249 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,13 +1,11 @@ | ||
error: expected one of `async`, `const`, `crate`, `extern`, `fn`, `pub`, `static`, `type`, or `unsafe`, found keyword `let` | ||
--> $DIR/issue-54441.rs:3:9 | ||
error: missing `fn`, `type`, or `static` for extern-item declaration | ||
--> $DIR/issue-54441.rs:1:1 | ||
| | ||
LL | let | ||
| ^^^ expected one of 9 possible tokens | ||
... | ||
LL | m!(); | ||
| ----- in this macro invocation | ||
| | ||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) | ||
LL | / macro_rules! m { | ||
LL | | | ||
LL | | () => { | ||
LL | | let | ||
| |________^ missing `fn`, `type`, or `static` | ||
|
||
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,8 +1,8 @@ | ||
error: expected item after attributes | ||
--> $DIR/attr-before-eof.rs:3:16 | ||
--> $DIR/attr-before-eof.rs:3:1 | ||
| | ||
LL | #[derive(Debug)] | ||
| ^ | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
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,8 +1,8 @@ | ||
error: expected item after attributes | ||
--> $DIR/attr-dangling-in-mod.rs:6:14 | ||
--> $DIR/attr-dangling-in-mod.rs:6:1 | ||
| | ||
LL | #[foo = "bar"] | ||
| ^ | ||
| ^^^^^^^^^^^^^^ | ||
|
||
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,8 +1,8 @@ | ||
error: expected item after attributes | ||
--> $DIR/attrs-after-extern-mod.rs:6:19 | ||
--> $DIR/attrs-after-extern-mod.rs:6:5 | ||
| | ||
LL | #[cfg(stage37)] | ||
| ^ | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
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
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,8 +1,10 @@ | ||
error: expected item after attributes | ||
--> $DIR/doc-before-attr.rs:4:16 | ||
--> $DIR/doc-before-attr.rs:4:1 | ||
| | ||
LL | /// hi | ||
| ------ other attributes here | ||
LL | #[derive(Debug)] | ||
| ^ | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
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,7 +1,6 @@ | ||
// error-pattern: expected one of `(`, `async`, `const`, `extern`, `fn` | ||
|
||
fn main() {} | ||
|
||
extern { | ||
pub pub fn foo(); | ||
//~^ ERROR missing `fn`, `type`, or `static` for extern-item declaration | ||
} |
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,8 +1,8 @@ | ||
error: expected one of `(`, `async`, `const`, `extern`, `fn`, `static`, `type`, or `unsafe`, found keyword `pub` | ||
--> $DIR/duplicate-visibility.rs:6:9 | ||
error: missing `fn`, `type`, or `static` for extern-item declaration | ||
--> $DIR/duplicate-visibility.rs:4:8 | ||
| | ||
LL | pub pub fn foo(); | ||
| ^^^ expected one of 8 possible tokens | ||
| ^ missing `fn`, `type`, or `static` | ||
|
||
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,5 +1,6 @@ | ||
trait T { | ||
extern "Rust" unsafe fn foo(); //~ ERROR expected one of `async`, `const` | ||
//~^ ERROR missing `fn`, `type`, or `const` for associated-item declaration | ||
extern "Rust" unsafe fn foo(); | ||
} | ||
|
||
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,11 @@ | ||
error: expected one of `async`, `const`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, `unsafe`, or `}`, found keyword `extern` | ||
--> $DIR/issue-19398.rs:2:5 | ||
error: missing `fn`, `type`, or `const` for associated-item declaration | ||
--> $DIR/issue-19398.rs:1:10 | ||
| | ||
LL | trait T { | ||
| - expected one of 10 possible tokens | ||
LL | extern "Rust" unsafe fn foo(); | ||
| ^^^^^^ unexpected token | ||
LL | trait T { | ||
| __________^ | ||
LL | | | ||
LL | | extern "Rust" unsafe fn foo(); | ||
| |____^ missing `fn`, `type`, or `const` | ||
|
||
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
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`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, or `unsafe`, found `}` | ||
--> $DIR/issue-20711-2.rs:7:1 | ||
error: expected item after attributes | ||
--> $DIR/issue-20711-2.rs:6:5 | ||
| | ||
LL | #[stable(feature = "rust1", since = "1.0.0")] | ||
| - expected one of 9 possible tokens | ||
LL | } | ||
| ^ unexpected token | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
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
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`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, or `unsafe`, found `}` | ||
--> $DIR/issue-20711.rs:5:1 | ||
error: expected item after attributes | ||
--> $DIR/issue-20711.rs:4:5 | ||
| | ||
LL | #[stable(feature = "rust1", since = "1.0.0")] | ||
| - expected one of 9 possible tokens | ||
LL | } | ||
| ^ unexpected token | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
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,8 +1,8 @@ | ||
error: expected one of `async`, `const`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, `unsafe`, or `}`, found `...` | ||
error: expected one of `async`, `const`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, `unsafe`, `}`, or identifier, found `...` | ||
--> $DIR/issue-32446.rs:4:11 | ||
| | ||
LL | trait T { ... } | ||
| ^^^ expected one of 10 possible tokens | ||
| ^^^ expected one of 11 possible tokens | ||
|
||
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
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
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
6 changes: 4 additions & 2 deletions
6
src/test/ui/parser/mismatched-braces/missing-close-brace-in-impl-trait.rs
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,12 +1,14 @@ | ||
fn main() {} | ||
|
||
impl T for () { //~ ERROR cannot find trait `T` in this scope | ||
|
||
fn foo(&self) {} | ||
//~^ ERROR missing `fn`, `type`, or `const` | ||
|
||
trait T { //~ ERROR expected one of | ||
trait T { | ||
fn foo(&self); | ||
} | ||
|
||
pub(crate) struct Bar<T>(); | ||
|
||
fn main() {} | ||
//~ ERROR this file contains an unclosed delimiter |
Oops, something went wrong.