Skip to content

Reservation impls in rustdoc #87826

Open
Open
@steffahn

Description

@steffahn

I’ve been browsing rustdoc and just noticed a very confusing blanket impl on Infallible.

Screenshot_20210806_191027

Confusing because it’s obviously in conflict with the explicit From<!> for Infallible as well as the generic From<T> for T implementation. Only after looking at the source code I could find out that this isn’t even an implementation at all. Searching for existing issues, the original issue on this topic is closed and concluded

This is how it currently looks, and I think it's "good enough". Going to close the issue.

image


This comment however is only visible on the page of the From trait itself.

Another example of this problem, the same impl on the Option<T> type.

I’m also confused by the fact that the impl is only shown on some types in std but not all. E.g. on the cmp::Ordering type you can’t see it at all.

I don’t feel like it would be a difficult change to just make this From impl entirely invisible in rustdoc. I don’t see any value in displaying it, and it can be very confusing, especially when displayed without the accompanying comment.

@rustbot label T-rustdoc, F-rustc_attrs, T-libs-api, A-docs, C-bug

Tagging T-libs-api, A-docs as well because the situation could immediately and easily be somewhat improved by adding the “this impl does not yet exist” explanation docs to the from method, as that one’s at least being displayed everywhere (if you click the [+] button sufficiently often).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.F-rustc_attrsInternal rustc attributes gated on the `#[rustc_attrs]` feature gate.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.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