mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-22 21:05:11 +00:00
make input::fields take Database not Runtime
This commit is contained in:
parent
f466228da5
commit
53ccfa3fc3
2 changed files with 7 additions and 4 deletions
|
@ -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,
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue