Skip to content

expr.try (the question mark operator) is out of date with regards to Try/FromResidual implementors #1927

@MetaflameDragon

Description

@MetaflameDragon

expr.try still only talks about being applicable to Result and Option, and describes its behavior as if hard-coded for those two types. While Try/FromResidual are still unstable, they are already implemented for other stable types - namely, std::ops::ControlFlow and std::task::Poll - and the trait methods are already usable within stable Rust through the ? operator.

I think it would be nice for the reference to acknowledge this progress now. While the API is in a half-unstable state, and there are still unresolved issues in the tracking issue, the operator is no longer hardcoded for just Option and Result - it might at least be worth it to reference the two other implementor types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions