parent
e8310a7714
commit
3b1f1a6446
@ -1540,7 +1540,6 @@ impl<T: ?Sized> *const T {
|
||||
/// Accessing adjacent `u8` as `u16`
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(align_offset)]
|
||||
/// # fn foo(n: usize) {
|
||||
/// # use std::mem::align_of;
|
||||
/// # unsafe {
|
||||
@ -1556,7 +1555,7 @@ impl<T: ?Sized> *const T {
|
||||
/// }
|
||||
/// # } }
|
||||
/// ```
|
||||
#[unstable(feature = "align_offset", issue = "44488")]
|
||||
#[stable(feature = "align_offset", since = "1.36.0")]
|
||||
pub fn align_offset(self, align: usize) -> usize where T: Sized {
|
||||
if !align.is_power_of_two() {
|
||||
panic!("align_offset: align is not a power-of-two");
|
||||
@ -2312,7 +2311,6 @@ impl<T: ?Sized> *mut T {
|
||||
/// Accessing adjacent `u8` as `u16`
|
||||
///
|
||||
/// ```
|
||||
/// # #![feature(align_offset)]
|
||||
/// # fn foo(n: usize) {
|
||||
/// # use std::mem::align_of;
|
||||
/// # unsafe {
|
||||
@ -2328,7 +2326,7 @@ impl<T: ?Sized> *mut T {
|
||||
/// }
|
||||
/// # } }
|
||||
/// ```
|
||||
#[unstable(feature = "align_offset", issue = "44488")]
|
||||
#[stable(feature = "align_offset", since = "1.36.0")]
|
||||
pub fn align_offset(self, align: usize) -> usize where T: Sized {
|
||||
if !align.is_power_of_two() {
|
||||
panic!("align_offset: align is not a power-of-two");
|
||||
|
Loading…
Reference in New Issue
Block a user