Skip to content

Add support for #[doc(since="version")] attribute #74182

@dodomorandi

Description

@dodomorandi

To the present day, the internal crates like core and std can annotate things with #[stable(since="version")]. This is extremely useful for users, especially because rustdoc is able to write this information in the rendered documentation.

Unfortunately, this kind of feature is not available for normal crates. Take, for instance, tokio::runtime::Handle::current: this function is available since version 0.2.8 of the tokio crate (not sure about 0.2.7, that's not the point), but this information is not available at a first glimpse.

IMHO, adding the possibility of annotating functions, structs and traits (and maybe something I missed) with #[doc(since="version")] would give more doc power to crates' authors. Moreover, it should be possible to leverage the current implementation of stable(since="version") in order to introduce the feature without reinventing the wheel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.needs-rfcThis change is large or controversial enough that it should have an RFC accepted before doing it.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions