summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/utils.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/rustix/src/utils.rs')
-rw-r--r--vendor/rustix/src/utils.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/vendor/rustix/src/utils.rs b/vendor/rustix/src/utils.rs
new file mode 100644
index 000000000..efbbe81aa
--- /dev/null
+++ b/vendor/rustix/src/utils.rs
@@ -0,0 +1,13 @@
+/// Convert a `&T` into a `*const T` without using an `as`.
+#[inline]
+#[allow(dead_code)]
+pub(crate) const fn as_ptr<T>(t: &T) -> *const T {
+ t
+}
+
+/// Convert a `&mut T` into a `*mut T` without using an `as`.
+#[inline]
+#[allow(dead_code)]
+pub(crate) fn as_mut_ptr<T>(t: &mut T) -> *mut T {
+ t
+}