salsa/salsa-2022-tests/tests
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
..
compile-fail test for compile failure: lru can not be used with specify 2022-08-19 07:13:03 +08:00
parallel define Jar struct separately 2022-08-10 07:28:13 +08:00
accumulate-from-tracked-fn.rs reset accumulators on new revisions, etc 2022-08-17 06:47:11 -04:00
accumulate-reuse-workaround.rs demonstrate re-use workaround 2022-08-17 06:55:27 -04:00
accumulate-reuse.rs reset accumulators on new revisions, etc 2022-08-17 06:47:11 -04:00
accumulate.rs fix formatting 2022-08-17 07:38:03 -04:00
compile_fail.rs test for compile failure: lru can not be used with specify 2022-08-19 07:13:03 +08:00
cycles.rs define Jar struct separately 2022-08-10 07:28:13 +08:00
deletion-cascade.rs wire up salsa struct seletion, test it 2022-08-16 17:55:32 -04:00
deletion.rs wire up salsa struct seletion, test it 2022-08-16 17:55:32 -04:00
expect_reuse_field_x_of_a_tracked_struct_changes_but_fn_deponds_on_field_y.rs test: expect reuse field X changes but fn depends on field Y 2022-08-07 12:43:45 +08:00
expect_reuse_field_x_of_an_input_changes_but_fn_deponds_on_field_y.rs test: expect reuse field X changes but fn depends on field Y 2022-08-07 12:43:45 +08:00
hello_world.rs don't mark specified values as volatile 2022-08-10 00:42:32 -04:00
lru.rs refactor and cargo fmt 2022-08-18 08:07:13 +08:00
mutate_in_place.rs refactor and cargo fmt 2022-08-18 08:07:13 +08:00
override_new_get_set.rs Add test override_new_get_set 2022-08-21 01:52:54 +03:00
specify_tracked_fn_in_rev_1_but_not_2.rs update expected logs 2022-08-16 17:58:51 -04:00
tracked_fn_on_input.rs make salsa-2022 tests into independent files 2022-08-06 10:43:43 -04:00
tracked_fn_on_tracked.rs add comments, remove dead-code lints 2022-08-10 00:42:32 -04:00
tracked_fn_on_tracked_specify.rs make salsa-2022 tests into independent files 2022-08-06 10:43:43 -04:00
tracked_fn_read_own_entity.rs don't mark specified values as volatile 2022-08-10 00:42:32 -04:00