Rollup merge of #100184 - Kixunil:stabilize_ptr_const_cast, r=m-ou-se
Stabilize ptr_const_cast This stabilizes `ptr_const_cast` feature as was decided in a recent [FCP](https://github.com/rust-lang/rust/issues/92675#issuecomment-1190660233) Closes #92675
This commit is contained in:
commit
d749914f79
3 changed files with 4 additions and 5 deletions
|
@ -19,7 +19,6 @@
|
||||||
#![feature(rustc_attrs)]
|
#![feature(rustc_attrs)]
|
||||||
#![cfg_attr(test, feature(test))]
|
#![cfg_attr(test, feature(test))]
|
||||||
#![feature(strict_provenance)]
|
#![feature(strict_provenance)]
|
||||||
#![feature(ptr_const_cast)]
|
|
||||||
|
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
|
|
||||||
|
|
|
@ -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
|
/// This is a bit safer than `as` because it wouldn't silently change the type if the code is
|
||||||
/// refactored.
|
/// refactored.
|
||||||
#[unstable(feature = "ptr_const_cast", issue = "92675")]
|
#[stable(feature = "ptr_const_cast", since = "1.65.0")]
|
||||||
#[rustc_const_unstable(feature = "ptr_const_cast", issue = "92675")]
|
#[rustc_const_stable(feature = "ptr_const_cast", since = "1.65.0")]
|
||||||
pub const fn cast_mut(self) -> *mut T {
|
pub const fn cast_mut(self) -> *mut T {
|
||||||
self as _
|
self as _
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,8 +100,8 @@ impl<T: ?Sized> *mut T {
|
||||||
/// coercion.
|
/// coercion.
|
||||||
///
|
///
|
||||||
/// [`cast_mut`]: #method.cast_mut
|
/// [`cast_mut`]: #method.cast_mut
|
||||||
#[unstable(feature = "ptr_const_cast", issue = "92675")]
|
#[stable(feature = "ptr_const_cast", since = "1.65.0")]
|
||||||
#[rustc_const_unstable(feature = "ptr_const_cast", issue = "92675")]
|
#[rustc_const_stable(feature = "ptr_const_cast", since = "1.65.0")]
|
||||||
pub const fn cast_const(self) -> *const T {
|
pub const fn cast_const(self) -> *const T {
|
||||||
self as _
|
self as _
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue