Skip to content

Commit

Permalink
Stabilize ptr_const_cast
Browse files Browse the repository at this point in the history
This stabilizes `ptr_const_cast` feature as was decided in a recent
[FCP](rust-lang/rust#92675 (comment))

Closes #92675
  • Loading branch information
Kixunil committed Aug 10, 2022
1 parent 770fd52 commit ca1554d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/src/ptr/const_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ impl<T: ?Sized> *const T {
///
/// This is a bit safer than `as` because it wouldn't silently change the type if the code is
/// refactored.
#[unstable(feature = "ptr_const_cast", issue = "92675")]
#[rustc_const_unstable(feature = "ptr_const_cast", issue = "92675")]
#[stable(feature = "ptr_const_cast", since = "1.65.0")]
#[rustc_const_stable(feature = "ptr_const_cast", since = "1.65.0")]
pub const fn cast_mut(self) -> *mut T {
self as _
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ impl<T: ?Sized> *mut T {
/// coercion.
///
/// [`cast_mut`]: #method.cast_mut
#[unstable(feature = "ptr_const_cast", issue = "92675")]
#[rustc_const_unstable(feature = "ptr_const_cast", issue = "92675")]
#[stable(feature = "ptr_const_cast", since = "1.65.0")]
#[rustc_const_stable(feature = "ptr_const_cast", since = "1.65.0")]
pub const fn cast_const(self) -> *const T {
self as _
}
Expand Down

0 comments on commit ca1554d

Please sign in to comment.