You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting the wrong spans with the following (playground)
use toml;use serde::Deserialize;#[derive(Deserialize)]structS{key:Vec<E>,}#[derive(Deserialize)]#[serde(untagged)]enumE{A{a:String},B{b:String},}fnmain(){let s = r#"[[key]]a = "good"[[key]]c = "bad""#;ifletErr(err) = toml::from_str::<S>(s){println!("{err}")}}
TOML parse error at line 2, column 1
|
2 | [[key]]
| ^^^^^^^
data did not match any variant of untagged enum E
I'd expect the error to be in line 5. I'm unsure if it's related to the untagged enum, but I've tried other variations without the untagged enum and it seems to work.
The text was updated successfully, but these errors were encountered:
This is an issue within serde_derive, see #535. While the original post is focused on internally-tagged enums, it applies to that as well as untagged enums. Closing in favor of that issue. If there is a reason we should keep this open separately, let us know!
I'm getting the wrong spans with the following (playground)
I'd expect the error to be in line 5. I'm unsure if it's related to the untagged enum, but I've tried other variations without the untagged enum and it seems to work.
The text was updated successfully, but these errors were encountered: