Skip to content

rustdoc: Trait object (e.g. impl Any) inherent methods are not properly documented #19055

Closed
@japaric

Description

@japaric

STR

pub trait Any {}

impl<'any> Any + 'any {
    /// Returns true if the boxed type is the same as `T`
    pub fn is<T: 'static>(&self) -> bool { unimplemented!() }

    /// Returns some reference to the boxed value if it is of type `T`, or
    /// `None` if it isn't.
    pub fn downcast_ref<'a, T: 'static>(&'a self) -> Option<&'a T> { unimplemented!() }

    /// Returns some mutable reference to the boxed value if it is of type `T`, or
    /// `None` if it isn't.
    pub fn downcast_mut<'a, T: 'static>(&'a mut self) -> Option<&'a mut T> { unimplemented!() }
}

Output

Any's inherent methods appear in the search index:

search

But upon clicking the method, you land in the Any main page:

nothing

Where the methods don't show up

Metadata

Metadata

Assignees

Labels

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