From a3905646c6a06cf80faadff8a93eadb103440f34 Mon Sep 17 00:00:00 2001 From: Matthew Piziak Date: Fri, 9 Sep 2016 11:53:23 -0400 Subject: [PATCH] add `default` docstrings for `String` and `AtomicBool` Part of https://github.com/rust-lang/rust/issues/36265. These are all the instances of `Default` in this repository that are of the form `impl Default for X`. The default for `i32`, for example, is not of this form. @GuillaumeGomez --- src/libcollections/string.rs | 1 + src/libcore/sync/atomic.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 3a304c6292930..4ea8c565169c9 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -1567,6 +1567,7 @@ impl_eq! { Cow<'a, str>, String } #[stable(feature = "rust1", since = "1.0.0")] impl Default for String { + /// Create an empty `String`. #[inline] fn default() -> String { String::new() diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index 75ddd2021a8f7..3c10c5431c23c 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -95,6 +95,7 @@ pub struct AtomicBool { #[cfg(target_has_atomic = "8")] #[stable(feature = "rust1", since = "1.0.0")] impl Default for AtomicBool { + /// Create an `AtomicBool` initialized to `false`. fn default() -> Self { Self::new(false) }