Skip to content

“may not” was incorrectly changed to “must not” in FromResidual documentation #123566

Closed
@taylordotfish

Description

@taylordotfish

Location

Documentation for FromResidual::from_residual

Summary

As part of #87445, the following part of the documentation for FromResidual::from_residual:

/// This should be implemented consistently with the `branch` method such
/// that applying the `?` operator will get back an equivalent residual:
/// `FromResidual::from_residual(r).branch() --> ControlFlow::Break(r)`.
/// (It may not be an *identical* residual when interconversion is involved.)

was changed to (change in bold):

/// This should be implemented consistently with the `branch` method such
/// that applying the `?` operator will get back an equivalent residual:
/// `FromResidual::from_residual(r).branch() --> ControlFlow::Break(r)`.
/// (It must not be an *identical* residual when interconversion is involved.)

The parenthetical now appears to state that the residual is not permitted to be identical when interconversion is involved (i.e., it must be different in some way). However, I believe the intention of the original wording was to convey that the residual is not required to be identical when interconversion is involved, which makes more sense contextually. I believe the emphasis on the word “identical” also supports this interpretation.

I propose that “must not” be changed to “need not”, “is not required to”, “does not have to”, or similar. Even “might not”, the other alternative in #87445, would be closer.

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.T-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