Skip to content

Commit

Permalink
Rollup merge of #136634 - bjoernager:const-mut-cursor, r=m-ou-se
Browse files Browse the repository at this point in the history
Stabilise `Cursor::{get_mut, set_position}` in `const` scenarios.

Closes: #130801

This PR stabilises the `const_mut_cursor` feature gate.
  • Loading branch information
matthiaskrgr authored Feb 7, 2025
2 parents 5df99b0 + 4500ed5 commit d9f95ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/std/src/io/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl<T> Cursor<T> {
/// let reference = buff.get_mut();
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_mut_cursor", issue = "130801")]
#[rustc_const_stable(feature = "const_mut_cursor", since = "CURRENT_RUSTC_VERSION")]
pub const fn get_mut(&mut self) -> &mut T {
&mut self.inner
}
Expand Down Expand Up @@ -201,7 +201,7 @@ impl<T> Cursor<T> {
/// assert_eq!(buff.position(), 4);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_mut_cursor", issue = "130801")]
#[rustc_const_stable(feature = "const_mut_cursor", since = "CURRENT_RUSTC_VERSION")]
pub const fn set_position(&mut self, pos: u64) {
self.pos = pos;
}
Expand Down

0 comments on commit d9f95ec

Please sign in to comment.