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

Support use as inner attributes #1

Open
Anders429 opened this issue Mar 8, 2021 · 0 comments
Open

Support use as inner attributes #1

Anders429 opened this issue Mar 8, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@Anders429
Copy link
Owner

Each attribute could potentially be used as an inner attribute.

#![doc_item::since("1.28.0")]
#![doc_item::docbox(content = "...")]

The above code block could be used at a crate-level to define crate-level since and item-info values.

As far as I can tell, the main challenge will be identifying whether the attribute is in an inner or outer position. The way to tell seems to be to check for pub mod { ... }. As I understand, pub mod {} is not valid in any other context, and is only wrapped around the full crate's code. As far as being used as an inner-attribute in other contexts, that may require more investigation surrounding what is passed in as the item TokenStream.

Note that this usage would require nightly, with custom_inner_attributes enabled.

@Anders429 Anders429 added the enhancement New feature or request label Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant