From c52472a8743859ff13a84d860eefd4b836aba748 Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Wed, 6 Apr 2022 19:38:40 +0200 Subject: [PATCH] lower msrv to 1.31.1 edition 2015 is behind that, I won't touch that --- Cargo.toml | 2 +- src/backend.rs | 4 ++-- src/lib.rs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5fecba0..e4a3068 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" keywords = ["unsafe", "pointer", "bitpacking", "provenance", "tagging"] categories = ["data-structures", "memory-management", "no-std"] include = ["Cargo.toml", "LICENSE", "src", "README.md"] -rust-version = "1.32.0" +rust-version = "1.31.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/backend.rs b/src/backend.rs index 7165f91..a4d15f1 100644 --- a/src/backend.rs +++ b/src/backend.rs @@ -87,7 +87,7 @@ unsafe impl Backend for u64 { } macro_rules! impl_backend_2_tuple { - (impl for $ty:ty { (*mut T, $int:ident), $num:literal }) => { + (impl for $ty:ty { (*mut T, $int:ident), $num:expr }) => { unsafe impl Backend for $ty { // this one keeps the MSB in the pointer address, and the LSB in the integer @@ -114,7 +114,7 @@ macro_rules! impl_backend_2_tuple { /// num1 is ptr-sized, num2 is 2*ptr sized #[cfg_attr(target_pointer_width = "64", allow(unused))] // not required on 64 bit macro_rules! impl_backend_3_tuple { - (impl for $ty:ty { (*mut T, $int1:ident, $int2:ident), $num1:literal, $num2:literal }) => { + (impl for $ty:ty { (*mut T, $int1:ident, $int2:ident), $num1:expr, $num2:expr }) => { unsafe impl Backend for $ty { // this one keeps the MSB in the pointer address, ISB in int1 and the LSB in the int2 diff --git a/src/lib.rs b/src/lib.rs index d5dcd13..6f28b1f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -131,7 +131,7 @@ where pub fn new_ptr(ptr: *mut T) -> Self { let addr = Strict::addr(ptr); let stuffed = S::stuff_ptr(addr); - Self(B::set_ptr(ptr, stuffed), PhantomData) + StuffedPtr(B::set_ptr(ptr, stuffed), PhantomData) } /// Create a new `StuffPtr` from extra data @@ -140,7 +140,7 @@ where // if the user calls `set_ptr` it will use the new provenance from that ptr let ptr = core::ptr::null_mut(); let extra = S::stuff_extra(extra); - Self(B::set_ptr(ptr, extra), PhantomData) + StuffedPtr(B::set_ptr(ptr, extra), PhantomData) } /// Get the pointer data, or `None` if it contains extra data @@ -280,7 +280,7 @@ where Self::new_extra(cloned_extra) } else { // just copy the pointer - Self(self.0, PhantomData) + StuffedPtr(self.0, PhantomData) } } }