about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2016-09-14 17:15:37 +0200
committerGitHub <noreply@github.com>2016-09-14 17:15:37 +0200
commita89690ec00ca98397183c3ef011f944448098f8b (patch)
tree223b94f42aed89fbfb7fd84a474cf2bb64b45694 /src/liballoc
parent4476b7b43b2826b6f0e71f4638159f8718c0a440 (diff)
parent5798003438469313c0616270b8b285d9afbb4730 (diff)
downloadrust-a89690ec00ca98397183c3ef011f944448098f8b.tar.gz
rust-a89690ec00ca98397183c3ef011f944448098f8b.zip
Rollup merge of #36396 - athulappadan:Default-docs, r=bluss
Documentation of what Default does for each type

Addresses #36265
I haven't changed the following types due to doubts:

1)src/libstd/ffi/c_str.rs
2)src/libcore/iter/sources.rs
3)src/libcore/hash/mod.rs
4)src/libcore/hash/mod.rs
5)src/librustc/middle/privacy.rs

r? @steveklabnik
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/arc.rs2
-rw-r--r--src/liballoc/boxed.rs1
-rw-r--r--src/liballoc/rc.rs1
3 files changed, 4 insertions, 0 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index b54b71cabd1..3d579641b96 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -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> {
+    /// Constructs a new `Weak<T>` without an accompanying instance of 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())
     }
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs
index 70c429cc360..bc9b6e805ef 100644
--- a/src/liballoc/boxed.rs
+++ b/src/liballoc/boxed.rs
@@ -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()
     }
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs
index c24c7ca47ad..dadddbc2cb3 100644
--- a/src/liballoc/rc.rs
+++ b/src/liballoc/rc.rs
@@ -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()
     }