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
The current path-taking attributes like #[serde(crate = ...)] require the path to be wrapped in a string literal. I believe this is due to a limitation in older versions of the compiler, but it's possible to pass paths in directly now.
This causes issues when trying to use paths like #[serde(crate = $crate::reexports::serde)], the $crate token cannot be serialized through a string.
I think it would be backwards compatible to extend these attributes to parse either a string literal or a directly passed path to support these kinds of usecases.
The text was updated successfully, but these errors were encountered:
Hmm... would this require serde_derive to be compiler-version dependent, too? We can either have a one-time cost of a build script, or a cost at every invocation, but if we can just accept paths without first needing to check the rust version, that would be ok.
I have the feeling that it shouldn't require any version dependence (but I've not tried this sort of code on old compilers). For old compilers it's just not possible to have non-literal tokens in this position, so attempting to parse as a path will always fail, but there's nothing stopping you from trying that parse.
The current path-taking attributes like
#[serde(crate = ...)]
require the path to be wrapped in a string literal. I believe this is due to a limitation in older versions of the compiler, but it's possible to pass paths in directly now.This causes issues when trying to use paths like
#[serde(crate = $crate::reexports::serde)]
, the$crate
token cannot be serialized through a string.I think it would be backwards compatible to extend these attributes to parse either a string literal or a directly passed path to support these kinds of usecases.
The text was updated successfully, but these errors were encountered: