Skip to content

Deprecate try! macro in favor of ? #61000

Closed

Description

I propose to mark the try! macro as deprecated.


Reasons for it:

The ? operator was added to replace try! and should be used instead.


There are no real downsides 😃
(I am happy to wait for #37939 ;)

Activity

  1. added
    T-libs-api[DEPRECATED; DO NOT USE]
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on May 21, 2019
  2. Centril commented on May 21, 2019

    @Centril
    Contributor

    I did some investigation on the playground and it seems that the reason r#try! isn't deprecated yet is because macro_rules! cannot be deprecated at all. cc @petrochenkov

  3. petrochenkov commented on May 21, 2019

    @petrochenkov
    Contributor

    because macro_rules! cannot be deprecated at all

    The issue is #49912, someone (not me) needs to do the work.

  4. petrochenkov commented on May 21, 2019

    @petrochenkov
    Contributor

    Deprecation and stability checking is actually done after macro expansion

    It can work at any point if name resolution results are available.
    Stability checking is already implemented for macros and deprecation checking can be done by analogy.

  5. added 2 commits that reference this issue on Jul 7, 2019
  6. tesuji commented on Jul 14, 2019

    @tesuji
    Contributor

    I take this in #62672 .

  7. added a commit that references this issue on Aug 9, 2019
    03c524e
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

    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-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