Skip to content

fix docs for compiler builtin macros #30080

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

Merged
merged 2 commits into from
Nov 30, 2015
Merged

fix docs for compiler builtin macros #30080

merged 2 commits into from
Nov 30, 2015

Conversation

durka
Copy link
Contributor

@durka durka commented Nov 27, 2015

Fixes #30073. The input to cfg! is a meta attribute, but not any meta attribute (e.g. cfg!(allow(dead_code)) doesn't compile). But the macro_rules syntax can't quite express this, so I added a note to the doc.

@rust-highfive
Copy link
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

I think it may be better to correct this to $($t:tt)* which just shows that it takes some arbitrary list of tokens, that way we don't have to have bugs opened to ensure the two stay in sync.

@durka
Copy link
Contributor Author

durka commented Nov 30, 2015

@alexcrichton done, also added a link to the reference for that syntax.

@alexcrichton
Copy link
Member

@bors: r+ f18bfb3

Thanks!

bors added a commit that referenced this pull request Nov 30, 2015
Fixes #30073. The input to `cfg!` is a meta attribute, but not _any_ meta attribute (e.g. `cfg!(allow(dead_code))` doesn't compile). But the macro_rules syntax can't quite express this, so I added a note to the doc.
@bors
Copy link
Collaborator

bors commented Nov 30, 2015

⌛ Testing commit f18bfb3 with merge 7269f0e...

@bors bors merged commit f18bfb3 into rust-lang:master Nov 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants