diff options
| author | bors <bors@rust-lang.org> | 2016-03-31 17:52:25 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-03-31 17:52:25 -0700 |
| commit | a2f0cc6b0c63b85c9f550410178dbff4912a56bc (patch) | |
| tree | 028deae377519ed4e238bafea4f66a7b80c538ca | |
| parent | e1195c24bb567019d7cdc65bf5a4c642e38475d1 (diff) | |
| parent | 4ddbd6b5b0f356eae0ec4ba5fcea277885da7528 (diff) | |
| download | rust-a2f0cc6b0c63b85c9f550410178dbff4912a56bc.tar.gz rust-a2f0cc6b0c63b85c9f550410178dbff4912a56bc.zip | |
Auto merge of #32550 - tbu-:pr_ref_cell_as_unsafe_cell, r=alexcrichton
Remove `unsafe` qualifier from `RefCell::as_unsafe_cell` This method is no longer unsafe because the field of `UnsafeCell` is no longer public.
| -rw-r--r-- | src/libcore/cell.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index fdd2e3a1784..4a9a1485063 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -216,10 +216,6 @@ impl<T:Copy> Cell<T> { /// Returns a reference to the underlying `UnsafeCell`. /// - /// # Safety - /// - /// This function is `unsafe` because `UnsafeCell`'s field is public. - /// /// # Examples /// /// ``` @@ -229,11 +225,11 @@ impl<T:Copy> Cell<T> { /// /// let c = Cell::new(5); /// - /// let uc = unsafe { c.as_unsafe_cell() }; + /// let uc = c.as_unsafe_cell(); /// ``` #[inline] #[unstable(feature = "as_unsafe_cell", issue = "27708")] - pub unsafe fn as_unsafe_cell(&self) -> &UnsafeCell<T> { + pub fn as_unsafe_cell(&self) -> &UnsafeCell<T> { &self.value } } |
