Closed
Description
Hi @estebank I didn't forget about your encouragement on Twitter: https://twitter.com/ekuber/status/1255881826855313409?s=20
I forgot a comma at the end of the first key-value pair:
fn main() {
let json = serde_json::json!({
"domain_name": "redjack.com"
"passive_provenance": [420, 69],
});
}
On the latest nightly compiler this is explicitly diagnosed as an attempt to use type ascription:
error: expected type, found `"redjack.com"`
--> src/main.rs:3:24
|
3 | "domain_name": "redjack.com"
| - ^^^^^^^^^^^^^ expected type
| |
| tried to parse a type due to this type ascription
|
= note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
= note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information
On stable, it's arguably much worse, the error only makes sense if you know the compiler thinks this is type ascription but feature is not mentioned:
error: expected type, found `"redjack.com"`
--> src/main.rs:3:24
|
3 | "domain_name": "redjack.com"
| - ^^^^^^^^^^^^^ expected type
| |
| tried to parse a type due to this