Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #688 from dtolnay/missingcomma
Prevent type ascription misdiagnosis
- Loading branch information
Showing
4 changed files
with
26 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
use serde_json::json; | ||
|
||
fn main() { | ||
json!({ "1": "" "2": "" }); | ||
} |
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,7 @@ | ||
error: no rules expected the token `"2"` | ||
--> $DIR/missing_comma.rs:4:21 | ||
| | ||
4 | json!({ "1": "" "2": "" }); | ||
| -^^^ no rules expected this token in macro call | ||
| | | ||
| help: missing comma here |
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,7 +1,5 @@ | ||
error: unexpected end of macro invocation | ||
--> $DIR/parse_expr.rs:4:5 | ||
error: no rules expected the token `~` | ||
--> $DIR/parse_expr.rs:4:19 | ||
| | ||
4 | json!({ "a" : ~ }); | ||
| ^^^^^^^^^^^^^^^^^^^ missing tokens in macro arguments | ||
| | ||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) | ||
| ^ no rules expected this token in macro call |