Skip to content

Factual error in PartialEq documentation #91843

Open
@QuineDot

Description

@QuineDot

The documentation for PartialEq states:

x.eq(y) can also be written x == y, and x.ne(y) can be written x != y.

This is not true, as #44762 illustrates, as well as this URLO-inspired example:

    let val = 1i32;
    let val_ref = &val;
    let is_equal = val.eq(val_ref); // Compiles
    let is_equal = val == val_ref; // Does not compile    

The other operator's documentation don't have this error. Shl (and Shr) also explicitly note some differences in inference between operators and the method call.

@rustbot label +A-docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-langRelevant to the language teamT-libs-apiRelevant to the library API 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