Skip to content

Tracking issue for array::from_ref and array::from_mut #77101

Closed

Description

@lcnr

Tracking issue for feature(array_from_ref) which adds the following methods

// std::array
pub fn from_ref<T>(s: &T) -> &[T; 1];
pub fn from_mut<T>(s: &mut T) -> &mut [T; 1];

Steps / History

Activity

  1. added
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on Sep 23, 2020
  2. added
    I-libs-radarLibs issues that are tracked on the team's radar.
    on Nov 6, 2020
  3. WaffleLapkin commented on Jan 17, 2021

    @WaffleLapkin
    Member

    Why is the mut version name differs from the slice variant? (from_ref_mut vs from_mut) Nvm, it's a typo in the issue description, the actual method is named from_mut.

    What is blocking stabilization, it seems like there aren't any open questions/controversies. Shall I make a stabilization PR?

  4. m-ou-se commented on Apr 12, 2021

    @m-ou-se
    Member

    @rfcbot merge

  5. rfcbot commented on Apr 12, 2021

    @rfcbot

    Team member @m-ou-se 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 at most 2 approvals are outstanding), 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.

  6. 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.
    final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.
    on Apr 12, 2021
  7. rfcbot commented on Apr 12, 2021

    @rfcbot

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

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

    @rfcbot

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

    As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

    The RFC will be merged soon.

  11. added 2 commits that reference this issue on Apr 24, 2021
  12. oconnor663 commented on Jun 12, 2021

    @oconnor663
    Contributor

    Has anyone proposed to stabilize these? Could I just open a PR to start that? :)

  13. WaffleLapkin commented on Jun 12, 2021

    @WaffleLapkin
    Member

    @oconnor663 I've proposed. In fact, they were already stabilized :)

    #84105

  14. mzji commented on Aug 4, 2021

    @mzji

    Since core::array::from_ref() and core::array::from_mut() has been stablized, could we now add impl<T> From<T> for [T; 1], impl<'a, T> From<&'a T> for &'a [T; 1] and impl<'a, T> From<&'a mut T> for &'a mut [T; 1] to libcore? These impls should be easy to implement (just one-liners) and ergonomic to use.

  15. jhpratt commented on Aug 4, 2021

    @jhpratt
    Member

    @mzji Feel free to create a pull request! I would imagine it would be accepted.

  16. zachs18 commented on Jul 21, 2024

    @zachs18
    Contributor

    [...] could we now add impl<T> From<T> for [T; 1], impl<'a, T> From<&'a T> for &'a [T; 1] and impl<'a, T> From<&'a mut T> for &'a mut [T; 1] to libcore? [...]

    Adding From<T> for [T; 1] could conflict with downstream From<Local> for [Local; 1].
    Similarly, since & and &mut are "fundamental" and behave like their pointee for coherence purposes, downstream impls of From<&'a Local> for &'a [Local; 1] etc are also currently allowed, such that adding impl<'a, T: 'a> From<&'a T> for &'a [T; 1] would also conflict.
    Adding another x.into() candidate for x: &T also was pointed out as possibly being an issue for type inference
    .

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-sliceArea: `[T]`C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCI-libs-radarLibs issues that are tracked on the team's radar.T-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