Skip to content

Commit 9021f61

Browse files
committed
std: Second pass stabilization of default
This commit performs a second pass stabilization of the `std::default` module. The module was already marked `#[stable]`, and the inheritance of `#[stable]` was removed since this attribute was applied. This commit adds the `#[stable]` attribute to the trait definition and one method name, along with all implementations found in the standard distribution.
1 parent 23bae85 commit 9021f61

File tree

28 files changed

+57
-3
lines changed

28 files changed

+57
-3
lines changed

src/liballoc/arc.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,9 @@ impl<T: fmt::Show> fmt::Show for Arc<T> {
316316
}
317317
}
318318

319+
#[stable]
319320
impl<T: Default + Sync + Send> Default for Arc<T> {
321+
#[stable]
320322
fn default() -> Arc<T> { Arc::new(Default::default()) }
321323
}
322324

src/liballoc/boxed.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,15 @@ pub static HEAP: () = ();
4444
#[unstable = "custom allocators will add an additional type parameter (with default)"]
4545
pub struct Box<T>(*mut T);
4646

47+
#[stable]
4748
impl<T: Default> Default for Box<T> {
49+
#[stable]
4850
fn default() -> Box<T> { box Default::default() }
4951
}
5052

53+
#[stable]
5154
impl<T> Default for Box<[T]> {
55+
#[stable]
5256
fn default() -> Box<[T]> { box [] }
5357
}
5458

src/liballoc/rc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ impl<T: Default> Default for Rc<T> {
447447
/// let x: Rc<int> = Default::default();
448448
/// ```
449449
#[inline]
450+
#[stable]
450451
fn default() -> Rc<T> {
451452
Rc::new(Default::default())
452453
}

src/libcollections/binary_heap.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,10 @@ pub struct BinaryHeap<T> {
172172
data: Vec<T>,
173173
}
174174

175+
#[stable]
175176
impl<T: Ord> Default for BinaryHeap<T> {
176177
#[inline]
178+
#[stable]
177179
fn default() -> BinaryHeap<T> { BinaryHeap::new() }
178180
}
179181

src/libcollections/bit.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,10 @@ pub fn from_fn<F>(len: uint, mut f: F) -> Bitv where F: FnMut(uint) -> bool {
824824
bitv
825825
}
826826

827+
#[stable]
827828
impl Default for Bitv {
828829
#[inline]
830+
#[stable]
829831
fn default() -> Bitv { Bitv::new() }
830832
}
831833

src/libcollections/btree/map.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,9 @@ impl<S: Writer, K: Hash<S>, V: Hash<S>> Hash<S> for BTreeMap<K, V> {
836836
}
837837
}
838838

839+
#[stable]
839840
impl<K: Ord, V> Default for BTreeMap<K, V> {
841+
#[stable]
840842
fn default() -> BTreeMap<K, V> {
841843
BTreeMap::new()
842844
}

src/libcollections/btree/set.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,9 @@ impl<T: Ord> Extend<T> for BTreeSet<T> {
436436
}
437437
}
438438

439+
#[stable]
439440
impl<T: Ord> Default for BTreeSet<T> {
441+
#[stable]
440442
fn default() -> BTreeSet<T> {
441443
BTreeSet::new()
442444
}

src/libcollections/dlist.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,10 @@ impl<T> DList<T> {
192192
}
193193
}
194194

195+
#[stable]
195196
impl<T> Default for DList<T> {
196197
#[inline]
198+
#[stable]
197199
fn default() -> DList<T> { DList::new() }
198200
}
199201

src/libcollections/hash/sip.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,10 @@ impl Clone for SipState {
204204
}
205205
}
206206

207+
#[stable]
207208
impl Default for SipState {
208209
#[inline]
210+
#[stable]
209211
fn default() -> SipState {
210212
SipState::new()
211213
}

src/libcollections/ring_buf.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ impl<T> Drop for RingBuf<T> {
6868
}
6969
}
7070

71+
#[stable]
7172
impl<T> Default for RingBuf<T> {
73+
#[stable]
7274
#[inline]
7375
fn default() -> RingBuf<T> { RingBuf::new() }
7476
}

0 commit comments

Comments
 (0)