Commit graph

502 commits

Author SHA1 Message Date
Niko Matsakis
4d2ccffddc return to the database-wrapping-storage setup 2024-08-04 02:18:54 -04:00
Niko Matsakis
a675810edf move local-state into DatabaseImpl
Each clone gets an independent local state.
2024-07-28 12:47:50 +00:00
Niko Matsakis
138ca4b1f3 merge handle into the database
Separate handles are no longer needed.
2024-07-28 12:47:50 +00:00
Niko Matsakis
daaa78056a switch to new database design
Under this design, *all* databases are a
`DatabaseImpl<U>`, where the `U` implements
`UserData` (you can use `()` if there is none).

Code would default to `&dyn salsa::Database` but
if you want to give access to the userdata, you
can define a custom database trait
`MyDatabase: salsa::Databse` so long as you

* annotate `MyDatabase` trait definition of
  impls of `MyDatabase` with `#[salsa::db]`
* implement `MyDatabase` for `DatabaseImpl<U>`
  where `U` is your userdata (this could be a
  blanket impl, if you don't know the precise
  userdata type).

The `tests/common/mod.rs` shows the pattern.
2024-07-28 12:47:50 +00:00
Niko Matsakis
1842b1dfbb (almost) encansulate Runtime into Zalsa
The distinction is dumb and should go away.
But we still need it for a bit.
2024-07-28 12:35:33 +00:00
Niko Matsakis
596461c213 hide internal methods behind a Zalsa trait
The traits are now quite simple:

* Database is the external trait
* ZalsaDatabase is the internal one, implemented
  by `#[salsa::db]`. It adds two methods,
  `zalsa` and `zalsa_mut`. Those give access
  to our internal methods.

For now I've hidden the methods behind
`&dyn Zalsa`. This is nice and clean but it may
be worth later refactoring to a `struct Zalsa`.
2024-07-28 12:35:33 +00:00
Niko Matsakis
bc72bdf524 as_salsa_database => as_dyn_database
Also, move to a blanket impl'd trait.
Overall cleaner approach.
2024-07-28 12:35:33 +00:00
Niko Matsakis
9e8635c7db remove upcast_mut
We only ever need to upcast to shared references.

This change isn't necessary, just dead code
cleanup.
2024-07-28 12:35:33 +00:00
Niko Matsakis
21af3a2009 move local state into thread local 2024-07-23 21:45:31 -04:00
Niko Matsakis
74ef66dbb4 make tracked structs take db, not runtime 2024-07-23 11:54:55 -04:00
Niko Matsakis
782896772f make interner take database, not runtime 2024-07-23 11:54:55 -04:00
Niko Matsakis
53ccfa3fc3 make input::fields take Database not Runtime 2024-07-23 11:54:55 -04:00
Niko Matsakis
f466228da5 make accumulate take database instead of Runtime
We are going to want to take databases at
public entry points.
2024-07-23 11:54:55 -04:00
Micha Reiser
6975a47690
Replace derived Debug implementation of salsa::Id 2024-07-22 17:56:16 +02:00
Niko Matsakis
431fd14b69
Merge pull request #523 from MichaReiser/tracked-fn-interned
Some checks are pending
Book / Book (push) Waiting to run
Book / Deploy (push) Blocked by required conditions
Test / Test (false, beta) (push) Waiting to run
Test / Test (false, stable) (push) Waiting to run
Test / Test (true, nightly) (push) Waiting to run
Test / Miri (push) Waiting to run
Allow interned values as tracked function arguments
2024-07-22 10:54:46 +00:00
Micha Reiser
9ba36ebf7e
Allow interned values as tracked function arguments 2024-07-20 09:03:57 +02:00
Micha Reiser
ba169ef039
Respct no_eq attribute for tracked functions 2024-07-20 08:47:51 +02:00
Niko Matsakis
e8b467733f squelch most clippy warnings in generated code 2024-07-19 10:00:03 -04:00
Niko Matsakis
e847929536 pacify the merciless clippy 2024-07-19 09:20:41 -04:00
Niko Matsakis
ad61687e83 wip 2024-07-19 08:09:55 -04:00
Niko Matsakis
68a3a7fceb wip 2024-07-19 08:05:39 -04:00
Niko Matsakis
27f847545a cleanup getters/setters 2024-07-19 07:22:09 -04:00
Niko Matsakis
73a6aed554 wip privacy on interned 2024-07-19 07:14:57 -04:00
Niko Matsakis
fe90e68c8f wip privacy for tracked structs 2024-07-19 07:12:07 -04:00
Niko Matsakis
3304acc5dd wip: accum, privacy for inputs 2024-07-19 07:08:24 -04:00
Niko Matsakis
b677019407 fix accumulation 2024-07-19 06:22:40 -04:00
Niko Matsakis
5209735d0b ensure the fn value is up-to-date 2024-07-19 06:00:16 -04:00
Niko Matsakis
92eee06596 delete a bunch of dead code 2024-07-19 05:55:40 -04:00
Niko Matsakis
c545f8a8c3 wip 2024-07-18 07:50:22 -04:00
Niko Matsakis
812923ab0c wip 2024-07-18 07:49:06 -04:00
Niko Matsakis
efbf3249ef wip 2024-07-18 06:32:18 -04:00
Niko Matsakis
82872192b4 return_ref on tracked fn 2024-07-18 06:13:57 -04:00
Niko Matsakis
b7e6bc62af make methods work 2024-07-18 06:03:34 -04:00
Niko Matsakis
585b720fff wip 2024-07-17 09:14:20 -04:00
Niko Matsakis
8f8528a205 wip 2024-07-17 08:45:49 -04:00
Niko Matsakis
2213729c4e wip 2024-07-17 08:42:06 -04:00
Niko Matsakis
daba89c278 wip 2024-07-17 08:21:07 -04:00
Niko Matsakis
4e295f2257 wip 2024-07-17 07:49:46 -04:00
Niko Matsakis
185c86bb5a wip 2024-07-17 06:51:50 -04:00
Niko Matsakis
7443277381 wip 2024-07-17 06:41:56 -04:00
Niko Matsakis
afd7bcfa78 wip 2024-07-17 06:14:43 -04:00
Niko Matsakis
b552852f29 wip 2024-07-17 06:08:34 -04:00
Niko Matsakis
30f122eaac wip 2024-07-17 05:47:56 -04:00
Niko Matsakis
5963e118b9 wip 2024-07-17 05:33:51 -04:00
Niko Matsakis
8a39bf029b wip 2024-07-16 06:04:01 -04:00
Niko Matsakis
612cec6703 wip 2024-07-15 20:29:36 -04:00
Niko Matsakis
4769e32d44 wip 2024-07-15 07:51:40 -04:00
Niko Matsakis
fdc363b65f wip 2024-07-15 07:46:23 -04:00
Niko Matsakis
57eb0c45b4 wip: iterate towards hello_world
Some checks failed
Book / Book (push) Has been cancelled
Test / Test (false, beta) (push) Has been cancelled
Test / Test (false, stable) (push) Has been cancelled
Test / Test (true, nightly) (push) Has been cancelled
Test / Miri (push) Has been cancelled
Book / Deploy (push) Has been cancelled
2024-07-14 13:49:59 -04:00
Niko Matsakis
231dc4f713 wip: inputs 2024-07-14 13:36:30 -04:00