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
That r# on the r#type seems like it shouldn't be exposed downstream of serde, since the current-list-of-keywords-in-Rust is an implementation detail that serialization probably shouldn't care about. Currently, a bunch of the data format libraries that work with serde (e.g. ron) emit invalid data when provided with these raw identifiers, since they assume that field identifiers have a limited set of characters (that doesn't include #).
Unfortunately, the root of this issue is probably upstream of serde, and even writing a test case for this in this repo is tricky (since the test code has to be Rust 2018).
The text was updated successfully, but these errors were encountered:
Right now,
serde_derive
passes through ther#
on raw identifiers when the identifier is a keyword.For example (playground link)
prints
That
r#
on ther#type
seems like it shouldn't be exposed downstream of serde, since the current-list-of-keywords-in-Rust is an implementation detail that serialization probably shouldn't care about. Currently, a bunch of the data format libraries that work with serde (e.g. ron) emit invalid data when provided with these raw identifiers, since they assume that field identifiers have a limited set of characters (that doesn't include#
).Unfortunately, the root of this issue is probably upstream of serde, and even writing a test case for this in this repo is tricky (since the test code has to be Rust 2018).
The text was updated successfully, but these errors were encountered: