forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recover from missing param list in function definitions
- Loading branch information
Showing
10 changed files
with
65 additions
and
19 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
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,9 @@ | ||
// run-rustfix | ||
|
||
pub fn missing() -> () {} | ||
//~^ ERROR missing parameters for function definition | ||
|
||
pub fn missing2() {} | ||
//~^ ERROR missing parameters for function definition | ||
|
||
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,9 @@ | ||
// run-rustfix | ||
|
||
pub fn missing -> () {} | ||
//~^ ERROR missing parameters for function definition | ||
|
||
pub fn missing2 {} | ||
//~^ ERROR missing parameters for function definition | ||
|
||
fn main() {} |
14 changes: 14 additions & 0 deletions
14
tests/ui/parser/issues/issue-108109-fn-missing-params.stderr
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,14 @@ | ||
error: missing parameters for function definition | ||
--> $DIR/issue-108109-fn-missing-params.rs:3:15 | ||
| | ||
LL | pub fn missing -> () {} | ||
| ^ help: add a parameter list | ||
|
||
error: missing parameters for function definition | ||
--> $DIR/issue-108109-fn-missing-params.rs:6:16 | ||
| | ||
LL | pub fn missing2 {} | ||
| ^ help: add a parameter list | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
fn main() { | ||
let x: fn~() = || (); //~ ERROR expected `(`, found `~` | ||
let x: fn~() = || (); //~ ERROR missing parameters for function definition | ||
//~| ERROR expected one of `->`, `;`, or `=`, found `~` | ||
} |
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,14 @@ | ||
error: expected `(`, found `~` | ||
error: missing parameters for function definition | ||
--> $DIR/removed-syntax-fn-sigil.rs:2:14 | ||
| | ||
LL | let x: fn~() = || (); | ||
| - ^ expected `(` | ||
| | | ||
| while parsing the type for `x` | ||
| ^ help: add a parameter list | ||
|
||
error: aborting due to previous error | ||
error: expected one of `->`, `;`, or `=`, found `~` | ||
--> $DIR/removed-syntax-fn-sigil.rs:2:14 | ||
| | ||
LL | let x: fn~() = || (); | ||
| ^ expected one of `->`, `;`, or `=` | ||
|
||
error: aborting due to 2 previous errors | ||
|