Skip to content

Commit f789955

Browse files
committed
Stabilize ptr_unaligned feature, closes rust-lang#37955
1 parent 5b4a1b6 commit f789955

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/libcore/ptr.rs

Lines changed: 2 additions & 6 deletions
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,
@@ -241,8 +239,6 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
241239
/// Basic usage:
242240
///
243241
/// ```
244-
/// #![feature(ptr_unaligned)]
245-
///
246242
/// let mut x = 0;
247243
/// let y = &mut x as *mut i32;
248244
/// let z = 12;
@@ -253,7 +249,7 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
253249
/// }
254250
/// ```
255251
#[inline]
256-
#[unstable(feature = "ptr_unaligned", issue = "37955")]
252+
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
257253
pub unsafe fn write_unaligned<T>(dst: *mut T, src: T) {
258254
copy_nonoverlapping(&src as *const T as *const u8,
259255
dst as *mut u8,

0 commit comments

Comments
 (0)