We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
unsafe
RefCell::as_unsafe_cell
1 parent f738dc1 commit 4ddbd6bCopy full SHA for 4ddbd6b
src/libcore/cell.rs
@@ -216,10 +216,6 @@ impl<T:Copy> Cell<T> {
216
217
/// Returns a reference to the underlying `UnsafeCell`.
218
///
219
- /// # Safety
220
- ///
221
- /// This function is `unsafe` because `UnsafeCell`'s field is public.
222
223
/// # Examples
224
225
/// ```
@@ -229,11 +225,11 @@ impl<T:Copy> Cell<T> {
229
230
226
/// let c = Cell::new(5);
231
227
232
- /// let uc = unsafe { c.as_unsafe_cell() };
228
+ /// let uc = c.as_unsafe_cell();
233
234
#[inline]
235
#[unstable(feature = "as_unsafe_cell", issue = "27708")]
236
- pub unsafe fn as_unsafe_cell(&self) -> &UnsafeCell<T> {
+ pub fn as_unsafe_cell(&self) -> &UnsafeCell<T> {
237
&self.value
238
}
239
0 commit comments