Skip to content

Commit d38ea8b

Browse files
aturonalexcrichton
authored andcommitted
Stabilize ptr_unaligned feature, closes #37955
1 parent 65b7c4e commit d38ea8b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/libcore/ptr.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,6 @@ pub unsafe fn read<T>(src: *const T) -> T {
161161
/// Basic usage:
162162
///
163163
/// ```
164-
/// #![feature(ptr_unaligned)]
165-
///
166164
/// let x = 12;
167165
/// let y = &x as *const i32;
168166
///
@@ -171,7 +169,7 @@ pub unsafe fn read<T>(src: *const T) -> T {
171169
/// }
172170
/// ```
173171
#[inline(always)]
174-
#[unstable(feature = "ptr_unaligned", issue = "37955")]
172+
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
175173
pub unsafe fn read_unaligned<T>(src: *const T) -> T {
176174
let mut tmp: T = mem::uninitialized();
177175
copy_nonoverlapping(src as *const u8,
@@ -243,8 +241,6 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
243241
/// Basic usage:
244242
///
245243
/// ```
246-
/// #![feature(ptr_unaligned)]
247-
///
248244
/// let mut x = 0;
249245
/// let y = &mut x as *mut i32;
250246
/// let z = 12;
@@ -255,7 +251,7 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
255251
/// }
256252
/// ```
257253
#[inline]
258-
#[unstable(feature = "ptr_unaligned", issue = "37955")]
254+
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
259255
pub unsafe fn write_unaligned<T>(dst: *mut T, src: T) {
260256
copy_nonoverlapping(&src as *const T as *const u8,
261257
dst as *mut u8,

0 commit comments

Comments
 (0)