Commit graph

354 commits

Author SHA1 Message Date
Niko Matsakis
6cfaf021b0 introduce the GetQueryGroupStorage trait and use it 2019-01-23 08:52:31 -05:00
Niko Matsakis
af358ecdab replace the storage tuple with a struct
Tuples only implement Default up to arity 12.
2019-01-23 08:31:08 -05:00
Niko Matsakis
4f84f2a32e
Merge pull request #123 from nikomatsakis/group-struct
introduce group storage structs to use from `database_storage` macro
2019-01-23 05:43:03 -05:00
Niko Matsakis
238be96432 introduce group storage structs to use from database_storage macro
This also detected a bunch of crate visibility mismatches in the
tests.
2019-01-23 05:35:07 -05:00
Niko Matsakis
3e81f12dd2
Merge pull request #115 from nikomatsakis/move-unwind-safe-impls
move the RefUnwindSafe impls to shared/local state structs
2019-01-21 11:16:17 -05:00
Niko Matsakis
1ed958af60
Merge pull request #119 from nikomatsakis/database-storage-proc-macro
Make `database_storage` a proc macro
2019-01-21 11:15:45 -05:00
Niko Matsakis
e284706363 remove doctest 2019-01-21 10:59:48 -05:00
Niko Matsakis
5f9309f108 remove database_storage macro-rules macro 2019-01-21 10:59:47 -05:00
Niko Matsakis
b8311f2a28 silence dead code warning 2019-01-21 10:59:12 -05:00
Cormac Relf
857181dd17 add attributes and visibility, fix ::salsa, hide some docs 2019-01-21 10:59:12 -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
Cormac Relf
1526206e4b recreate the rest of the impls as proc macro 2019-01-21 10:59:12 -05:00
Niko Matsakis
3db31cdbc0 create more impls 2019-01-21 10:59:11 -05:00
Niko Matsakis
3add1337f6 create struct and fields 2019-01-21 10:59:11 -05:00
Niko Matsakis
7b6254924e first shot at parsing database-storage in syn 2019-01-21 10:59:11 -05:00
Niko Matsakis
d15be76350 move parenthesized to its own module 2019-01-21 10:59:11 -05:00
Niko Matsakis
d510b28fe2 move salsa::query_group code into its own module 2019-01-21 10:59:11 -05:00
Niko Matsakis
af48c409e3
Merge pull request #116 from cormacrelf/hide_qd
add #[doc(hidden)] to __SalsaQueryDescriptor
2019-01-21 06:35:08 -05:00
Cormac Relf
38dff4784d add #[doc(hidden)] to __SalsaQueryDescriptor 2019-01-21 20:08:38 +11:00
Niko Matsakis
4ed95c4aae include condition that the storage be unwind safe 2019-01-18 08:53:12 -05:00
Niko Matsakis
4158a4dba5 move the RefUnwindSafe impls to shared/local state structs 2019-01-18 07:12:17 -05:00
Niko Matsakis
827828d6b5
Merge pull request #114 from nikomatsakis/clear-query-stack-on-panic
Clear query stack on panic
2019-01-18 07:10:31 -05:00
Niko Matsakis
f0c5cffd89 add Drop to recover from panic gracefully 2019-01-18 05:52:47 -05:00
Niko Matsakis
27af8ca820 add (failing) test that checks that we clear query stack 2019-01-18 05:52:02 -05:00
Niko Matsakis
21519e6ff7 introduce a ActiveQueryGuard type 2019-01-18 05:49:25 -05:00
Niko Matsakis
15e1366d81 move local-state into its own module 2019-01-18 05:43:39 -05:00
Niko Matsakis
500a60d40d make LocalState encapsulate its state 2019-01-18 05:38:44 -05:00
Niko Matsakis
ff7c570beb
Merge pull request #113 from nikomatsakis/release-0.10.0-alpha1
release 0.10.0-alpha1
2019-01-17 05:49:32 -05:00
Niko Matsakis
2c3450c885 bump release number to 0.10.0-alpha1 2019-01-17 05:41:07 -05:00
Niko Matsakis
2b051d53be
Merge pull request #112 from nikomatsakis/prep-for-release
Prep for release
2019-01-17 05:39:21 -05:00
Niko Matsakis
a2e1d82dee
Merge pull request #110 from matklad/cancelation-docs
document *why* one may want to call is_current_revision_canceled
2019-01-17 05:31:27 -05:00
Niko Matsakis
85a637eb4f rename salsa_macros to salsa-macros 2019-01-17 05:28:42 -05:00
Niko Matsakis
8affc724c9 make the compile-fail test work 2019-01-17 05:27:20 -05:00
Niko Matsakis
15134a257c
Merge pull request #111 from nikomatsakis/generate-impl
generate an impl of the trait from procedural macro
2019-01-17 05:17:49 -05:00
Niko Matsakis
0f577a2b10 generate an impl of the trait from procedural macro
Instead of generating

```rust
trait Query: GetQueryTable<Foo> {
    fn foo() { .. }
}
```

generate

```rust
trait Query {
}

impl<T> Query for T
where
    T: GetQueryTable<Foo>,
{
    fn foo() { .. }
}
```
2019-01-17 05:04:27 -05:00
Niko Matsakis
755a5dcdf7
Merge pull request #108 from fabianschuiki/proc-macro
Implement `query_group` as procedural macro
2019-01-17 04:52:41 -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
Aleksey Kladov
785b73c597 document *why* one may want to call is_current_revision_canceled 2019-01-15 13:45:09 +03:00
Niko Matsakis
cd454e986e
Merge pull request #109 from nikomatsakis/release-0.9.2
release 0.9.2
2019-01-15 05:16:13 -05:00
Niko Matsakis
15fc110dff release 0.9.2
- Introduces the `propagated_panic` hook and specify that the
  salsa storage types are unwind safe (#107).
2019-01-15 05:06:54 -05:00
Niko Matsakis
0db861e3a8
Merge pull request #107 from matklad/panic-hooks
Unwinding-based cancelation via panic hook
2019-01-15 04:56:50 -05:00
Aleksey Kladov
61e1d69fb5 preserve both cancellation strategies 2019-01-11 10:13:38 +03:00
Aleksey Kladov
f07643d232 runtime is unwind-safe iff storage is unwind-safe 2019-01-11 10:04:09 +03:00
Aleksey Kladov
88313c8030 test unwinding-based cancelation 2019-01-10 13:34:20 +03:00
Aleksey Kladov
b637e1a9bb mark runtime as UnwindSafe
An alternative would be to mark bit of state as runtime safe, but as
Runtime directly contains a RefCell we need to mark it as a whole
anyway!
2019-01-10 13:34:20 +03:00
Aleksey Kladov
add15d83ea add panic hooks
To implement cancellation via unwinding, one needs to throw `Canceled`
value in `if_current_revision_is_canceled` and `on_propagated_panic`.
2019-01-10 12:15:37 +03:00
Niko Matsakis
da94eae920
Merge pull request #106 from nikomatsakis/release-0.9.1
release 0.9.1
2019-01-04 13:59:22 -05:00
Niko Matsakis
2af8cb3004 release 0.9.1
- Includes fix to a subtle cancellation bug (#66)
2019-01-04 13:57:37 -05:00
Niko Matsakis
aaa50e01d6
Merge pull request #105 from nikomatsakis/issue-66-transitive-cancelation
Issue 66 transitive cancelation
2019-01-04 13:57:09 -05:00
Niko Matsakis
880681df49 make a test for transitive cancellation 2019-01-04 13:51:10 -05:00