We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a1d0c17 commit f8496ceCopy full SHA for f8496ce
rust/kernel/types.rs
@@ -492,15 +492,15 @@ impl<T: RefCounted> ARef<T> {
492
///
493
/// struct Empty {}
494
495
- /// # // SAFETY: TODO.
+ /// // SAFETY: We do not free anything.
496
/// unsafe impl RefCounted for Empty {
497
/// fn inc_ref(&self) {}
498
/// unsafe fn dec_ref(_obj: NonNull<Self>) {}
499
/// }
500
501
/// let mut data = Empty {};
502
/// let ptr = NonNull::<Empty>::new(&mut data).unwrap();
503
+ /// // SAFETY: We keep `data` around longer than the `ARef`.
504
/// let data_ref: ARef<Empty> = unsafe { ARef::from_raw(ptr) };
505
/// let raw_ptr: NonNull<Empty> = ARef::into_raw(data_ref);
506
0 commit comments