Skip to content

Tracking Issue for {array, slice}::{from_ref, from_mut} as const fn #90206

Closed

Description

@WaffleLapkin

Feature gates: #![feature(const_array_from_ref)] and #![feature(const_slice_from_ref)]

This is a tracking issue for {array, slice}::{from_ref, from_mut} functions marked as const fn

Public API

This feature makes the following APIs const:

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

// core::slice
pub const fn from_mut<T>(s: &mut T) -> &mut [T];

These functions as const were previously tracked here, but are now stabilized:

// core::array
pub const fn from_ref<T>(s: &T) -> &[T; 1];

// core::slice
pub const fn from_ref<T>(s: &T) -> &[T];

Steps / History

Unresolved Questions

  • None yet.

Activity

  1. added
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    T-libs-api[DEPRECATED; DO NOT USE]
    on Oct 23, 2021
  2. Amanieu commented on May 23, 2022

    @Amanieu
    Member

    @rfcbot fcp merge

  3. rfcbot commented on May 23, 2022

    @rfcbot

    Team member @Amanieu 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.

  4. 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 May 23, 2022
  5. WaffleLapkin commented on May 23, 2022

    @WaffleLapkin
    MemberAuthor

    Note that from_mut is not being stabilized as &mut is unstable in const context.

    cc @oli-obk

  6. Amanieu commented on May 23, 2022

    @Amanieu
    Member

    Tracking issue for &mut in const: #57349

  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 May 24, 2022
  8. rfcbot commented on May 24, 2022

    @rfcbot

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

  9. oli-obk commented on May 24, 2022

    @oli-obk
    Contributor

    cc @rust-lang/wg-const-eval

  10. added
    to-announceAnnounce this issue on triage meeting
    and removed
    final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.
    on Jun 3, 2022
  11. 1 remaining item

  12. added a commit that references this issue on Jun 3, 2022
  13. WaffleLapkin commented on Mar 7, 2023

    @WaffleLapkin
    MemberAuthor

    This still tracks {array,slice}::from_mut as a const fn.

  14. dtolnay commented on Sep 22, 2024

    @dtolnay
    Member

    @rust-lang/libs-api:
    @rfcbot fcp merge

    from_ref was stabilized for const in 1.63. Now from_mut has been unblocked by the stabilization of #57349.

  15. dtolnay commented on Sep 22, 2024

    @dtolnay
    Member

    FCP for from_mut: #130538 (comment)

  16. added a commit that references this issue on Oct 9, 2024
  17. added a commit that references this issue on Oct 10, 2024
  18. added a commit that references this issue on Oct 10, 2024
  19. added a commit that references this issue on Oct 10, 2024
  20. compiler-errors commented on Feb 10, 2025

    @compiler-errors
    Contributor

    both seem to have been stabilized, so closing

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-arrayArea: `[T; N]`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