Skip to content

Tracking issue for TryFrom/TryInto traits #33417

Closed

Description

@alexcrichton

Tracking issue for rust-lang/rfcs#1542


To do:

Activity

  1. added
    B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.
    T-libs-api[DEPRECATED; DO NOT USE]
    on May 4, 2016
  2. added 3 commits that reference this issue on May 8, 2016
  3. Zoxc commented on May 9, 2016

    @Zoxc
    Contributor

    Is there a way to generically print an error with the original value if the conversion fails without requiring Clone so a related method which panics on failure could have nice error messages?

  4. chris-morgan commented on May 10, 2016

    @chris-morgan
    Member

    A discussion of whether this should go in the prelude is pending for when this goes stable.

  5. added
    B-unstableBlocker: Implemented in the nightly compiler and unstable.
    and removed
    B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.
    on Jun 21, 2016
  6. shepmaster commented on Jul 9, 2016

    @shepmaster
    Member

    Apologies if this is covered somewhere else, but what would we like to see before marking this as stable? I'm pretty sure I've reimplemented this functionality a few times in various projects, so a common reusable trait would make me 😄

  7. sfackler commented on Jul 9, 2016

    @sfackler
    Member

    We can bring it up for discussion for the next cycle.

  8. 283 remaining items

  9. SimonSapin commented on Mar 12, 2019

    @SimonSapin
    Contributor

    Oh I thought #58015 had landed, but it hasn’t yet… Let’s discuss it there.

  10. added a commit that references this issue on Mar 12, 2019
  11. o01eg commented on Mar 30, 2019

    @o01eg
    Contributor

    Could TryFrom trait have a method to check if argument could be converted without consuming it?

    fn check(value: &T) -> bool
  12. Kerollmops commented on Mar 30, 2019

    @Kerollmops
    Contributor

    One way to work with non-consuming impossible conversion could be to return the consumed non-convertible value along with the associated error.

  13. SimonSapin commented on Apr 9, 2019

    @SimonSapin
    Contributor

    Oops this should have been closed by #58302. Closing now.


    @o01eg The typical way to do non-consuming conversion is to implement e.g. TryFrom<&'_ Foo> instead of TryFrom<Foo>.

  14. ErichDonGubler commented on Apr 9, 2019

    @ErichDonGubler
    Contributor

    Wait...this shouldn't actually close until landing on stable Thursday, right?

  15. sfackler commented on Apr 9, 2019

    @sfackler
    Member

    No, we close tracking issues when the PR stabilizing the feature lands on master.

  16. SimonSapin commented on Apr 9, 2019

    @SimonSapin
    Contributor

    No, we usually close tracking issue when the stabilization or removal lands in the master branch. After that there is nothing left to track. (Unless a newly-reported bug comes up, but we handle that separately.)

  17. jethrogb commented on Apr 9, 2019

    @jethrogb
    Contributor

    Tracking issues are closed by the PR that stabilizes them. Depending on the release cycle, this could be up to 12 weeks before stable is released.

  18. ErichDonGubler commented on Apr 9, 2019

    @ErichDonGubler
    Contributor

    Got it. Thanks for the clarification, everyone! :)

  19. shepmaster commented on Jun 5, 2019

    @shepmaster
    Member

    @gregdegruy update your version of Rust to 1.34 or higher.

  20. added a commit that references this issue on Oct 1, 2019
  21. added a commit that references this issue on Feb 7, 2020
  22. added a commit that references this issue on Nov 14, 2022
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

    B-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-api[DEPRECATED; DO NOT USE]

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions