diff options
| author | Tobias Bucher <tobiasbucher5991@gmail.com> | 2016-03-28 15:29:15 +0200 |
|---|---|---|
| committer | Tobias Bucher <tobiasbucher5991@gmail.com> | 2016-03-28 15:29:15 +0200 |
| commit | 4ddbd6b5b0f356eae0ec4ba5fcea277885da7528 (patch) | |
| tree | 7085c3e29b638f719d213b4fe824ca33f2605197 | |
| parent | f738dc1fe4e0f70769b3265fb9f985340659ac34 (diff) | |
| download | rust-4ddbd6b5b0f356eae0ec4ba5fcea277885da7528.tar.gz rust-4ddbd6b5b0f356eae0ec4ba5fcea277885da7528.zip | |
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 } } |
