@@ -26,7 +26,7 @@ pub fn size_of<T>() -> uint {
26
26
27
27
/// Returns the size of the type that `_val` points to in bytes.
28
28
#[ inline]
29
- #[ unstable = "the name of this function may change slightly before stabilizing" ]
29
+ #[ stable ]
30
30
pub fn size_of_val < T > ( _val : & T ) -> uint {
31
31
size_of :: < T > ( )
32
32
}
@@ -64,7 +64,7 @@ pub fn min_align_of<T>() -> uint {
64
64
/// Returns the ABI-required minimum alignment of the type of the value that
65
65
/// `_val` points to
66
66
#[ inline]
67
- #[ unstable = "the name of this function may change slightly before stabilizing" ]
67
+ #[ stable ]
68
68
pub fn min_align_of_val < T > ( _val : & T ) -> uint {
69
69
min_align_of :: < T > ( )
70
70
}
@@ -90,7 +90,7 @@ pub fn align_of<T>() -> uint {
90
90
/// as trait objects (in the future), returning the alignment for an arbitrary
91
91
/// value at runtime.
92
92
#[ inline]
93
- #[ unstable = "the name of this function may change slightly before stabilizing" ]
93
+ #[ stable ]
94
94
pub fn align_of_val < T > ( _val : & T ) -> uint {
95
95
align_of :: < T > ( )
96
96
}
@@ -117,7 +117,7 @@ pub fn pref_align_of_val<T>(val: &T) -> uint { align_of_val(val) }
117
117
///
118
118
/// This is useful for FFI functions sometimes, but should generally be avoided.
119
119
#[ inline]
120
- #[ unstable = "the name of this function is subject to change" ]
120
+ #[ stable ]
121
121
pub unsafe fn zeroed < T > ( ) -> T {
122
122
intrinsics:: init ( )
123
123
}
@@ -136,7 +136,14 @@ pub unsafe fn init<T>() -> T { zeroed() }
136
136
///
137
137
/// This is useful for FFI functions sometimes, but should generally be avoided.
138
138
#[ inline]
139
- #[ unstable = "the name of this function is subject to change" ]
139
+ #[ stable]
140
+ pub unsafe fn uninitialized < T > ( ) -> T {
141
+ intrinsics:: uninit ( )
142
+ }
143
+
144
+ /// Deprecated, use `uninitialized` instead.
145
+ #[ inline]
146
+ #[ deprecated = "this function has been renamed to `uninitialized`" ]
140
147
pub unsafe fn uninit < T > ( ) -> T {
141
148
intrinsics:: uninit ( )
142
149
}
@@ -148,7 +155,7 @@ pub unsafe fn uninit<T>() -> T {
148
155
/// contained at the location `dst`. This could leak allocations or resources,
149
156
/// so care must be taken to previously deallocate the value at `dst`.
150
157
#[ inline]
151
- #[ unstable = "the name of this function is subject to change" ]
158
+ #[ stable ]
152
159
pub unsafe fn overwrite < T > ( dst : * mut T , src : T ) {
153
160
intrinsics:: move_val_init ( & mut * dst, src)
154
161
}
@@ -315,7 +322,7 @@ pub fn from_be64(x: u64) -> u64 { x }
315
322
pub fn swap < T > ( x : & mut T , y : & mut T ) {
316
323
unsafe {
317
324
// Give ourselves some scratch space to work with
318
- let mut t: T = uninit ( ) ;
325
+ let mut t: T = uninitialized ( ) ;
319
326
320
327
// Perform the swap, `&mut` pointers never alias
321
328
ptr:: copy_nonoverlapping_memory ( & mut t, & * x, 1 ) ;
0 commit comments