Skip to content

Commit 4a948df

Browse files
committed
Add ui test of missing comma between object entries
1 parent 631ce80 commit 4a948df

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

tests/ui/missing_comma.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
use serde_json::json;
2+
3+
fn main() {
4+
json!({ "1": "" "2": "" });
5+
}

tests/ui/missing_comma.stderr

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected type, found `""`
2+
--> $DIR/missing_comma.rs:4:18
3+
|
4+
4 | json!({ "1": "" "2": "" });
5+
| - ^^ expected type
6+
| |
7+
| tried to parse a type due to this type ascription
8+
|
9+
= note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
10+
= note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information

0 commit comments

Comments
 (0)