mirror of
https://github.com/Noratrieb/stuff.git
synced 2026-01-14 16:35:08 +01:00
relax S: StuffingStrategy<B> bound on type
This commit is contained in:
parent
c54e5531aa
commit
f0fae6c7cf
1 changed files with 2 additions and 3 deletions
|
|
@ -124,7 +124,6 @@ pub use crate::{backend::Backend, strategy::StuffingStrategy};
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
pub struct StuffedPtr<T, S, B = usize>(B::Stored, PhantomData<S>)
|
pub struct StuffedPtr<T, S, B = usize>(B::Stored, PhantomData<S>)
|
||||||
where
|
where
|
||||||
S: StuffingStrategy<B>,
|
|
||||||
B: Backend<T>;
|
B: Backend<T>;
|
||||||
|
|
||||||
impl<T, S, B> StuffedPtr<T, S, B>
|
impl<T, S, B> StuffedPtr<T, S, B>
|
||||||
|
|
@ -165,8 +164,8 @@ where
|
||||||
/// # Safety
|
/// # Safety
|
||||||
/// `StuffedPtr` must contain pointer data and not `other` data
|
/// `StuffedPtr` must contain pointer data and not `other` data
|
||||||
pub unsafe fn get_ptr_unchecked(&self) -> *mut T {
|
pub unsafe fn get_ptr_unchecked(&self) -> *mut T {
|
||||||
let (provenance, addr) = B::get_ptr(self.0);
|
let (provenance, stored) = B::get_ptr(self.0);
|
||||||
let addr = S::extract_ptr(addr);
|
let addr = S::extract_ptr(stored);
|
||||||
Strict::with_addr(provenance, addr)
|
Strict::with_addr(provenance, addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue