Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4fac5c9

Browse files
committedMar 31, 2019
Auto merge of #59590 - Centril:rollup, r=Centril
Rollup of 7 pull requests Successful merges: - #58805 (Lint for redundant imports) - #59506 (Use platform dependent mcount function) - #59519 (rustc_target: factor out common fields of non-Single Variants.) - #59580 (Allow closure to unsafe fn coercion) - #59581 (Stabilize refcell_replace_swap feature) - #59583 (match match match match match) - #59587 (Remove #[doc(hidden)] from Error::type_id) Failed merges: r? @ghost
2 parents a89c03a + 3445445 commit 4fac5c9

File tree

110 files changed

+599
-251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+599
-251
lines changed
 

‎src/liballoc/borrow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl<T> ToOwned for T
135135
/// Another example showing how to keep `Cow` in a struct:
136136
///
137137
/// ```
138-
/// use std::borrow::{Cow, ToOwned};
138+
/// use std::borrow::Cow;
139139
///
140140
/// struct Items<'a, X: 'a> where [X]: ToOwned<Owned = Vec<X>> {
141141
/// values: Cow<'a, [X]>,

‎src/libcore/cell.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -702,24 +702,21 @@ impl<T> RefCell<T> {
702702
/// Replaces the wrapped value with a new one computed from `f`, returning
703703
/// the old value, without deinitializing either one.
704704
///
705-
/// This function corresponds to [`std::mem::replace`](../mem/fn.replace.html).
706-
///
707705
/// # Panics
708706
///
709707
/// Panics if the value is currently borrowed.
710708
///
711709
/// # Examples
712710
///
713711
/// ```
714-
/// #![feature(refcell_replace_swap)]
715712
/// use std::cell::RefCell;
716713
/// let cell = RefCell::new(5);
717714
/// let old_value = cell.replace_with(|&mut old| old + 1);
718715
/// assert_eq!(old_value, 5);
719716
/// assert_eq!(cell, RefCell::new(6));
720717
/// ```
721718
#[inline]
722-
#[unstable(feature = "refcell_replace_swap", issue="43570")]
719+
#[stable(feature = "refcell_replace_swap", since="1.35.0")]
723720
pub fn replace_with<F: FnOnce(&mut T) -> T>(&self, f: F) -> T {
724721
let mut_borrow = &mut *self.borrow_mut();
725722
let replacement = f(mut_borrow);
@@ -1421,7 +1418,6 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
14211418
///
14221419
/// ```
14231420
/// use std::cell::UnsafeCell;
1424-
/// use std::marker::Sync;
14251421
///
14261422
/// # #[allow(dead_code)]
14271423
/// struct NotThreadSafe<T> {

0 commit comments

Comments
 (0)
Please sign in to comment.