Commit graph

152 commits

Author SHA1 Message Date
Niko Matsakis
4f234cfbb9 remove component and replace with specify option
You can now do `#[salsa::tracked(specify)]` and you will
get a method `some_fn::specify(...)` that can be used to
specify the value.
2022-08-05 02:51:13 -04:00
Niko Matsakis
1f1950c145 refactor error reporting, detect too few argments 2022-08-05 01:24:07 -04:00
Niko Matsakis
627eddd428 add a test for tracked functions 2022-08-05 00:39:00 -04:00
Niko Matsakis
b4053ad76b rename references to memoized to tracked 2022-08-04 01:42:42 -04:00
Niko Matsakis
91a18114bc s/memoized/tracked-fn/ 2022-08-04 01:41:04 -04:00
Niko Matsakis
8f2f664e96 rename impl stuff from entity to tracked struct 2022-08-03 13:42:33 -04:00
Niko Matsakis
a96cb03a05 remove #[salsa::entity], and #[salsa::tracked] 2022-08-03 09:09:22 -04:00
Niko Matsakis
8ff4f5069e rename EntityLike to SalsaStruct 2022-08-03 08:53:27 -04:00
Niko Matsakis
e331f7102d mark some unused variables 2022-08-03 08:51:14 -04:00
Niko Matsakis
3a55d3072b remove DataItem now that we don't support enums
simpler.
2022-08-03 03:50:46 -04:00
Niko Matsakis
0880be0b79 remove support for interned enums
It's nicer to just define a struct with a data field.
2022-08-03 03:43:39 -04:00
Niko Matsakis
7e3e77d611 fix various small bugs in #[salsa::input] 2022-08-03 00:41:22 -04:00
Niko Matsakis
f0156cca36 rename all_entity_fields to all_field_names 2022-08-03 00:32:27 -04:00
Niko Matsakis
783981dc16 add salsa::input items 2022-08-03 00:31:50 -04:00
Niko Matsakis
1c882bb598 fix missing format! calls in entity_like.rs 2022-08-03 00:31:26 -04:00
Niko Matsakis
196baab60d add InputIngredient
They are a very simple variant on entities
2022-08-03 00:30:52 -04:00
Niko Matsakis
d134e0a54b comment the fields on an interned ingredient 2022-08-03 00:05:37 -04:00
Niko Matsakis
3559ac2b21 remove trailing whitespace 2022-08-02 15:05:28 -04:00
Niko Matsakis
548beade54 extract configuration struct/impl code from entity
`#[salsa::input]` structs will need similar code
2022-08-02 10:56:27 -04:00
Niko Matsakis
f2649ee503 extract helper functions for validation 2022-08-02 14:22:45 +03:00
Niko Matsakis
d0b7046245 quick fix for components w/ optional jar
We need tests!
2022-08-02 07:28:13 +03:00
Niko Matsakis
e3769b5c31 remove trailing whitespace
this seems to be a rustfmt bug?
2022-08-01 13:54:21 +03:00
Niko Matsakis
985650523e entity-based salsa preview 2022-08-01 09:24:49 +03:00
Niko Matsakis
1e3c2f22aa Expose the ability to remove the value from an input query, taking ownership of it
Co-authored-by: Tim Robinson <tim.g.robinson@gmail.com>
2022-06-03 05:52:00 -04:00
bors[bot]
0f9971ad94
Merge #296
296: Slot no more: overhauled internal algorithm r=nikomatsakis a=nikomatsakis

This is the overhauled implementation that avoids slots, is more parallel friendly, and paves the way to fixed point and more expressive cycle handling.

We just spent 90 minutes going over it. [Some rough notes are available here,](https://hackmd.io/6x9f6mavTRS2imfG96tP5A) and a video will be posted soon.

You may find the [flowgraph useful](https://raw.githubusercontent.com/nikomatsakis/salsa/slot-no-more/book/src/derived-query-read.drawio.svg).



Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2022-02-07 20:30:07 +00:00
Maxwell Elliot Heiber
a1be30bc13 Make storage fields of #nameGroupStorage private
This change resolves a fixme that referenced #120.

This change breaks no tests, and, if I understand
correctly, does not affect user-facing API.

Here is the difference for the `HelloWorldGroupStorage__` struct
generated from macros in the `hello_world` example:

**Before:**

```rs
struct HelloWorldGroupStorage__ {
    pub input_string:std::sync::Arc<<InputStringQuery as salsa::Query> ::Storage> ,pub length:std::sync::Arc<<LengthQuery as salsa::Query> ::Storage> ,
}
```

**After:**

```rs
struct HelloWorldGroupStorage__ {
    input_string:std::sync::Arc<<InputStringQuery as salsa::Query> ::Storage> ,length:std::sync::Arc<<LengthQuery as salsa::Query> ::Storage> ,
}
```
2022-01-23 20:18:25 +00:00
Niko Matsakis
c0d9070a64 refactor _mut path to not take arc
Instead of grabbing the arc, just pass back an `&mut Runtime`.

The eventual goal is to get rid of the lock on the `set` pathway
altogether, but one step at a time.
2022-01-21 13:52:43 -05:00
bors[bot]
e5cb77472b
Merge #290
290: Update doc in macro about query.in_db for dyn db r=nikomatsakis a=mheiber

Update the macro for `query_group` so the comment
on `fn in_db` no longer says that it is more common
to use the trait method on `db`.

Afaict, the trait methods referred to were removed
when dyn database were introduced in RFC0006:
./book/src/rfcs/RFC0006-Dynamic-Databases.md, as
described in the section
"Instead of `db.query(Q)`, you write `Q.in_db(&db)`"

Co-authored-by: Maxwell Elliot Heiber <mheiber@fb.com>
2022-01-21 18:38:10 +00:00
Maxwell Elliot Heiber
eb2b36948d Update doc in macro about query.in_db for dyn db
Update the macro for `query_group` so the comment
on `fn in_db` no longer says that it is more common
to use the trait method on `db`.

Afaict, the trait methods referred to were removed
when dyn database were introduced in RFC0006:
./book/src/rfcs/RFC0006-Dynamic-Databases.md, as
described in the section
"Instead of `db.query(Q)`, you write `Q.in_db(&db)`"
2021-12-30 11:36:05 +00:00
Niko Matsakis
fc020de9c4 s/maybe_changed_since/maybe_changed_after/ 2021-11-13 16:39:41 -05:00
Niko Matsakis
75ee3edd2e introduce Cycle type and use in recovery, errors
The Cycle type gives more structured information and ensures
deterministic ordering of participants within any particular
execution.
2021-10-31 07:21:07 -04:00
Niko Matsakis
42a653ca6f use computed recovery strategy
Rather than checking return value of from `Q::cycle_fallback`, we
now consult the computed recovery strategy to decide whether to
panic or to recover. We can thus assume that we will successfully
recover and don't need to check for `None` results anymore.
2021-10-30 11:19:09 -04:00
Niko Matsakis
fc826b0689 add cycle_recovery_strategy function on database 2021-10-30 11:09:24 -04:00
Niko Matsakis
d082270610 introduce CYCLE_STRATEGY constant for queries
This allows us to figure out whether a query can recover
from a cycle (and how) without invoking the `recover`
function.
2021-10-30 11:09:24 -04:00
Jonas Schievink
cb38bb7066 Publish 0.17.0-pre.2 2021-10-06 22:33:30 +02:00
Jonas Schievink
7b39882deb Remove dead code 2021-09-03 18:38:34 +02:00
Lukas Wirth
ea378103c3 Use format_ident! when creating new identifiers in salsa-macros 2021-08-24 02:47:28 +02:00
Lukas Wirth
26b47e02e9 Keep parameter names of queries in query_group attribute 2021-06-30 21:14:10 +02:00
Tim Robinson
fc6806a07c CI runs Clippy 2021-06-17 15:21:51 +01:00
Niko Matsakis
d178d1b765 update a few comments that mention gc 2021-06-06 06:20:23 -04:00
Aleksey Kladov
a84ee62bd1 Publish 0.17.0-pre.1
- new cancellation API #265
2021-05-29 20:57:48 +03:00
Jonas Schievink
1fb660c33e Use the more common spelling of cancell{ed,ation} 2021-05-25 15:08:23 +02:00
Jonas Schievink
223f87bb18 Canonicalize to US spelling of "cancelation" 2021-05-18 15:36:43 +02:00
Jonas Schievink
197b01fa4b Implement "opinionated cancellation" 2021-05-17 18:59:28 +02:00
Aleksey Kladov
9e6adc9900 Publish v0.16.0
- #242 allow `dyn Database` to be non-'static
- #248 allow using borrowed keys for invalidation
- #250 upgrade crossbeam_utils
2020-10-14 12:33:39 +02:00
Aleksey Kladov
6b96a1e22f Leverage Cargo defaults 2020-10-14 12:29:29 +02:00
Niko Matsakis
2e2239a307
Merge pull request #242 from Marwes/lift_static_restriction
feat: Allow the dynamic db to be non-static
2020-09-09 10:52:50 -04:00
Aleksey Kladov
590c037323 Release v0.15.2
* #243, better error message from proc macro
* #240, purge method for cleaning the database completely
2020-08-05 13:55:12 +02:00
Chase Wilson
78b32d69da
Made proc-macros panic less
Replaced the panics in query_group with syn errors for better user feedback and experience
2020-07-25 14:38:13 -05:00
Markus Westerlind
3a84a77ebc Remove some unnecessary changes 2020-07-24 11:23:41 +02:00