Commit graph

73 commits

Author SHA1 Message Date
Micha Reiser
6975a47690
Replace derived Debug implementation of salsa::Id 2024-07-22 17:56:16 +02:00
Niko Matsakis
634366f5fa squelch final warnings 2024-07-19 09:50:00 -04:00
Niko Matsakis
e847929536 pacify the merciless clippy 2024-07-19 09:20:41 -04:00
Niko Matsakis
9a432cab31 pacify the merciless cargo fmt 2024-07-19 09:07:47 -04:00
Niko Matsakis
8c948173b0 extend calc with annotated snippets 2024-07-19 08:46:14 -04:00
Niko Matsakis
3304acc5dd wip: accum, privacy for inputs 2024-07-19 07:08:24 -04:00
Niko Matsakis
b267f5c8b1 fixup calc example 2024-07-17 09:25:04 -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
Matthijs Brobbel
5ba40cf36c
Fix CI and examples 2024-06-18 09:52:37 +02:00
Matthijs Brobbel
c7851112a5
Rename salsa-2022 to salsa 2024-06-18 09:40:21 +02:00
Matthijs Brobbel
db75ae00a2
Remove old salsa 2024-06-18 09:25:26 +02:00
Maxwell Elliot Heiber
145202e376 Remove ': salsa::Database' bound from two examples
Two examples had a superfluous bound
': salsa::Database' that wasn't present
in the `compiler` example.

The `query_group` macro adds this bound
automatically.

This change can lead to a trailing `+` in
the bounds list. I verified this is OK by
running the examples and verifying that the production
is allowed
[per the Rust Reference](https://doc.rust-lang.org/reference/trait-bounds.html)
2021-12-30 11:02:30 +00:00
Tim Robinson
fc6806a07c CI runs Clippy 2021-06-17 15:21:51 +01:00
Niko Matsakis
a557013514 remove some unneeded lifetime parameters
Makes the compiler example read better.
2021-05-15 09:28:24 -04:00
Markus Westerlind
e2ab6c8bfa feat: Allow the dynamic db to be non-static 2020-07-23 17:08:06 +02:00
Niko Matsakis
f0c28c7e30 fix hello-world documentation 2020-07-07 10:05:02 +00:00
Niko Matsakis
fad97eeb6a remove the DB parameter
This had two unexpected consequences, one unfortunate, one "medium":

* All `salsa::Database` must be `'static`. This falls out from
`Q::DynDb` not having access to any lifetimes, but also the defaulting
rules for `dyn QueryGroup` that make it `dyn QueryGroup + 'static`. We
don't really support generic databases anyway yet so this isn't a big
deal, and we can add workarounds later (ideally via GATs).

* It is now statically impossible to invoke `snapshot` from a query,
and so we don't need to test that it panics. This is because the
signature of `snapshot` returns a `Snapshot<Self>` and that is not
accessible to a `dyn QueryGroup` type. Similarly, invoking
`Runtime::snapshot` directly is not possible becaues it is
crate-private. So I removed the test. This seems ok, but eventually I
would like to expose ways for queries to do parallel
execution (matklad and I had talked about a "speculation" primitive
for enabling that).

* This commit is 99% boilerplate I did with search-and-replace. I also
rolled in a few other changes I might have preferred to factor out,
most notably removing the `GetQueryTable` plumbing trait in favor of
free-methods, but it was awkward to factor them out and get all the
generics right (so much simpler in this version).
2020-07-04 14:17:11 +00:00
Niko Matsakis
67687376ed implement the Storage<DB> change 2020-07-04 14:17:10 +00:00
Niko Matsakis
ebb3769ad2 document the database macro 2020-06-26 22:21:54 +00:00
Niko Matsakis
550c0c3db6 document the code we generate for a query group 2020-06-24 11:13:39 +00:00
Vincent Esche
fed9ccce9e Removed unnecessary salsa::requires from compiler example 2019-11-24 11:13:46 +01:00
Vincent Esche
09d9592f14 Improved ‘compiler’ example showing parsing of an actual language and use of actual interning 2019-10-11 16:49:14 +02:00
Niko Matsakis
b9f00726da introduce Database::salsa_runtime_mut method (breaking change!) 2019-09-27 05:49:15 -04:00
Niko Matsakis
2e9b418bbb rework book a little bit
- extend some of the empty sections, add a new common pattern
- also, show how to use anchors and include so we can test the sources
  for common patterns
2019-09-24 06:13:51 -04:00
Guanqun Lu
5eb6c6f0bd some random typo fixes 2019-08-23 00:54:29 +08:00
Niko Matsakis
b73cf109d7 update hello-world with the desired naming convention 2019-01-25 10:47:01 -05:00
Niko Matsakis
9b5c7eeb5e change #[salsa::query_group] attribute to take a struct name 2019-01-25 10:26:39 -05:00
Niko Matsakis
a468292984 generate set_X and set_constant_X methods for each input
Convert some of the tests to use them
2019-01-25 05:18:26 -05:00
Niko Matsakis
f4c3aae081 update docs 2019-01-25 04:50:13 -05:00
Niko Matsakis
a8d9fb2d6b adopt salsa::database attribute macro 2019-01-24 19:02:56 -05:00
Niko Matsakis
c0978fede8 remove the need to list individual queries in database_storage 2019-01-24 05:35:57 -05:00
Cormac Relf
3b15a09b8e replace $crate with salsa in proc macro and make hello_world run 2019-01-21 10:59:12 -05:00
Fabian Schuiki
93c30a953d make query_group macro procedural
Switch to a procedural implementation of the `query_group!` macro,
residing in the `components/salsa_macros` subcrate.

Allow the user to override the invoked function via `salsa::invoke(...)`
and the name of the generated query type via `salsa::query_type(...)`.

In all tests, replace the `salsa::query_group! { ... }` invocations with
the new attribute-style `#[salsa::query_group]` macro, and change them
to the new naming scheme for query types (`...Query`).

Update README, examples, and documentation.
2019-01-17 07:24:18 +01:00
Niko Matsakis
4a8b9123e6 update hello-world 2018-11-01 05:59:33 -04:00
Niko Matsakis
49cc8abe43 introduce query_mut which you must use to get set methods 2018-11-01 04:53:56 -04:00
Niko Matsakis
df320c71dd
Merge pull request #58 from kleimkuhler/issue-56-remove-eq-bound
[WIP] Removal of Eq bound on `Q::Val`
2018-10-19 05:20:44 -04:00
Niko Matsakis
b046894de9 update readme 2018-10-18 21:30:55 -04:00
Niko Matsakis
120ba00f33 remove a lot of () keys 2018-10-18 21:30:55 -04:00
Kevin Leimkuhler
7b20806417 Initial removal of Eq bound on Q::Val 2018-10-18 15:29:15 -07:00
Aleksey Kladov
f14d846146 Re-export runtime
cc #17
2018-10-07 14:08:22 +03:00
Niko Matsakis
1428adda47 update readme docs 2018-10-05 11:03:51 -04:00
Niko Matsakis
8366b3a38b rename query_prototype to query_group 2018-10-05 10:35:50 -04:00
Niko Matsakis
55ec1f51d3 switch to use fn 2018-10-05 10:30:17 -04:00
Niko Matsakis
1b98ecb7a8 change to db.query(Query).set(key, value) 2018-10-05 06:58:51 -04:00
Niko Matsakis
0ee6f3884d make query_prototype also define queries, remove query_definition 2018-10-05 05:55:35 -04:00
Niko Matsakis
cd5622c6de make query method get by default
Use `Query.set(db, key, value)` to set. Not sure about this.
2018-10-05 05:28:51 -04:00
Niko Matsakis
a4fb4b7b13 rename query context to database 2018-10-05 04:54:51 -04:00
Niko Matsakis
0a2a871d98 improve docs 2018-10-02 05:50:38 -04:00