Skip to content

Tracking Issue for the use of ? in constants #74935

Open

Description

@oli-obk

The ? operator expands to invoking Try::into_result for the argument and Into::into for the error of the result. In order to support these, we need to

Activity

  1. added
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on Jul 30, 2020
  2. added
    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)
    on Jul 30, 2020
  3. a1phyr commented on Jul 30, 2020

    @a1phyr
    Contributor

    #60964 also needs to be resolved to be able to implement const Try.
    See https://play.rust-lang.org/?version=nightly&gist=bdf8f8e2774f54c084e2cb25624ce193

  4. jhpratt commented on Mar 1, 2022

    @jhpratt
  5. oli-obk commented on Mar 1, 2022

    @oli-obk
    Author
  6. jhpratt commented on Mar 1, 2022

    @jhpratt
  7. oli-obk commented on Mar 1, 2022

    @oli-obk
    Author
  8. jhpratt commented on Mar 1, 2022

    @jhpratt
  9. added a commit that references this issue on Nov 13, 2024
  10. clarfonthey commented on Jul 22, 2025

    @clarfonthey
    Contributor

    Poking around, it's very confusing that this tracking issue isn't just for the traits related to ?, but also includes AsRef, AsMut, TryFrom, and TryInto. I would expect those traits and their impls to go under #143773, and for this to be reserved for just Try, FromResidual, and Residual.

    EDIT: I've done this under #144289.

  11. added a commit that references this issue on Sep 2, 2025
  12. added a commit that references this issue on Sep 2, 2025
  13. added a commit that references this issue on Sep 9, 2025
  14. programmerjake commented on Sep 26, 2025

    @programmerjake
    Member

    experience report from my demo of how we could constify array try_map:
    https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=23947d4625bdbe04c77cbacb64589f47

    we should change the trait bounds on Residual::TryType to [const] Try and maybe add [const] Destruct bounds.

  15. clarfonthey commented on Sep 27, 2025

    @clarfonthey
    Contributor

    Yeah, Residual::TryType not being [const] Try is definitely a mistake. I figure you're going to make a PR for it, but if not, I can instead.

  16. programmerjake commented on Sep 27, 2025

    @programmerjake
    Member

    Yeah, Residual::TryType not being [const] Try is definitely a mistake. I figure you're going to make a PR for it, but if not, I can instead.

    @clarfonthey feel free to make a PR

  17. added a commit that references this issue on Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions