From 78d78942667190ac1f576904512a955de31f5e71 Mon Sep 17 00:00:00 2001 From: zjp Date: Mon, 22 Aug 2022 10:10:57 +0800 Subject: [PATCH] fix(fmt_index): impl for InternedIngredient --- components/salsa-2022/src/interned.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/salsa-2022/src/interned.rs b/components/salsa-2022/src/interned.rs index e6bd7f6e..28119a9a 100644 --- a/components/salsa-2022/src/interned.rs +++ b/components/salsa-2022/src/interned.rs @@ -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 { /// `&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>, + + debug_name: &'static str, } impl InternedIngredient @@ -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, - _fmt: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - todo!() + fn fmt_index(&self, index: Option, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt_index(self.debug_name, index, fmt) } }