make input::fields take Database not Runtime

This commit is contained in:
Niko Matsakis 2024-07-23 06:09:28 -04:00
parent f466228da5
commit 53ccfa3fc3
2 changed files with 7 additions and 4 deletions

View file

@ -137,8 +137,11 @@ macro_rules! setup_input_struct {
// FIXME(rust-lang/rust#65991): The `db` argument *should* have the type `dyn Database`
$Db: ?Sized + $zalsa::Database,
{
let runtime = db.runtime();
let fields = $Configuration::ingredient(db.as_salsa_database()).field(runtime, self, $field_index);
let fields = $Configuration::ingredient(db.as_salsa_database()).field(
db.as_salsa_database(),
self,
$field_index,
);
$zalsa::maybe_clone!(
$field_option,
$field_ty,

View file

@ -150,7 +150,7 @@ impl<C: Configuration> IngredientImpl<C> {
/// The caller is responible for selecting the appropriate element.
pub fn field<'db>(
&'db self,
runtime: &'db Runtime,
db: &'db dyn crate::Database,
id: C::Struct,
field_index: usize,
) -> &'db C::Fields {
@ -158,7 +158,7 @@ impl<C: Configuration> IngredientImpl<C> {
let id = id.as_id();
let value = self.struct_map.get(id);
let stamp = &value.stamps[field_index];
runtime.report_tracked_read(
db.runtime().report_tracked_read(
DependencyIndex {
ingredient_index: field_ingredient_index,
key_index: Some(id),