Skip to content

rustdoc renders stability attribute for trait implementations on type pages, but not trait pages #80777

Description

@jplatte

For example, impl BitOr<NonZeroU128> for NonZeroU128 being stable since 1.45.0 is visible on the page for NonZeroU128:

Screenshot_2021-01-07 core num NonZeroU128 - Rust

but not on the page for BitOr:

Screenshot_2021-01-07 core ops BitOr - Rust

(also the latter doesn't have BitOr linkified while the former has NonZeroU128 linkified, but self-links seem less important)

Activity

added
A-stabilityArea: `#[stable]`, `#[unstable]` etc.
C-bugCategory: This is a bug.
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
on Jan 7, 2021

jyn514 commented on Jan 7, 2021

@jyn514
Member

(also the latter doesn't have BitOr linkified while the former has NonZeroU128 linkified, but self-links seem less important)

I would guess the same bug is causing both issues.

LeSeulArtichaut commented on Jan 21, 2021

@LeSeulArtichaut
Contributor

I'll try to investigate and see if I can find something interesting :)

LeSeulArtichaut commented on Jan 21, 2021

@LeSeulArtichaut
Contributor

(kind of obvious) MCVE:

#![feature(staged_api)]

pub trait Foo {}

pub struct Bar;

#[stable(feature = "foobar", since = "1.0.0")]
impl Foo for Bar {}

LeSeulArtichaut commented on Jan 23, 2021

@LeSeulArtichaut
Contributor

(also the latter doesn't have BitOr linkified while the former has NonZeroU128 linkified, but self-links seem less important)

I would guess the same bug is causing both issues.

Not self-linking seems to be expected behavior, this was made in #32558 back in 2016. What looks inconsistent to me however is that "Implementations on Foreign Types" do self-link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

A-stabilityArea: `#[stable]`, `#[unstable]` etc.A-trait-systemArea: Trait systemC-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions