Commit graph

13 commits

Author SHA1 Message Date
armoha
9fc958bb1d update compile-fail test .stderr message 2022-09-24 14:40:02 +09: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
fac05b3c9f
Merge branch 'salsa-rs:master' into singleton 2022-09-11 09:12:17 +01:00
OLUWAMUYIWA
7f691e3907 fixed difference in .stderr files 2022-09-07 22:19:05 +01:00
OLUWAMUYIWA
08449c61b4 eshaustive tests to check salsa macros using the trybuild tool 2022-09-07 20:09:33 +01: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
Jack Rickard
bac4c668cf
Add more tests for tracked methods 2022-09-03 15:44:56 +01:00
Onigbinde Oluwamuyiwa Elijah
aa25761bd4
Merge branch 'salsa-rs:master' into singleton 2022-09-03 14:37:27 +01:00
OLUWAMUYIWA
25809151dd removed AllowedMode trait and added compile-fail tests 2022-09-02 13:09:28 +01:00
Mihail Mihov
0a3b74da57 Add compile-fail test for getter and setter visibility 2022-09-02 03:19:21 +03:00
XFFXFF
f7519acb13 add a test for specify
`specify` does not work if the key is a `salsa::interned`
2022-08-27 07:51:35 +08:00
XFFXFF
82a6251ebc add a test for specify
`specify` does not work if the key is a `salsa::input`
2022-08-27 07:05:35 +08:00
XFFXFF
738dc3f878 test for compile failure: lru can not be used with specify 2022-08-19 07:13:03 +08:00