Post merge changes to #27488

This commit is contained in:
Simonas Kazlauskas
2015-08-03 21:52:20 +03:00
parent 76ba3f0dd9
commit c5d877977a

View File

@@ -322,20 +322,16 @@ pub unsafe fn dropped<T>() -> T {
/// println!("{:?}", &data[0]); /// println!("{:?}", &data[0]);
/// ``` /// ```
/// ///
/// Hopefully this example emphasizes to you exactly how delicate /// This example emphasizes exactly how delicate and dangerous doing this is.
/// and dangerous doing this is. Note that the `vec!` macro /// Note that the `vec!` macro *does* let you initialize every element with a
/// *does* let you initialize every element with a value that /// value that is only `Clone`, so the following is semantically equivalent and
/// is only `Clone`, so the following is equivalent and vastly /// vastly less dangerous, as long as you can live with an extra heap
/// less dangerous, as long as you can live with an extra heap
/// allocation: /// allocation:
/// ///
/// ``` /// ```
/// let data: Vec<Vec<u32>> = vec![Vec::new(); 1000]; /// let data: Vec<Vec<u32>> = vec![Vec::new(); 1000];
/// println!("{:?}", &data[0]); /// println!("{:?}", &data[0]);
/// ``` /// ```
///
/// For large arrays this is probably advisable
/// anyway to avoid blowing the stack.
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub unsafe fn uninitialized<T>() -> T { pub unsafe fn uninitialized<T>() -> T {