Skip to content

PartialOrd docs for generic tuples show the where clauses in a seemingly random order #88809

Closed

Description

@jruderman

On https://doc.rust-lang.org/std/cmp/trait.PartialOrd.html:

The docs for PartialOrd on tuples show the where clauses in a weird order, obscuring the fact that the last element of the tuple is allowed to be unsized.

impl<A, B, C, D, E> PartialOrd<(A, B, C, D, E)> for (A, B, C, D, E) where
    C: PartialOrd<C> + PartialEq<C>,
    E: PartialOrd<E> + PartialEq<E> + ?Sized,
    B: PartialOrd<B> + PartialEq<B>,
    A: PartialOrd<A> + PartialEq<A>,
    D: PartialOrd<D> + PartialEq<D>, 

Activity

  1. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    on Sep 17, 2021
  2. GuillaumeGomez commented on Sep 19, 2021

    @GuillaumeGomez
    Member

    Found the issue: it's because we use a BTreeMap using Symbol as key. Problem being that Symbol is making integer based comparison and not string based, hence the current result. Trying to write a test now.

  3. camelid commented on Sep 22, 2021

    @camelid
    Member

    Note that this bug is specific to cross-crate re-exports; the same documentation in core renders correctly. There also seems to be another "bug" related to cross-crate re-exports and where clauses: In the core docs, the impl looks like this (which is how it's actually written in the source):

    image

    But in the std docs, the impl looks like this, with all of the bounds expressed as where clauses:

    image

    I think the re-exported version is actually better, because it's easier to read, but they should at least be consistent.

  4. added a commit that references this issue on Sep 29, 2021
    905b9eb
  5. added a commit that references this issue on Sep 30, 2021
    7c23ff2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

C-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