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.
2 parents f164109 + 104fa4f commit a3fb8b8Copy full SHA for a3fb8b8
rust/kernel/types.rs
@@ -144,6 +144,19 @@ impl<T> PointerWrapper for *mut T {
144
}
145
146
147
+impl PointerWrapper for () {
148
+ type Borrowed<'a> = ();
149
+
150
+ fn into_pointer(self) -> *const c_types::c_void {
151
+ // We use 1 to be different from a null pointer.
152
+ 1usize as _
153
+ }
154
155
+ unsafe fn borrow<'a>(_: *const c_types::c_void) -> Self::Borrowed<'a> {}
156
157
+ unsafe fn from_pointer(_: *const c_types::c_void) -> Self {}
158
+}
159
160
/// Runs a cleanup function/closure when dropped.
161
///
162
/// The [`ScopeGuard::dismiss`] function prevents the cleanup function from running.
0 commit comments