-
-
Notifications
You must be signed in to change notification settings - Fork 59
Generate doc-comments based on provided tokens #40
Comments
I am tentatively interested in supporting this. As an alternative to #[doc = "Create a new [`" $ret "`] object."]
pub fn $name() -> $ret { todo!() } |
Your proposed solution feels a lot more powerful and ergonomic. It'd be a pain to make a new |
I have not found a way to do this (with this or any other crate). Having the ability to do this would make my day! |
I don't suppose we ever implemented something like Michael suggested? My use case is to inject a stringified ident into another macro, e.g. EDIT: I've published my own pre-processor which is inspired by paste, but more powerful - this is available now in this crate, but might move out soon: https://docs.rs/sbor-derive/1.2.0/sbor_derive/macro.eager_replace.html |
Would it be possible to use
paste
as a workaround for rust-lang/rust#52607? I was thinking you could add a:stringify
modifier which will wrap the concatenated text in a string literal.Imagine being able to write something like this:
This is kinda related to #29 in that we're playing with
#[doc]
attributes, with the difference being where the string comes from. In that issue it comes fromstringify!($name)
in a previous macro invocation, but here we'd be usingpaste
to generate the doc string directly.The text was updated successfully, but these errors were encountered: