Anders429 / Anders429/doc_item
Support use as inner attributes
- Linguagem predominante
- Rust
- Estrelas
- 3
- Forks
- 0
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
Each attribute could potentially be used as an inner attribute.
```rust
#![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`](https://doc.rust-lang.org/beta/unstable-book/language-features/custom-inner-attributes.html) enabled.
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Avaliação
Esta issue ainda não foi avaliada.