Commit graph

1569 commits

Author SHA1 Message Date
Niko Matsakis
34e109d390 remove type parameter from ZalsaImpl 2024-07-28 13:01:09 +00:00
Niko Matsakis
85628247e5 pacify the merciless clippy 2024-07-28 12:47:50 +00:00
Niko Matsakis
f8b1620ca7 pacify the merciless cargo fmt 2024-07-28 12:47:50 +00: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
8e9ebbafd3 improve comments 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
62f158742c rename Storage to ZalsaImpl, privatize 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
64556e9d28 make event generation lazy
Creating events if nobody is listening has
always bugged me.
2024-07-28 12:35:33 +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
cd339fc1c9
Merge pull request #542 from nikomatsakis/codspeed
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
Test / Benchmarks (push) Has been cancelled
Book / Deploy (push) Has been cancelled
Merge Codspeed
2024-07-28 11:09:37 +00:00
Niko Matsakis
581513302a Merge remote-tracking branch 'salsa-rs/add-codspeed' 2024-07-28 11:07:09 +00:00
Niko Matsakis
b37a821d97
Merge pull request #541 from nikomatsakis/upgrade-dependencies
upgrade all the things
2024-07-28 10:42:48 +00:00
Niko Matsakis
c50cefa71e upgrade all the things 2024-07-28 10:38:30 +00:00
Niko Matsakis
33889889e8
Merge pull request #540 from nikomatsakis/codespaces-config
basic GitHub codespaces configuration
2024-07-28 10:18:01 +00:00
Niko Matsakis
d0a105a193 devcontainer definition
Created by VSCode's command.
2024-07-28 10:16:36 +00:00
Niko Matsakis
b0ee16211e
Merge pull request #532 from salsa-rs/fix-guard-assertion
Fix assertion for same DB in `DbGuard`
2024-07-28 09:56:42 +00:00
Micha Reiser
354dc0eff1
Update src/local_state.rs
Co-authored-by: Noah Lev <camelidcamel@gmail.com>
2024-07-27 17:24:08 +01:00
Niko Matsakis
8788180155
Merge pull request #531 from salsa-rs/handle-into-inner
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
Add Handle::into_inner method
2024-07-27 09:39:28 +00:00
Niko Matsakis
49524367b7
Merge pull request #534 from salsa-rs/fix-synthetic-write
Bump revision in `db.synthetic_write`
2024-07-27 09:38:39 +00:00
Micha Reiser
b98434a5e2
Bump revision in db.synthetic_write 2024-07-26 15:56:51 +02:00
Micha Reiser
d18d8008e9
Add codspeed 2024-07-26 12:09:40 +02:00
Micha Reiser
fc0a82bd10
Add benchmark for query with many tracked structs 2024-07-26 11:43:11 +02:00
Micha Reiser
18faece05e
Fix assertion for same DB in DbGuard 2024-07-26 11:26:19 +02:00
Micha Reiser
c66f600c06
Add Handle::into_inner method 2024-07-26 10:23:56 +02:00
Niko Matsakis
e4ce917f6e
Merge pull request #527 from nikomatsakis/spindle
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
re-enable parallel tests
2024-07-25 10:19:52 +00:00
Niko Matsakis
bf636d27ea add a doc comment 2024-07-25 09:33:54 +00:00
Niko Matsakis
246dcab977 fix race condition around dropping arc handle
Sigh, I always make this mistake.
2024-07-25 09:31:06 +00:00
Niko Matsakis
8a3cc6e404 add a test for handle cancellation
I realized there weren't any!
2024-07-24 10:36:07 +00:00
Niko Matsakis
a5395665ce order cycles by debug_name first
We used to sort just by the ingredient index,
but since those are now added dynamically,
that can be fairly unstable in some of the tests.
We now sort by the "debug name" of the ingredient
first, which is more reliably stable.
2024-07-24 10:10:37 +00:00
Niko Matsakis
03a62c8ce5 add debug_name method to ingredient
We can use this to more reliably sort.
2024-07-24 10:06:57 +00:00
Niko Matsakis
470c5b3d78 restore parallel_cycle_one_recover 2024-07-24 09:54:30 +00:00
Niko Matsakis
ac474a9c8d restore parallel_cycle_mid_recover 2024-07-24 09:53:24 +00:00
Niko Matsakis
82d37de105 start restoring parallel tests 2024-07-24 09:46:19 +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
Niko Matsakis
3d2b2d3a65 remove RuntimeId and use ThreadId 2024-07-23 11:53:37 -04:00
Niko Matsakis
7c2bbe811e add comments 2024-07-23 11:52:05 -04:00
Niko Matsakis
d0d05ec89c remove some visibility 2024-07-23 11:52:05 -04:00
Niko Matsakis
59dbfc2826 flatten module hierarchy 2024-07-23 11:52:05 -04:00
Niko Matsakis
61b1671b69 remove "debug_probe"
We are using "peek fields" methods instead;
I like that approach better.
2024-07-23 11:52:05 -04:00
Niko Matsakis
4e015483fe remove shared field and inline fields 2024-07-23 11:52:05 -04:00
Niko Matsakis
2f4f80fe23
Merge pull request #516 from davidbarsky/master
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
chore: use tracing instead of log
2024-07-23 09:22:50 +00:00
David Barsky
86f06d8485 chore: use tracing instead of log 2024-07-22 18:02:40 -04:00