Skip to content

Tracking issue for Option::copied #57126

Closed

Description

@sugar700

This is a tracking issue for Option::copied.

Added in #56534. Feature gate: #![feature(copied)].

Related feature: iter_copied in #57127.

Activity

  1. added
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on Dec 26, 2018
  2. pmarcelll commented on Dec 26, 2018

    @pmarcelll
  3. sugar700 commented on Dec 26, 2018

    @sugar700
    Author
  4. added
    T-libs-api[DEPRECATED; DO NOT USE]
    B-unstableBlocker: Implemented in the nightly compiler and unstable.
    on Dec 28, 2018
  5. alercah commented on Jan 20, 2019

    @alercah

    The map_clone lint in Clippy should be updated to suggest this instead when the type is copiable.

  6. Centril commented on Jan 28, 2019

    @Centril
    Contributor

    So we added a newtype Copied because that's what we usually do. However, in this case, we could simply reuse Cloned and implement copied as:

    fn copied<'a, T>(self) -> Cloned<Self> where
        Self: Iterator<Item = &'a T>,
        T: 'a + Copy, 

    Are there notable reasons not to do this that I'm missing? Doing so would substantially decrease the cost of this feature for the standard library.

  7. sugar700 commented on Jan 29, 2019

    @sugar700
    ContributorAuthor

    Cloned type wouldn't have the guarantees that Copied does, as it calls the clone method, which can have side-effects (it shouldn't, but it's not something we can depend on).

    Although I suppose we currently DO expose specialization in Cloned structure when Clone implementation is incompatible with Copy implementation. This seems like a bug, so I will fix that in a separate PR.

  8. sugar700 commented on Jan 29, 2019

    @sugar700
    ContributorAuthor

    See #57970.

  9. SimonSapin commented on Feb 1, 2019

    @SimonSapin
    Contributor

    The comment about the Copied type belongs in #57127. Since I see no objection to Option::copied:

    @rfcbot fcp merge

  10. rfcbot commented on Feb 1, 2019

    @rfcbot

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

    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.

  11. added
    proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
    disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.
    on Feb 1, 2019
  12. 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 Feb 8, 2019
  13. rfcbot commented on Feb 8, 2019

    @rfcbot

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

  14. rfcbot commented on Feb 18, 2019

    @rfcbot

    The final comment period, with a disposition to merge, as per the review above, is now complete.

  15. added and removed
    final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.
    on Feb 18, 2019
  16. matklad commented on Mar 15, 2019

    @matklad
    Contributor

    Am I correct that this now awaits for a stabilization PR?

  17. SimonSapin commented on Mar 15, 2019

    @SimonSapin
    Contributor

    Yes.

  18. added a commit that references this issue on Mar 16, 2019
  19. matklad commented on Mar 16, 2019

    @matklad
    Contributor

    Stabilization PR is up: #59231

  20. added a commit that references this issue on Mar 16, 2019
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]disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions