Skip to content

Tracking issue for &mut T in const contexts (const_mut_refs) #57349

Closed
rust-lang/reference
#1590

Description

@ExpHP

The const_mut_refs feature gate allows the following in const context:

  • &mut arguments
  • mutable (re)borrows and raw pointers (&mut and addr_of_mut! expressions)
  • dereferencing mutable references and raw pointers (* expressions)

Remaining work

Open questions

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
    needs-rfcThis change is large or controversial enough that it should have an RFC accepted before doing it.
    on Jan 5, 2019
  2. changed the title [-]Mutation in const fn[/-] [+]Tracking issue for `&mut T` in const fn[/+] on Jan 5, 2019
  3. Centril commented on Jan 5, 2019

    @Centril
  4. added
    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)
    on Jan 5, 2019
  5. alercah commented on Jan 9, 2019

    @alercah
  6. eddyb commented on Feb 13, 2019

    @eddyb
  7. added a commit that references this issue on Jul 20, 2019
  8. elichai commented on Sep 5, 2019

    @elichai
  9. tema3210 commented on Sep 29, 2019

    @tema3210
  10. cramertj commented on Mar 11, 2020

    @cramertj
  11. 125 remaining items

  12. bjoernager commented on Sep 19, 2024

    @bjoernager
    Contributor

    There's also char::encode_utf8: #130512

  13. RalfJung commented on Sep 19, 2024

    @RalfJung
    Member

    This has just been implemented. Let's maybe let it bake on nightly for a bit?

  14. onestacked commented on Sep 19, 2024

    @onestacked
    Contributor

    #67456 needs an FCP started for Stabilization PR #130403

  15. added a commit that references this issue on Sep 22, 2024
  16. added 2 commits that reference this issue on Oct 4, 2024
  17. added a commit that references this issue on Oct 4, 2024
  18. added a commit that references this issue on Oct 5, 2024
  19. added a commit that references this issue on Oct 5, 2024
  20. Rudxain commented on Oct 29, 2024

    @Rudxain
    Contributor

    Is there a discussion thread for this? I've searched multiple RFCs, but I can't find a single one mentioning iterators. If I'm not mistaken, this feature is a big step forward to support const iteration. We already have const loops, so I can feel core::iter is soon becoming const too!

  21. Lokathor commented on Oct 29, 2024

    @Lokathor
    Contributor

    requiring const trait impls means that normal iterators are most likely rather far out.

  22. RalfJung commented on Oct 29, 2024

    @RalfJung
    Member

    Iterators are still blocked on being able to call trait functions in const, which is unfortunately quite tricky. See:

    Also, closed issue are not a support forum, so I'll lock this -- too many people get notifications in this one to make it a good place for support questions.

  23. locked as off topic and limited conversation to collaborators on Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)B-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCF-const_mut_refs`#![feature(const_mut_refs)]`T-langRelevant to the language team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions