Skip to content

Tracking issue for '_ #48469

Closed
Closed

Description

@nikomatsakis

This is a sub-issue of #44524, tracking the desire to stabilize '_ (and the lints around its usage).

Covered areas

The '_ can be used anywhere that a region can be elided. It (typically) carries the same meaning as having no region at all. This section summarizes its usage, giving pointers to tests, and also listing known blocking issues.

  • fn foo(x: Ref<'_>) -- fresh name
  • fn foo(&self) -> Ref<'_> -- links to self
  • fn foo(&self) -> Box<dyn Debug + '_> -- links to self, not quite the same as Box<dyn Debug>
  • fn foo(&self) -> Box<impl Debug + '_> -- links to self, not quite the same as Box<impl Debug>

Some areas where elision ought to be supported are not yet:

There are also several linted scenarios to nudge the user in the right direction:

Changes or clarifications to the RFC

The behavior around dyn Trait is probably worth highlighting, since it is one case where '_ differs from writing nothing at all.

Activity

  1. added
    T-langRelevant to the language team
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on Feb 23, 2018
  2. added this to the 1.26 milestone on Mar 8, 2018
  3. nikomatsakis commented on Mar 8, 2018

    @nikomatsakis
    ContributorAuthor

    @rfcbot fcp merge

    I want to propose that we stabilize '_, with the semantics as given in the header of this post. Note however that there are some blocking issues that must be resolved (cited in the header) before stabilization can actually occur. But those don't need to block us making the decision to stabilize.

  4. rfcbot commented on Mar 8, 2018

    @rfcbot

    Team member @nikomatsakis has proposed to merge this. The next step is review by the rest of the tagged teams:

    No concerns currently listed.

    Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

    See this document for info about what commands tagged team members can give me.

  5. added
    proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
    on Mar 8, 2018
  6. rfcbot commented on Mar 14, 2018

    @rfcbot

    🔔 This is now entering its final comment period, as per the review above. 🔔

  7. added
    final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.
    and removed
    proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
    on Mar 14, 2018
  8. rfcbot commented on Mar 24, 2018

    @rfcbot

    The final comment period is now complete.

  9. steveklabnik commented on Apr 4, 2018

    @steveklabnik
    Contributor

    was this closed by #49458 ?

  10. nikomatsakis commented on Apr 5, 2018

    @nikomatsakis
    ContributorAuthor

    Seems like...yes.

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

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-langRelevant to the language teamfinal-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions