Changed return_ref syntax to returns(as_ref) and returns(cloned) (#772)

* Changed `return_ref` syntax to `returns(as_ref)` and `returns(cloned)`

* Implement

* renamed module for return_mode

* Rename macro, fix docs, add tests, validate return modes

* Cargo fmt

---------

Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
CheaterCodes 2025-05-09 09:28:54 +02:00 committed by GitHub
parent d1da99132d
commit 13a2bd7461
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
54 changed files with 538 additions and 172 deletions

View file

@ -67,7 +67,7 @@ fn main() -> Result<()> {
#[salsa::input]
struct File {
path: PathBuf,
#[return_ref]
#[returns(ref)]
contents: String,
}
@ -158,7 +158,7 @@ impl Diagnostic {
#[salsa::tracked]
struct ParsedFile<'db> {
value: u32,
#[return_ref]
#[returns(ref)]
links: Vec<ParsedFile<'db>>,
}