Currently missing fields in struct gives no line info, not even the typename info, which makes it hard to find where in the row of same-y declarations you missed a field. For example:
#[derive(serde::Deserialize, Debug)]
struct Test {
f1: i64,
f2: String,
}
fn main() {
let s = r#"
Test (
f1: 55,
)
"#;
let x: Result<Test, _> = ron::from_str(s);
println!("{:?}", x);
}
gives: Err(Error { code: Message("missing field f2"), position: Position { line: 0, col: 0 } })
It would be great if I could get line info, or at least the name "Test" of the record.
Also there is a similar problem with enum variants. Which seems doubly strange, as when I write an incorrect constructor for a struct, like replacing "Test" with "NotTest" in the example above, I get precise error location and type info.
Currently missing fields in struct gives no line info, not even the typename info, which makes it hard to find where in the row of same-y declarations you missed a field. For example:
gives:
Err(Error { code: Message("missing fieldf2"), position: Position { line: 0, col: 0 } })It would be great if I could get line info, or at least the name "Test" of the record.
Also there is a similar problem with enum variants. Which seems doubly strange, as when I write an incorrect constructor for a struct, like replacing "Test" with "NotTest" in the example above, I get precise error location and type info.