You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A tracked trait impl give inner_fn_name_ as ingredient debug name. We should pick the name of the original trait impl, not the InnerTrait trait impl generated by salsa::tracked macro.
#[salsa::db]structDatabase;#[salsa::db]impl salsa::DatabaseforDatabase{fnsalsa_event(&self,event:&dynFn() -> salsa::Event){let event = event();iflet salsa::EventKind::WillExecute{ database_key } = event.kind{dbg!(self.ingredient_debug_name(database_key.ingredient_index()));}}}/// Given a tracked trait impl (which is implemented for some tracked input or tracked struct).#[salsa::tracked]implMyTraitforMyStruct{#[salsa::tracked]fnparse(self,db:&dyn salsa::Database) -> Something<'_>{// impl}}/// EXPANDED////// The macro generate this InnerTrait code, which take over `parse`,/// when resolving the ingredient_debug_name./// All tracked trait impl result in this uninformative `inner_fn_name_`./// `<MyStruct as MyTrait>::parse` would be the best possible debug name output,/// or `parse` or `MyTrait::parse`, but that would make it harder to distinguish multiple trait implementors.traitInnerTrait_{fninner_fn_name_(self,db:&dyn salsa::Database) -> Something<'_>;}implInnerTrait_forSourceFile{fninner_fn_name_(self,db:&dyn salsa::Database) -> Something<'_>{// impl}}
The text was updated successfully, but these errors were encountered:
I can implement this, but its a little bit hacky due to absent of ToString on syn::Type. Only way i could see is to take impl.ty.span().source_text() and normalize it somehow and the same for impl.self_ty. Idk if its ok
A tracked trait impl give
inner_fn_name_
as ingredient debug name. We should pick the name of the original trait impl, not theInnerTrait
trait impl generated bysalsa::tracked
macro.The text was updated successfully, but these errors were encountered: