-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #69708 - estebank:tiny, r=petrochenkov
On mismatched delimiters, only point at empty blocks that are in the same line We point at empty blocks when we have mismatched braces to detect cases where editors auto insert `}` after writing `{`. Gate this to only the case where the entire span is in the same line so we never point at explicitly empty blocks.
- Loading branch information
Showing
2 changed files
with
8 additions
and
9 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
10 changes: 2 additions & 8 deletions
10
src/test/ui/parser/mismatched-delim-brace-empty-block.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 |
---|---|---|
@@ -1,14 +1,8 @@ | ||
error: unexpected closing delimiter: `}` | ||
--> $DIR/mismatched-delim-brace-empty-block.rs:5:1 | ||
| | ||
LL | fn main() { | ||
| ___________- | ||
LL | | | ||
LL | | } | ||
| |_- this block is empty, you might have not meant to close it | ||
LL | let _ = (); | ||
LL | } | ||
| ^ unexpected closing delimiter | ||
LL | } | ||
| ^ unexpected closing delimiter | ||
|
||
error: aborting due to previous error | ||
|