mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-08-04 11:00:05 +00:00
Mark Slot
trait as unsafe
This commit is contained in:
parent
27047696c2
commit
b387b0fefa
4 changed files with 11 additions and 4 deletions
|
@ -290,7 +290,8 @@ pub trait HasBuilder {
|
|||
type Builder;
|
||||
}
|
||||
|
||||
impl<C> Slot for Value<C>
|
||||
// SAFETY: `Value<C>` is our private type branded over the unique configuration `C`.
|
||||
unsafe impl<C> Slot for Value<C>
|
||||
where
|
||||
C: Configuration,
|
||||
{
|
||||
|
|
|
@ -843,7 +843,8 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<C> Slot for Value<C>
|
||||
// SAFETY: `Value<C>` is our private type branded over the unique configuration `C`.
|
||||
unsafe impl<C> Slot for Value<C>
|
||||
where
|
||||
C: Configuration,
|
||||
{
|
||||
|
|
|
@ -30,7 +30,11 @@ pub struct Table {
|
|||
non_full_pages: Mutex<FxHashMap<IngredientIndex, Vec<PageIndex>>>,
|
||||
}
|
||||
|
||||
pub(crate) trait Slot: Any + Send + Sync {
|
||||
/// # Safety
|
||||
///
|
||||
/// Implementors of this trait need to make sure that their type is unique with respect to
|
||||
/// their owning ingredient as the allocation strategy relies on this.
|
||||
pub(crate) unsafe trait Slot: Any + Send + Sync {
|
||||
/// Access the [`MemoTable`][] for this slot.
|
||||
///
|
||||
/// # Safety condition
|
||||
|
|
|
@ -912,7 +912,8 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<C> Slot for Value<C>
|
||||
// SAFETY: `Value<C>` is our private type branded over the unique configuration `C`.
|
||||
unsafe impl<C> Slot for Value<C>
|
||||
where
|
||||
C: Configuration,
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue