-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Distinguish delim kind to decide whether to emit unexpected closing delimiter #138554
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,14 @@ | ||
error: mismatched closing delimiter: `]` | ||
--> $DIR/deli-ident-issue-2.rs:2:14 | ||
| | ||
LL | if 1 < 2 { | ||
| ^ unclosed delimiter | ||
LL | let _a = vec!]; | ||
| ^ mismatched closing delimiter | ||
|
||
error: unexpected closing delimiter: `}` | ||
--> $DIR/deli-ident-issue-2.rs:5:1 | ||
| | ||
LL | fn main() { | ||
| - this closing `}` may be intended to match here | ||
LL | if 1 < 2 { | ||
LL | let _a = vec!]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like we should still have a label pointing at this opening There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. However, the first The current error report seems to be a combination of the previous two errors, and points to a more accurate match. The original first error seems to have no effect. :) |
||
| - missing open `[` for this delimiter | ||
LL | } | ||
LL | } | ||
| ^ unexpected closing delimiter | ||
|
||
error: aborting due to 2 previous errors | ||
error: aborting due to 1 previous error | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
//@ compile-flags: -Zunpretty=ast-tree | ||
#![c={#![c[)x //~ ERROR mismatched closing delimiter | ||
//~ ERROR this file contains an unclosed delimiter | ||
//~v ERROR this file contains an unclosed delimiter | ||
#![c={#![c[)x |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,14 @@ | ||
error: mismatched closing delimiter: `)` | ||
--> $DIR/issue-105209.rs:2:11 | ||
| | ||
LL | #![c={#![c[)x | ||
| ^^ mismatched closing delimiter | ||
| | | ||
| unclosed delimiter | ||
|
||
error: this file contains an unclosed delimiter | ||
--> $DIR/issue-105209.rs:3:68 | ||
--> $DIR/issue-105209.rs:3:15 | ||
| | ||
LL | #![c={#![c[)x | ||
| - - - - missing open `(` for this delimiter | ||
| | | | | ||
| - - - -- ^ | ||
| | | | || | ||
| | | | |missing open `(` for this delimiter | ||
| | | | unclosed delimiter | ||
| | | unclosed delimiter | ||
| | unclosed delimiter | ||
| unclosed delimiter | ||
LL | | ||
| ^ | ||
|
||
error: aborting due to 2 previous errors | ||
error: aborting due to 1 previous error | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,17 @@ | ||
error: mismatched closing delimiter: `)` | ||
--> $DIR/issue-62973.rs:8:27 | ||
| | ||
LL | fn p() { match s { v, E { [) {) } | ||
| ^^ mismatched closing delimiter | ||
| | | ||
| unclosed delimiter | ||
|
||
error: mismatched closing delimiter: `)` | ||
--> $DIR/issue-62973.rs:8:30 | ||
| | ||
LL | fn p() { match s { v, E { [) {) } | ||
| ^^ mismatched closing delimiter | ||
| | | ||
| unclosed delimiter | ||
|
||
error: this file contains an unclosed delimiter | ||
--> $DIR/issue-62973.rs:10:2 | ||
--> $DIR/issue-62973.rs:8:2 | ||
| | ||
LL | fn p() { match s { v, E { [) {) } | ||
| - - - - missing open `(` for this delimiter | ||
| | | | | ||
| | | missing open `(` for this delimiter | ||
| - - - -- - missing open `(` for this delimiter | ||
| | | | || | ||
| | | | |missing open `(` for this delimiter | ||
| | | | unclosed delimiter | ||
| | | unclosed delimiter | ||
| | unclosed delimiter | ||
| unclosed delimiter | ||
LL | | ||
LL | | ||
| ^ | ||
|
||
error: aborting due to 3 previous errors | ||
error: aborting due to 1 previous error | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
// fixed by #66361 | ||
//~vv ERROR mismatched closing delimiter: `]` | ||
//~v ERROR this file contains an unclosed delimiter | ||
impl W <s(f;Y(;] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,12 @@ | ||
error: mismatched closing delimiter: `]` | ||
--> $DIR/issue-63116.rs:4:14 | ||
| | ||
LL | impl W <s(f;Y(;] | ||
| ^ ^ mismatched closing delimiter | ||
| | | ||
| unclosed delimiter | ||
|
||
error: this file contains an unclosed delimiter | ||
--> $DIR/issue-63116.rs:4:18 | ||
--> $DIR/issue-63116.rs:3:18 | ||
| | ||
LL | impl W <s(f;Y(;] | ||
| - -^ | ||
| | | | ||
| | missing open `[` for this delimiter | ||
| - - -^ | ||
| | | | | ||
| | | missing open `[` for this delimiter | ||
| | unclosed delimiter | ||
| unclosed delimiter | ||
|
||
error: aborting due to 2 previous errors | ||
error: aborting due to 1 previous error | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,27 @@ | ||
error: mismatched closing delimiter: `]` | ||
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:5:27 | ||
| | ||
LL | V = [PhantomData; { [ () ].len() ].len() as isize, | ||
| - ^ ^ mismatched closing delimiter | ||
| | | | ||
| | unclosed delimiter | ||
| closing delimiter possibly meant for this | ||
|
||
error: mismatched closing delimiter: `]` | ||
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:12:24 | ||
| | ||
LL | V = [Vec::new; { [].len() ].len() as isize, | ||
| - ^ ^ mismatched closing delimiter | ||
| | | | ||
| | unclosed delimiter | ||
| closing delimiter possibly meant for this | ||
|
||
error: mismatched closing delimiter: `]` | ||
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:19:24 | ||
| | ||
LL | V = [Vec::new; { [0].len() ].len() as isize, | ||
| - ^ ^ mismatched closing delimiter | ||
| | | | ||
| | unclosed delimiter | ||
| closing delimiter possibly meant for this | ||
|
||
error: this file contains an unclosed delimiter | ||
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:23:65 | ||
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:20:65 | ||
| | ||
LL | mod a { | ||
| - unclosed delimiter | ||
... | ||
LL | V = [PhantomData; { [ () ].len() ].len() as isize, | ||
xizheyin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - missing open `[` for this delimiter | ||
... | ||
LL | mod b { | ||
| - unclosed delimiter | ||
LL | enum Bug { | ||
LL | V = [Vec::new; { [].len() ].len() as isize, | ||
| - missing open `[` for this delimiter | ||
... | ||
LL | mod c { | ||
| - unclosed delimiter | ||
LL | enum Bug { | ||
| - unclosed delimiter | ||
LL | V = [Vec::new; { [0].len() ].len() as isize, | ||
| - missing open `[` for this delimiter | ||
... | ||
LL | fn main() {} | ||
| ^ | ||
|
||
error: aborting due to 4 previous errors | ||
error: aborting due to 1 previous error | ||
|
Uh oh!
There was an error while loading. Please reload this page.