369: Try to fix issue#340 r=XFFXFF a=zjp-CN
(WIP)
Follow the instructions from https://github.com/salsa-rs/salsa/issues/340#issuecomment-1210153085.
Still not sure what to do with `fmt_index`...
Fix#340
Co-authored-by: zjp <jiping_zhou@foxmail.com>
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
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>
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>
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>