Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize Cell::from_mut and as_slice_of_cells #61620

Merged
merged 1 commit into from
Jun 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/libcore/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,6 @@ impl<T: ?Sized> Cell<T> {
/// # Examples
///
/// ```
/// #![feature(as_cell)]
/// use std::cell::Cell;
///
/// let slice: &mut [i32] = &mut [1, 2, 3];
Expand All @@ -504,7 +503,7 @@ impl<T: ?Sized> Cell<T> {
/// assert_eq!(slice_cell.len(), 3);
/// ```
#[inline]
#[unstable(feature = "as_cell", issue="43038")]
#[stable(feature = "as_cell", since = "1.37.0")]
pub fn from_mut(t: &mut T) -> &Cell<T> {
unsafe {
&*(t as *mut T as *const Cell<T>)
Expand Down Expand Up @@ -541,7 +540,6 @@ impl<T> Cell<[T]> {
/// # Examples
///
/// ```
/// #![feature(as_cell)]
/// use std::cell::Cell;
///
/// let slice: &mut [i32] = &mut [1, 2, 3];
Expand All @@ -550,7 +548,7 @@ impl<T> Cell<[T]> {
///
/// assert_eq!(slice_cell.len(), 3);
/// ```
#[unstable(feature = "as_cell", issue="43038")]
#[stable(feature = "as_cell", since = "1.37.0")]
pub fn as_slice_of_cells(&self) -> &[Cell<T>] {
unsafe {
&*(self as *const Cell<[T]> as *const [Cell<T>])
Expand Down
1 change: 0 additions & 1 deletion src/test/run-pass/rfcs/rfc-1789-as-cell/from-mut.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// run-pass
#![feature(as_cell)]

use std::cell::Cell;

Expand Down