Skip to content

Tracking Issue for const_mut_cursor #130801

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
3 tasks done
bjoernager opened this issue Sep 24, 2024 · 5 comments · Fixed by #136634
Closed
3 tasks done

Tracking Issue for const_mut_cursor #130801

bjoernager opened this issue Sep 24, 2024 · 5 comments · Fixed by #136634
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Milestone

Comments

@bjoernager
Copy link
Contributor

bjoernager commented Sep 24, 2024

Feature gate: #![feature(const_mut_cursor)]

This is a tracking issue for marking the get_mut and set_position methods in std::io::Cursor as const.

Public API

// std::io

impl<T> Cursor<T> {
    pub const fn get_mut(&mut self) -> &mut T;

    pub const fn set_position(&mut self, pos: u64);
}

Steps / History

Unresolved Questions

  • Can we also "constify" into_inner?
@bjoernager bjoernager added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Sep 24, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Nov 20, 2024
…htriplett

Mark `get_mut` and `set_position` in `std::io::Cursor` as const.

Relevant tracking issue: rust-lang#130801

The methods `get_mut` and `set_position` can trivially be marked as const due to rust-lang#57349 being stabilised.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Nov 20, 2024
…htriplett

Mark `get_mut` and `set_position` in `std::io::Cursor` as const.

Relevant tracking issue: rust-lang#130801

The methods `get_mut` and `set_position` can trivially be marked as const due to rust-lang#57349 being stabilised.
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Nov 21, 2024
Rollup merge of rust-lang#130800 - bjoernager:const-mut-cursor, r=joshtriplett

Mark `get_mut` and `set_position` in `std::io::Cursor` as const.

Relevant tracking issue: rust-lang#130801

The methods `get_mut` and `set_position` can trivially be marked as const due to rust-lang#57349 being stabilised.
@RalfJung
Copy link
Member

@rust-lang/libs-api these are two trivial already-stable methods that (I assume) haven't been made const-stable years ago just because they need mutable references. Now that we have mutable references in const, there's no reason to wait any longer with making them const-stable IMO.

@RalfJung RalfJung added the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Nov 30, 2024
@dtolnay
Copy link
Member

dtolnay commented Nov 30, 2024

@rfcbot fcp merge

Their non-mut counterparts, get_ref and position, were stabilized in const in Rust 1.79 by #78812.

@rfcbot
Copy link
Collaborator

rfcbot commented Nov 30, 2024

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

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Nov 30, 2024
@dtolnay dtolnay removed the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Nov 30, 2024
@rfcbot rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Jan 27, 2025
@rfcbot
Copy link
Collaborator

rfcbot commented Jan 27, 2025

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

@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Feb 6, 2025
@rfcbot
Copy link
Collaborator

rfcbot commented Feb 6, 2025

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.

This will be merged soon.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 6, 2025
…u-se

Stabilise `Cursor::{get_mut, set_position}` in `const` scenarios.

Closes: rust-lang#130801

This PR stabilises the `const_mut_cursor` feature gate.
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Feb 7, 2025
@bors bors closed this as completed in d9f95ec Feb 7, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Feb 7, 2025
Rollup merge of rust-lang#136634 - bjoernager:const-mut-cursor, r=m-ou-se

Stabilise `Cursor::{get_mut, set_position}` in `const` scenarios.

Closes: rust-lang#130801

This PR stabilises the `const_mut_cursor` feature gate.
github-actions bot pushed a commit to tautschnig/verify-rust-std that referenced this issue Mar 11, 2025
…u-se

Stabilise `Cursor::{get_mut, set_position}` in `const` scenarios.

Closes: rust-lang#130801

This PR stabilises the `const_mut_cursor` feature gate.
@cuviper cuviper added this to the 1.86.0 milestone Mar 21, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants