Skip to content

Commit

Permalink
Post merge changes to #27488
Browse files Browse the repository at this point in the history
  • Loading branch information
nagisa committed Aug 3, 2015
1 parent 76ba3f0 commit c5d8779
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/libcore/mem.rs
Expand Up @@ -322,20 +322,16 @@ pub unsafe fn dropped<T>() -> T {
/// println!("{:?}", &data[0]);
/// ```
///
/// Hopefully this example emphasizes to you exactly how delicate
/// and dangerous doing this is. Note that the `vec!` macro
/// *does* let you initialize every element with a value that
/// is only `Clone`, so the following is equivalent and vastly
/// less dangerous, as long as you can live with an extra heap
/// This example emphasizes exactly how delicate and dangerous doing this is.
/// Note that the `vec!` macro *does* let you initialize every element with a
/// value that is only `Clone`, so the following is semantically equivalent and
/// vastly less dangerous, as long as you can live with an extra heap
/// allocation:
///
/// ```
/// let data: Vec<Vec<u32>> = vec![Vec::new(); 1000];
/// println!("{:?}", &data[0]);
/// ```
///
/// For large arrays this is probably advisable
/// anyway to avoid blowing the stack.
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub unsafe fn uninitialized<T>() -> T {
Expand Down

0 comments on commit c5d8779

Please sign in to comment.