Commit graph

347 commits

Author SHA1 Message Date
Lukas Wirth
0038ae2f5e Presere span of receiver for query trait functions 2023-05-02 09:46:39 +02:00
Yoshitomo Nakanishi
5718229882 Change the constructor of salsa::Id to const fn 2023-04-12 13:36:17 +02:00
DropDemBits
7c8647e572
Allow clippy::needless_lifetimes on tracked method getters
Previously, this would necessitate having to manually add an allow for this
clippy lint, since an extra `'db` lifetime was added to the signature.
2023-03-15 09:56:00 -04:00
Niko Matsakis
ce4b041048
Update components/salsa-2022/src/storage.rs 2022-12-29 11:37:06 -05:00
manapointer
f1a775c355 update docs to be accurate to the change 2022-12-25 18:18:11 -08:00
manapointer
57b848da3e impl drop for storage 2022-12-25 18:10:42 -08:00
manapointer
2fc0a3c08f fix cvar not being notified when Arc<Shared<DB>> is dropped 2022-12-22 15:46:28 -08:00
Jake Heinz
dd10b16964 salsa 2022: fix input macro set_* being off by one if id field present 2022-11-04 23:39:35 +00:00
bors[bot]
30b5e9760a
Merge #412
412: Fix race condition in interned data r=nikomatsakis a=Skepfyr

In some scenarios the `InternedIngredient` could return two different ids for the same data if called in parallel.

Co-authored-by: Jack Rickard <jack.rickard@outlook.com>
2022-09-27 22:48:54 +00:00
XFFXFF
f48ca09a65 add empty dependencies back 2022-09-26 10:58:21 +00:00
XFFXFF
589bbeb65e Revert "remove unused variables and functions"
This reverts commit a2be847e1a.
2022-09-26 10:51:23 +00:00
XFFXFF
8f85d4ee27 cargo fmt 2022-09-26 09:15:10 +00:00
XFFXFF
409ed367c2 using flat-map trick 2022-09-26 09:14:30 +00:00
zhou fan
6239fc217a
add a comment
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2022-09-26 17:09:19 +08:00
Jack Rickard
c58ff26d87
Simplify interning by restricting deletes 2022-09-25 22:33:37 +01:00
XFFXFF
cc6ab647fa refactor outputs method of LocalState 2022-09-25 01:21:39 +00:00
XFFXFF
e7c7f386fe fix accumulator: clear the outdated accumulated values 2022-09-25 00:24:16 +00:00
XFFXFF
1214610451 remove inputs method of QueryEdges 2022-09-24 23:59:25 +00:00
XFFXFF
a2be847e1a remove unused variables and functions 2022-09-24 23:59:25 +00:00
XFFXFF
d71892c047 update diff output 2022-09-24 23:59:25 +00:00
XFFXFF
961c4ce154 update some tests and run cargo fmt 2022-09-24 23:59:25 +00:00
XFFXFF
98d1be0650 mark the outputs as valid as we encounter them in deep_verify_memo 2022-09-24 23:59:25 +00:00
XFFXFF
c219944699 merge input/output lists into one list 2022-09-24 23:59:25 +00:00
XFFXFF
1ae6a7bbc5 use Assigned insread of Field and remove Field 2022-09-24 23:59:25 +00:00
XFFXFF
99cfca5799 add the fields of tracked struct to the output of queries 2022-09-24 23:59:25 +00:00
XFFXFF
4c4096e39b panic when reading fields of tracked structs from older revisions 2022-09-24 23:59:25 +00:00
Niko Matsakis
684ab6f4fe
Update components/salsa-2022/src/input.rs 2022-09-17 06:44:11 -04:00
OLUWAMUYIWA
4bb4262569 cargo fmt 2022-09-16 15:02:15 +01:00
OLUWAMUYIWA
0f21bf0fd8 made singleton struct panic upon duplication and added tests to immutable fields 2022-09-16 14:53:56 +01:00
Onigbinde Oluwamuyiwa Elijah
e3661de899
Merge branch 'salsa-rs:master' into immutable_fields_in_inputs 2022-09-16 01:53:42 +01:00
Jack Rickard
79823c7f65
Fix deadlock in InternedIngredient::intern 2022-09-16 00:10:33 +01:00
Jack Rickard
f1499a20e2
Fix unsoundness in input_field.rs 2022-09-15 21:25:54 +01:00
Jack Rickard
5b8464c4f9
Support on-demand inputs
This adds initial support for on-demand inputs by allowing new inputs to
be created with only a shared reference to the database. This allows
creating new inputs during a revision and therefore from inside tracked
functions.
2022-09-15 21:25:53 +01:00
OLUWAMUYIWA
32f0ce0cff better debugging for input structs by including id fields 2022-09-14 14:45:59 +01:00
Bernardo Uriarte
bed692e50e simplify and avoid duplication 2022-09-13 18:01:21 +02:00
Bernardo Uriarte
3f74f36418 format 2022-09-13 18:01:21 +02:00
Bernardo Uriarte
378090acc8 add documentation back 2022-09-13 18:01:21 +02:00
Bernardo Uriarte
a288c40034 simplify paths 2022-09-13 18:01:21 +02:00
Bernardo Uriarte
84445d5120 propagate include_all_fields option 2022-09-13 18:01:21 +02:00
Bernardo Uriarte
d57c3d36b8 add documentation 2022-09-13 18:01:21 +02:00
Bernardo Uriarte
f4c6f4126e make DebugWithDb::debug only read identiy fields
and add `DebugWithDb::debug_all` which reads all fields
2022-09-13 18:01:19 +02:00
Jack Rickard
61e3bdfc81
Fix race condition in interned data
In some scenarios the `InternedIngredient` could return two different
ids for the same data if called in parallel.
2022-09-13 00:58:17 +01:00
OLUWAMUYIWA
42a996dd8d added singleton to tecked_fn AllowedOptions impl 2022-09-11 09:22:09 +01:00
Onigbinde Oluwamuyiwa Elijah
fac05b3c9f
Merge branch 'salsa-rs:master' into singleton 2022-09-11 09:12:17 +01:00
Jack Rickard
5832ad3090
Replace () with Singleton Salsa struct 2022-09-06 00:34:00 +01:00
Jack Rickard
a9e24d8b0d
Allow "constant" tracked functions
This adds support for tracked functions with only a database as input,
that is, it does not take a salsa struct.
2022-09-06 00:33:43 +01:00
bors[bot]
bd7f27d72b
Merge #406
406: no need to generate a config struct for each field of `salsa::input` r=nikomatsakis a=XFFXFF

https://github.com/salsa-rs/salsa/pull/342 added `InputFieldIngredient` which replaces the `FunctionIngredient` for `salsa::input`, so we don't need to generate a config struct and `salsa::function::Configuration` impl for each field, beacuse they are only needed when we use `FunctionIngredient`

Co-authored-by: XFFXFF <1247714429@qq.com>
2022-09-05 10:49:33 +00:00
bors[bot]
e0d07812fa
Merge #392
392: Allow creation of tracked methods r=nikomatsakis a=Skepfyr

Fixes #319.

This allows users to annotate impl blocks with `#[salsa::tracked]` and
then create tracked methods by marking individual functions with
`#[salsa::tracked]`.

Note this requires your code that looks like:
```rust
#[salsa::tracked(jar = Jar)]
impl MyInput {
    #[salsa::tracked]
    fn tracked_fn(self, db: &dyn Db) -> u32 {
        self.field(db) * 2
    }
}
```
You get an error if you annotate a method with `#[salsa::tracked]` but forget to mark the impl block.

It got messier than I was hoping but I think it turned out alright, this would look really pretty if we had [inherent associated types](https://github.com/rust-lang/rust/issues/8995), but we don't. Annoyingly even if that landed I think we'd still need the attribute on the impl block just so that it was possible to create the associated struct somewhere as you can't put types inside an impl block (and they aren't accessible if placed inside a function).

Co-authored-by: Jack Rickard <jack.rickard@outlook.com>
2022-09-05 10:44:51 +00:00
XFFXFF
b55caff4ec no need to generate a config struct and corresponding impls for each field of salsa::input 2022-09-05 14:10:46 +08:00
Jack Rickard
bac4c668cf
Add more tests for tracked methods 2022-09-03 15:44:56 +01:00