Documentation of what does for each type

This commit is contained in:
athulappadan
2016-09-11 17:00:09 +05:30
parent 1fca1ab0e7
commit 49e77dbf25
32 changed files with 41 additions and 0 deletions

View File

@@ -718,6 +718,7 @@ impl<T: ?Sized> Clone for Weak<T> {
#[stable(feature = "downgraded_weak", since = "1.10.0")]
impl<T> Default for Weak<T> {
/// Creates a new `Weak<T>`.
fn default() -> Weak<T> {
Weak::new()
}
@@ -923,6 +924,7 @@ impl<T: ?Sized> fmt::Pointer for Arc<T> {
#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Default> Default for Arc<T> {
/// Creates a new `Arc<T>`, with the `Default` value for T.
fn default() -> Arc<T> {
Arc::new(Default::default())
}

View File

@@ -290,6 +290,7 @@ impl<T: ?Sized> Box<T> {
#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Default> Default for Box<T> {
/// Creates a `Box<T>`, with the `Default` value for T.
fn default() -> Box<T> {
box Default::default()
}

View File

@@ -870,6 +870,7 @@ impl<T: ?Sized + fmt::Debug> fmt::Debug for Weak<T> {
#[stable(feature = "downgraded_weak", since = "1.10.0")]
impl<T> Default for Weak<T> {
/// Creates a new `Weak<T>`.
fn default() -> Weak<T> {
Weak::new()
}