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
So it turns out that derive macros can't expand anything in-place: they can only generate new code in a completely different area.
We need a #[document_codes] attribute macro that you can slap at the toplevel of anything using the Diagnostic derive, which goes through and adds #[doc(alias = "my::code::here")] to the error struct or enum, in the appropriate places.
This might be tricky because you're injecting stuff in the middle of a tokenstream, but maybe it's easier than it sounds?
The text was updated successfully, but these errors were encountered:
So it turns out that
derive
macros can't expand anything in-place: they can only generate new code in a completely different area.We need a
#[document_codes]
attribute macro that you can slap at the toplevel of anything using theDiagnostic
derive, which goes through and adds#[doc(alias = "my::code::here")]
to the error struct or enum, in the appropriate places.This might be tricky because you're injecting stuff in the middle of a tokenstream, but maybe it's easier than it sounds?
The text was updated successfully, but these errors were encountered: