mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-02-08 21:35:47 +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`
|
// FIXME(rust-lang/rust#65991): The `db` argument *should* have the type `dyn Database`
|
||||||
$Db: ?Sized + $zalsa::Database,
|
$Db: ?Sized + $zalsa::Database,
|
||||||
{
|
{
|
||||||
let runtime = db.runtime();
|
let fields = $Configuration::ingredient(db.as_salsa_database()).field(
|
||||||
let fields = $Configuration::ingredient(db.as_salsa_database()).field(runtime, self, $field_index);
|
db.as_salsa_database(),
|
||||||
|
self,
|
||||||
|
$field_index,
|
||||||
|
);
|
||||||
$zalsa::maybe_clone!(
|
$zalsa::maybe_clone!(
|
||||||
$field_option,
|
$field_option,
|
||||||
$field_ty,
|
$field_ty,
|
||||||
|
|
|
@ -150,7 +150,7 @@ impl<C: Configuration> IngredientImpl<C> {
|
||||||
/// The caller is responible for selecting the appropriate element.
|
/// The caller is responible for selecting the appropriate element.
|
||||||
pub fn field<'db>(
|
pub fn field<'db>(
|
||||||
&'db self,
|
&'db self,
|
||||||
runtime: &'db Runtime,
|
db: &'db dyn crate::Database,
|
||||||
id: C::Struct,
|
id: C::Struct,
|
||||||
field_index: usize,
|
field_index: usize,
|
||||||
) -> &'db C::Fields {
|
) -> &'db C::Fields {
|
||||||
|
@ -158,7 +158,7 @@ impl<C: Configuration> IngredientImpl<C> {
|
||||||
let id = id.as_id();
|
let id = id.as_id();
|
||||||
let value = self.struct_map.get(id);
|
let value = self.struct_map.get(id);
|
||||||
let stamp = &value.stamps[field_index];
|
let stamp = &value.stamps[field_index];
|
||||||
runtime.report_tracked_read(
|
db.runtime().report_tracked_read(
|
||||||
DependencyIndex {
|
DependencyIndex {
|
||||||
ingredient_index: field_ingredient_index,
|
ingredient_index: field_ingredient_index,
|
||||||
key_index: Some(id),
|
key_index: Some(id),
|
||||||
|
|
Loading…
Reference in a new issue