Commit graph

1213 commits

Author SHA1 Message Date
zjp
863ec4ac7f fix(debug_name): impl for InternedIngredient 2022-08-22 21:17:48 +08:00
bors[bot]
e1f162742d
Merge #362
362: Implement Setter API r=XFFXFF a=crlf0710

Fixes #329 

Co-authored-by: Charles Lew <crlf0710@gmail.com>
2022-08-22 13:14:49 +00:00
zjp
4966acbc64 feat(literal): a helper to convert Ident to Literal 2022-08-22 20:22:57 +08:00
Charles Lew
7267452ff1 Implement Setter API 2022-08-22 19:22:47 +08:00
Charles Lew
66b5d45995 Fix local doctest failure. 2022-08-22 19:22:37 +08:00
zjp
d835b0782c add empty/default rustfmt.toml 2022-08-22 19:19:22 +08:00
Niko Matsakis
bf00d4217f apply cargo fmt 2022-08-22 06:21:23 -04:00
bors[bot]
6320991c8b
Merge #372
372: run `cargo test -p salsa-2022-tests` in CI r=nikomatsakis a=XFFXFF

* run `cargo test -p salsa-2022-tests` in CI
* check format first

Co-authored-by: XFFXFF <1247714429@qq.com>
2022-08-22 10:12:23 +00:00
XFFXFF
dfc3ff0f80 using cargo test --all 2022-08-22 18:09:35 +08:00
bors[bot]
0f3c887cb1
Merge #373
373: Cargo updates r=nikomatsakis a=vemoo

- Unify `parking_log` versions
- `test-env-log` has been renamed
- Update `heck`, `dashmap` and `hashlink` to theirs latest versions

With this `cargo tree --workspace --duplicates` now doesn't return anything, when in master it returned:
```
env_logger v0.7.1
[dev-dependencies]
└── salsa v0.17.0-pre.2 (/home/berni/Documents/src/salsa)

env_logger v0.9.0
└── salsa-2022-tests v0.1.0 (/home/berni/Documents/src/salsa/salsa-2022-tests)

getrandom v0.1.16
├── rand v0.7.3
│   └── rand_distr v0.2.2
│       [dev-dependencies]
│       └── salsa v0.17.0-pre.2 (/home/berni/Documents/src/salsa)
│   [dev-dependencies]
│   └── salsa v0.17.0-pre.2 (/home/berni/Documents/src/salsa)
└── rand_core v0.5.1
    ├── rand v0.7.3 (*)
    └── rand_chacha v0.2.2
        └── rand v0.7.3 (*)

getrandom v0.2.7
└── ahash v0.7.6
    └── hashbrown v0.11.2
        └── hashlink v0.7.0
            ├── salsa v0.17.0-pre.2 (/home/berni/Documents/src/salsa)
            └── salsa-2022 v0.1.0 (/home/berni/Documents/src/salsa/components/salsa-2022)
                ├── calc v0.1.0 (/home/berni/Documents/src/salsa/calc-example/calc)
                └── salsa-2022-tests v0.1.0 (/home/berni/Documents/src/salsa/salsa-2022-tests)

hashbrown v0.11.2 (*)

hashbrown v0.12.3
└── indexmap v1.9.1
    ├── salsa v0.17.0-pre.2 (/home/berni/Documents/src/salsa)
    └── salsa-2022 v0.1.0 (/home/berni/Documents/src/salsa/components/salsa-2022) (*)

humantime v1.3.0
└── env_logger v0.7.1 (*)

humantime v2.1.0
└── env_logger v0.9.0 (*)
```


Co-authored-by: Bernardo Uriarte <berublan@gmail.com>
2022-08-22 09:56:32 +00:00
Bernardo Uriarte
927d905e58 test-env-log has been renamed to test-log 2022-08-22 11:00:47 +02:00
Bernardo Uriarte
294bf2532c dev-dependency updates 2022-08-22 11:00:47 +02:00
Bernardo Uriarte
6dc4eb417b update dashmap and hashlink 2022-08-22 11:00:47 +02:00
Bernardo Uriarte
cbbd05f5d5 update heck 2022-08-22 10:51:34 +02:00
Bernardo Uriarte
78b066cff0 unify parking_lot version 2022-08-22 10:48:21 +02:00
XFFXFF
4fef5b8b2c check fmt first 2022-08-22 15:38:04 +08:00
XFFXFF
74e220ec39 update some tests 2022-08-22 15:32:29 +08:00
XFFXFF
9657247b2f trigger CI if you modify the relevent yaml 2022-08-22 15:27:09 +08:00
zjp
dfee2b8cee update tests 2022-08-22 15:23:58 +08:00
XFFXFF
60da89beb0 run salsa-2022-tests in CI 2022-08-22 15:22:34 +08:00
zjp
44e9c63974 feat(fmt_index): impl for DependencyIndex 2022-08-22 11:22:47 +08:00
zjp
f69d80b2c5 ix(fmt_index): impl for TrackedStructIngredient 2022-08-22 10:43:41 +08:00
zjp
b76ac29a09 fix(fmt_index): impl for InputFieldIngredient 2022-08-22 10:33:39 +08:00
zjp
78d7894266 fix(fmt_index): impl for InternedIngredient 2022-08-22 10:14:07 +08:00
zjp
af747c1aca fix(fmt_index): impl for accumulator 2022-08-22 10:04:47 +08:00
zjp
67fd9792f0 fix(fmt_index): implement with the helper function 2022-08-22 10:03:03 +08:00
bors[bot]
3d727f60e2
Merge #363
363: Add method to change LRU capacity at runtime r=nikomatsakis a=XFFXFF

closes #355 

Co-authored-by: XFFXFF <1247714429@qq.com>
2022-08-22 01:08:27 +00:00
zjp
9f9b46f5e0 revert fmt 2022-08-22 08:36:13 +08:00
OLUWAMUYIWA
ebcb3d62f6 Ported LRU improvements from old salsa to salsa 2022 2022-08-22 01:34:20 +01:00
XFFXFF
e856f565b3 create inputs first in an lru test 2022-08-22 08:21:51 +08:00
XFFXFF
31a4c68fc7 fix typos: deponds -> depends 2022-08-22 05:53:25 +08:00
zjp
525a9fec4c fix(fmt_index): proc macro expansion 2022-08-22 01:00:16 +08:00
zjp
0d7066c554 fix(clippy): follow the advice 2022-08-22 00:57:09 +08:00
zjp
70b0340b81 feat(fmt_index): added in Ingredient trait 2022-08-21 23:55:29 +08:00
zjp
c84f88d23a fmt 2022-08-21 23:47:27 +08:00
bors[bot]
8dfc578edc
Merge #360
360: Permit renaming constructors, getters and setters r=nikomatsakis a=MihailMihov

The goal is to add an option `constructor_name` to `#[salsa::input]`, `#[salsa::interned]` and `#[salsa::tracked]` that allows changing the name of the generated constructor. After that add attributes `get` and `set` to the fields which allow overriding the names of the getters and setters. In the end the following snippet should compile and work:
```rust
#[salsa::interned(constructor = from_string)]
struct MyInterned {
    #[get(text)] #[set(set_text)] #[return_ref]
    field: String,
}

impl MyInterned {
    pub fn new(db: &dyn Db, s: impl Display) -> MyInterned {
        MyInterned::from_string(db, s.to_string())
    }

    pub fn field(self, db: &dyn Db) -> &str {
        self.text(db)
    }

    pub fn set_field(self, db: &mut dyn Db, id: String) {
        self.set_text(&mut db, id)
    }
}
```

resolves #332 

Co-authored-by: Mihail Mihov <mmihov.personal@gmail.com>
2022-08-21 10:37:21 +00:00
XFFXFF
6645774d55 port another test about lru 2022-08-21 14:02:51 +08:00
XFFXFF
04b70f54e3 lru can be changed at runtime 2022-08-21 10:02:45 +08:00
Mihail Mihov
6b1d24098b Add test override_new_get_set 2022-08-21 01:52:54 +03:00
Mihail Mihov
958b063a60 Update input, interned and tracked structs to use specified getter and setter names 2022-08-21 01:52:54 +03:00
Mihail Mihov
eb4f97f533 Add get and set to FIELD_OPTION_ATTRIBUTES 2022-08-21 01:22:18 +03:00
Mihail Mihov
2970c16e77 Respect constructor_name option input, interned and tracked structs 2022-08-21 01:19:12 +03:00
Mihail Mihov
6cb1cb0a47 Add constructor_name option to Options 2022-08-21 01:16:45 +03:00
Niko Matsakis
12e85cb778 wip type-checking, testing
need to cleanup this commit
2022-08-19 08:41:58 -04:00
Niko Matsakis
590c5ce8d3 regular structs for stmt,expr / track span
Docs are somewhat out of date.
Tracking span should enable re-use of type-check results.
2022-08-19 06:46:54 -04:00
Niko Matsakis
d83d3c44f8 package up the output into a Program 2022-08-19 05:53:33 -04:00
bors[bot]
80d0d14194
Merge #359 #361
359: fix: typos in tutorial ir chapter r=nikomatsakis a=dawnofmidnight

Looking at the tutorial, I believe `ProgramSource` is a typo for `SourceProgram`. I'm also pretty sure the `define` -> `derive` is correct, unless `define` is some attribute I'm not aware of.

361: test for compiling failure: lru can not be used with specify r=nikomatsakis a=XFFXFF

ref #354  
Test for compile failures with [tybuild](https://github.com/dtolnay/trybuild.git). This is an example to show how it works.

Co-authored-by: dawn <78233879+dawnofmidnight@users.noreply.github.com>
Co-authored-by: XFFXFF <1247714429@qq.com>
2022-08-18 23:46:02 +00:00
bors[bot]
5f3e0ec6f5
Merge #353
353: start documenting plumbing r=nikomatsakis a=nikomatsakis

Feedback desired! I am trying to document an overview of the new salsa 2022 plumbing. I'd love for folks to [read these docs and tell me if they make sense](https://deploy-preview-353--salsa-rs.netlify.app/plumbing.html).

Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2022-08-18 23:43:44 +00:00
Niko Matsakis
06e0a04cb3 explain more about rev counter, include snippets 2022-08-18 19:37:59 -04:00
bors[bot]
02a5fc0e3e
Merge #358
358: add from impls for u32/usize r=nikomatsakis a=nikomatsakis

Make it easy to create an `Id`, especially from a `usize`

Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2022-08-18 23:37:31 +00:00