Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand macro parameters in the comments. #37903

Open
Yamakaky opened this issue Nov 20, 2016 · 6 comments
Open

Expand macro parameters in the comments. #37903

Yamakaky opened this issue Nov 20, 2016 · 6 comments
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-feature-request Category: A feature request, i.e: not implemented / a PR.

Comments

@Yamakaky
Copy link
Contributor

macro_rules! test {
  (name:ident) => {
    /// A struct named $name.
    struct $name;
  }
}
@sanxiyn sanxiyn added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Nov 21, 2016
@bluss
Copy link
Member

bluss commented Nov 22, 2016

@Yamakaky Can you clarify what you mean?

@Yamakaky
Copy link
Contributor Author

Sorry: I would like for test!(Name) to expand the comment to /// A struct named Name.

@bluss bluss changed the title [rustdoc] Expand macro parameters in the comments. Expand macro parameters in the comments. Nov 22, 2016
@bluss bluss added A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) and removed T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Nov 22, 2016
@bluss
Copy link
Member

bluss commented Nov 22, 2016

I see, thank you, that would be a general Rust feature and not just rustdoc, then.

@leoschwarz
Copy link

leoschwarz commented Apr 29, 2017

This might break backward compatibility (if docs are also to be covered by that guarantee) since people might have used $s in their docs already not intending them to be replaced. Also if there is no variable found should it just leave the $word unchanged there or should a warning or error be emitted?

This feature probably requires a RFC. Relevant discussion: rust-lang/rfcs#1516

@Mark-Simulacrum Mark-Simulacrum added the C-feature-request Category: A feature request, i.e: not implemented / a PR. label Jul 26, 2017
@Dynisious
Copy link

Any new word on this topic? I feel it could be a useful change for a number of cases e.g. a macros which creates functions in my case.

@jhg
Copy link

jhg commented Jun 25, 2020

Any news on this? In some cases structs or functions created by a macro only have a generic doc comment when could give more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-feature-request Category: A feature request, i.e: not implemented / a PR.
Projects
None yet
Development

No branches or pull requests

7 participants