fix(fmt_index): impl for InternedIngredient

This commit is contained in:
zjp 2022-08-22 10:10:57 +08:00
parent af747c1aca
commit 78d7894266

View file

@ -1,11 +1,12 @@
use crossbeam::atomic::AtomicCell;
use crossbeam::queue::SegQueue;
use std::fmt;
use std::hash::Hash;
use std::marker::PhantomData;
use crate::durability::Durability;
use crate::id::AsId;
use crate::ingredient::IngredientRequiresReset;
use crate::ingredient::{fmt_index, IngredientRequiresReset};
use crate::key::DependencyIndex;
use crate::runtime::local_state::QueryOrigin;
use crate::runtime::Runtime;
@ -54,6 +55,8 @@ pub struct InternedIngredient<Id: InternedId, Data: InternedData> {
/// `&db` reference. This queue itself is not freed until we have an `&mut db` reference,
/// guaranteeing that there are no more references to it.
deleted_entries: SegQueue<Box<Data>>,
debug_name: &'static str,
}
impl<Id, Data> InternedIngredient<Id, Data>
@ -69,6 +72,7 @@ where
counter: AtomicCell::default(),
reset_at: Revision::start(),
deleted_entries: Default::default(),
debug_name: "InternedIngredient",
}
}
@ -235,12 +239,8 @@ where
panic!("unexpected call: interned ingredients do not register for salsa struct deletion events");
}
fn fmt_index(
&self,
_index: Option<crate::Id>,
_fmt: &mut std::fmt::Formatter<'_>,
) -> std::fmt::Result {
todo!()
fn fmt_index(&self, index: Option<crate::Id>, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt_index(self.debug_name, index, fmt)
}
}