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

doc-comments inside of macros broken #23812

Closed
pyfisch opened this issue Mar 28, 2015 · 0 comments
Closed

doc-comments inside of macros broken #23812

pyfisch opened this issue Mar 28, 2015 · 0 comments
Assignees
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@pyfisch
Copy link
Contributor

pyfisch commented Mar 28, 2015

    foobar!{
        /// This is a doc comment
        (do) => (Some<Thing>)*
    }

#17830 enabled doc comments inside of macros, the doc comment in the example should be expanded to #[doc="This is a doc comment"] but the leading slashes are included. They are present in the output generated by rustdoc:

/// Accept header, defined in RFC7231 /// /// The Accept header field can be used by user agents to specify /// response media types that are acceptable. Accept header fields can /// be used to indicate that the request is specifically limited to a /// small set of desired types, as in the case of a request for an /// in-line image /// /// # ABNF /// plain /// Accept = #( media-range [ accept-params ] ) /// " /// media-range = ( "*/*"" /// / ( type "/" "*" )" /// / ( type "/" subtype )" /// ) *( OWS ";" OWS parameter )" /// accept-params = weight *( accept-ext )" /// accept-ext = OWS ";" OWS token [ "=" ( token / quoted-string ) ]" ///"

Version: rustc 1.0.0-nightly (199bdcfef 2015-03-26) (built 2015-03-27)

@steveklabnik steveklabnik added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Mar 28, 2015
@emberian emberian self-assigned this Mar 30, 2015
@Kimundi Kimundi added the A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) label Apr 14, 2015
bors added a commit that referenced this issue Jul 20, 2015
Fixes #23812 by stripping the decoration when desugaring macro doc comments into #[doc] attributes, and detects whether the attribute should be inner or outer style and outputs the appropriate token tree.
seanmonstar pushed a commit to hyperium/headers that referenced this issue Jul 9, 2018
A bug (rust-lang/rust#23812) in rustc prevented the use of normal
comments inside macros but this has been fixed.
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, ..) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants