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.
Auto merge of rust-lang#58903 - estebank:forgetful-delims, r=petroche…
…nkov Always emit unclosed delimiter diagnostics Fix rust-lang#58886.
- Loading branch information
Showing
18 changed files
with
181 additions
and
70 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
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,6 @@ | ||
impl A { | ||
fn b(self> | ||
//~^ ERROR expected one of `)`, `,`, or `:`, found `>` | ||
} | ||
|
||
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 @@ | ||
error: expected one of `)`, `,`, or `:`, found `>` | ||
--> $DIR/issue-58856-1.rs:2:14 | ||
| | ||
LL | fn b(self> | ||
| - ^ | ||
| | | | ||
| | help: `)` may belong here | ||
| unclosed delimiter | ||
|
||
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,14 @@ | ||
struct Empty; | ||
|
||
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` | ||
Empty | ||
} | ||
} | ||
//~^ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, | ||
|
||
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,30 @@ | ||
error: expected one of `)` or `,`, found `->` | ||
--> $DIR/issue-58856-2.rs:6: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:11: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:6: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 | | Empty | ||
LL | | } | ||
| |_____^ not a member of trait `Howness` | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0407`. |
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,6 @@ | ||
mod unclosed_delim_mod; | ||
|
||
fn main() { | ||
let _: usize = unclosed_delim_mod::new(); | ||
//~^ ERROR mismatched types | ||
} |
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,23 @@ | ||
error: incorrect close delimiter: `}` | ||
--> $DIR/unclosed_delim_mod.rs:5:1 | ||
| | ||
LL | pub fn new() -> Result<Value, ()> { | ||
| - close delimiter possibly meant for this | ||
LL | Ok(Value { | ||
| - un-closed delimiter | ||
LL | } | ||
LL | } | ||
| ^ incorrect close delimiter | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/unclosed-delimiter-in-dep.rs:4:20 | ||
| | ||
LL | let _: usize = unclosed_delim_mod::new(); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ expected usize, found enum `std::result::Result` | ||
| | ||
= note: expected type `usize` | ||
found type `std::result::Result<unclosed_delim_mod::Value, ()>` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
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,6 @@ | ||
pub struct Value {} | ||
pub fn new() -> Result<Value, ()> { | ||
Ok(Value { | ||
} | ||
} | ||
//~^ ERROR incorrect close delimiter |
Oops, something went wrong.