Support non-string-literal wrapped paths
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.
Looking back at the original implementation (https://github.com/serde-rs/serde/pull/1499) I see there was some discussion about workarounds like:
use $crate::reexports::serde as _serde;
...
#[serde(crate = "_serde")]
But it would be nice if these weren't needed.
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.
It would be so helpful if this was resolved. Should I make a PR?