-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Do not panic on missing close paren #58863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 @@ | ||
impl A { | ||
//~^ ERROR cannot find type `A` in this scope | ||
fn b(self> | ||
//~^ ERROR expected one of `)`, `,`, or `:`, found `>` | ||
//~| ERROR expected one of `->`, `where`, or `{`, found `>` | ||
//~| ERROR expected one of `->`, `async`, `const`, `crate`, `default`, `existential`, | ||
} | ||
|
||
fn main() {} |
This file contains hidden or 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,30 @@ | ||
error: expected one of `)`, `,`, or `:`, found `>` | ||
--> $DIR/issue-58856-1.rs:3:14 | ||
| | ||
LL | fn b(self> | ||
| - ^ | ||
| | | | ||
| | help: `)` may belong here | ||
| unclosed delimiter | ||
|
||
error: expected one of `->`, `where`, or `{`, found `>` | ||
--> $DIR/issue-58856-1.rs:3:14 | ||
| | ||
LL | fn b(self> | ||
| ^ expected one of `->`, `where`, or `{` here | ||
|
||
error: expected one of `->`, `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, `unsafe`, `where`, or `}`, found `>` | ||
--> $DIR/issue-58856-1.rs:3:14 | ||
| | ||
LL | fn b(self> | ||
| ^ expected one of 13 possible tokens here | ||
|
||
error[E0412]: cannot find type `A` in this scope | ||
--> $DIR/issue-58856-1.rs:1:6 | ||
| | ||
LL | impl A { | ||
| ^ not found in this scope | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0412`. |
This file contains hidden or 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 @@ | ||
trait Howness {} | ||
impl Howness for () { | ||
fn how_are_you(&self -> Empty { | ||
//~^ ERROR expected one of `)` or `,`, found `->` | ||
//~| ERROR method `how_are_you` is not a member of trait `Howness` | ||
//~| ERROR cannot find type `Empty` in this scope | ||
Empty | ||
//~^ ERROR cannot find value `Empty` in this scope | ||
} | ||
} | ||
//~^ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, | ||
|
||
fn main() {} |
This file contains hidden or 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,55 @@ | ||
error: expected one of `)` or `,`, found `->` | ||
--> $DIR/issue-58856-2.rs:3:26 | ||
| | ||
LL | fn how_are_you(&self -> Empty { | ||
| - -^^ | ||
| | | | ||
| | help: `)` may belong here | ||
| unclosed delimiter | ||
|
||
error: expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, `unsafe`, or `}`, found `)` | ||
--> $DIR/issue-58856-2.rs:10:1 | ||
| | ||
LL | } | ||
| - expected one of 11 possible tokens here | ||
LL | } | ||
| ^ unexpected token | ||
|
||
error[E0407]: method `how_are_you` is not a member of trait `Howness` | ||
--> $DIR/issue-58856-2.rs:3:5 | ||
| | ||
LL | / fn how_are_you(&self -> Empty { | ||
LL | | //~^ ERROR expected one of `)` or `,`, found `->` | ||
LL | | //~| ERROR method `how_are_you` is not a member of trait `Howness` | ||
LL | | //~| ERROR cannot find type `Empty` in this scope | ||
LL | | Empty | ||
LL | | //~^ ERROR cannot find value `Empty` in this scope | ||
LL | | } | ||
| |_____^ not a member of trait `Howness` | ||
|
||
error[E0412]: cannot find type `Empty` in this scope | ||
--> $DIR/issue-58856-2.rs:3:29 | ||
| | ||
LL | fn how_are_you(&self -> Empty { | ||
| ^^^^^ not found in this scope | ||
help: possible candidates are found in other modules, you can import them into scope | ||
| | ||
LL | use std::io::Empty; | ||
| | ||
LL | use std::iter::Empty; | ||
| | ||
|
||
error[E0425]: cannot find value `Empty` in this scope | ||
--> $DIR/issue-58856-2.rs:7:9 | ||
| | ||
LL | Empty | ||
| ^^^^^ not found in this scope | ||
help: possible candidate is found in another module, you can import it into scope | ||
| | ||
LL | use std::sync::mpsc::TryRecvError::Empty; | ||
| | ||
|
||
error: aborting due to 5 previous errors | ||
|
||
Some errors occurred: E0407, E0412, E0425. | ||
For more information about an error, try `rustc --explain E0407`. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.