Skip to content

Commit 2dedc84

Browse files
committed
Merge pull request #19902 from alexcrichton/second-pass-mem
std: Second-pass stabilization of `mem`/`default` Reviewed-by: aturon
2 parents fde2e33 + 9021f61 commit 2dedc84

File tree

30 files changed

+68
-6
lines changed

30 files changed

+68
-6
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
@@ -832,7 +832,9 @@ impl<S: Writer, K: Hash<S>, V: Hash<S>> Hash<S> for BTreeMap<K, V> {
832832
}
833833
}
834834

835+
#[stable]
835836
impl<K: Ord, V> Default for BTreeMap<K, V> {
837+
#[stable]
836838
fn default() -> BTreeMap<K, V> {
837839
BTreeMap::new()
838840
}

src/libcollections/btree/set.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,9 @@ impl<T: Ord> Extend<T> for BTreeSet<T> {
439439
}
440440
}
441441

442+
#[stable]
442443
impl<T: Ord> Default for BTreeSet<T> {
444+
#[stable]
443445
fn default() -> BTreeSet<T> {
444446
BTreeSet::new()
445447
}

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)