Skip to content

Commit 41881e8

Browse files
committed
Documentation for default types modified
1 parent 49e77db commit 41881e8

File tree

13 files changed

+12
-15
lines changed

13 files changed

+12
-15
lines changed

src/liballoc/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ impl<T: ?Sized> Clone for Weak<T> {
718718

719719
#[stable(feature = "downgraded_weak", since = "1.10.0")]
720720
impl<T> Default for Weak<T> {
721-
/// Creates a new `Weak<T>`.
721+
/// Constructs a new `Weak<T>` without an accompanying instance of T.
722722
fn default() -> Weak<T> {
723723
Weak::new()
724724
}

src/libcollections/borrow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ impl<'a, B: ?Sized> Default for Cow<'a, B>
249249
where B: ToOwned,
250250
<B as ToOwned>::Owned: Default
251251
{
252-
/// Creates a `Cow<'a, B>` pointer.
252+
/// Creates an owned Cow<'a, B> with the default value for the contained owned value.
253253
fn default() -> Cow<'a, B> {
254254
Owned(<B as ToOwned>::Owned::default())
255255
}

src/libcollections/btree/set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ impl<'a, T: 'a + Ord + Copy> Extend<&'a T> for BTreeSet<T> {
674674

675675
#[stable(feature = "rust1", since = "1.0.0")]
676676
impl<T: Ord> Default for BTreeSet<T> {
677-
/// Creates a new `BTreeSet<T>`.
677+
/// Makes a empty `BTreeSet<T>` with a reasonable choice of B.
678678
fn default() -> BTreeSet<T> {
679679
BTreeSet::new()
680680
}

src/libcollections/vec_deque.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl<T> Drop for VecDeque<T> {
8484

8585
#[stable(feature = "rust1", since = "1.0.0")]
8686
impl<T> Default for VecDeque<T> {
87-
/// Creates a `VecDeque<T>` with a constant initial capacity.
87+
/// Creates an empty `VecDeque<T>`.
8888
#[inline]
8989
fn default() -> VecDeque<T> {
9090
VecDeque::new()

src/libcore/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ fn expect_failed(msg: &str) -> ! {
698698

699699
#[stable(feature = "rust1", since = "1.0.0")]
700700
impl<T> Default for Option<T> {
701-
/// Creates an instance of None.
701+
/// Returns None.
702702
#[inline]
703703
fn default() -> Option<T> { None }
704704
}

src/libcore/slice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,13 +755,13 @@ impl<T> ops::IndexMut<ops::RangeToInclusive<usize>> for [T] {
755755

756756
#[stable(feature = "rust1", since = "1.0.0")]
757757
impl<'a, T> Default for &'a [T] {
758-
/// Creates an empty Slice.
758+
/// Creates an empty slice.
759759
fn default() -> &'a [T] { &[] }
760760
}
761761

762762
#[stable(feature = "mut_slice_default", since = "1.5.0")]
763763
impl<'a, T> Default for &'a mut [T] {
764-
/// Creates a mutable empty Slice.
764+
/// Creates a mutable empty slice.
765765
fn default() -> &'a mut [T] { &mut [] }
766766
}
767767

src/libcore/sync/atomic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ pub struct AtomicPtr<T> {
118118
#[cfg(target_has_atomic = "ptr")]
119119
#[stable(feature = "rust1", since = "1.0.0")]
120120
impl<T> Default for AtomicPtr<T> {
121-
/// Creates an `AtomicPtr<T>` with an initial mutable null pointer.
121+
/// Creates a null `AtomicPtr<T>`.
122122
fn default() -> AtomicPtr<T> {
123123
AtomicPtr::new(::ptr::null_mut())
124124
}

src/libcoretest/hash/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ struct MyHasher {
1818
}
1919

2020
impl Default for MyHasher {
21-
/// Constructs a `MyHasher` with initial value zero.
2221
fn default() -> MyHasher {
2322
MyHasher { hash: 0 }
2423
}
@@ -91,7 +90,6 @@ impl Hasher for CustomHasher {
9190
}
9291

9392
impl Default for CustomHasher {
94-
/// Constructs a `CustomHasher` with initial value zero.
9593
fn default() -> CustomHasher {
9694
CustomHasher { output: 0 }
9795
}

src/librustc/session/config.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ pub enum ErrorOutputType {
8484
}
8585

8686
impl Default for ErrorOutputType {
87-
/// Creates an `HumanReadble`, initialised with `ColorConfig` enum type `Auto`.
8887
fn default() -> ErrorOutputType {
8988
ErrorOutputType::HumanReadable(ColorConfig::Auto)
9089
}

src/libstd/collections/hash/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ impl<K, V, S> Default for HashMap<K, V, S>
12181218
where K: Eq + Hash,
12191219
S: BuildHasher + Default,
12201220
{
1221-
/// Creates a `HashMap<K, V, S>`, with initial `Default` hasher.
1221+
/// Creates an empty `HashMap<K, V, S>`, with the `Default` value for the hasher.
12221222
fn default() -> HashMap<K, V, S> {
12231223
HashMap::with_hasher(Default::default())
12241224
}

src/libstd/collections/hash/set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ impl<T, S> Default for HashSet<T, S>
665665
where T: Eq + Hash,
666666
S: BuildHasher + Default,
667667
{
668-
/// Creates a `HashSet<T, S>` with initial `Default` hasher.
668+
/// Creates an empty `HashSet<T, S>` with the `Default` value for the hasher.
669669
fn default() -> HashSet<T, S> {
670670
HashSet::with_hasher(Default::default())
671671
}

src/libstd/ffi/c_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ impl<'a> Default for &'a CStr {
339339

340340
#[stable(feature = "cstr_default", since = "1.10.0")]
341341
impl Default for CString {
342-
/// Creates a new `CString`, by calling the `Default` of `CStr`, and then owns it.
342+
/// Creates an empty `CString`.
343343
fn default() -> CString {
344344
let a: &CStr = Default::default();
345345
a.to_owned()

src/libsyntax/ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl<T> P<[T]> {
154154
}
155155

156156
impl<T> Default for P<[T]> {
157-
/// Creates a new `P`, with the `Default` value for T.
157+
/// Creates an empty `P<[T]>`.
158158
fn default() -> P<[T]> {
159159
P::new()
160160
}

0 commit comments

Comments
 (0)