Skip to content

Add ergonomic ref counting support #6512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spastorino opened this issue Mar 17, 2025 · 3 comments · Fixed by #6532
Closed

Add ergonomic ref counting support #6512

spastorino opened this issue Mar 17, 2025 · 3 comments · Fixed by #6532

Comments

@spastorino
Copy link
Member

Opening this to keep track of ergonomic ref-counting. We need to add support for .use and use closures. This is an experimental nightly feature landed in rust-lang/rust#134797

@ytmimi
Copy link
Contributor

ytmimi commented Mar 17, 2025

Given that the proposed syntax is x.use we probably want to support this the same way we already handle chains. You can take a look at what's been started in rust-lang/rust#138435 for postfix yields. I suspect that we'll handle .use similar to .yield and .await.

We haven't synced the r-l/r changes back into rustfmt yet, so if you or someone else works on implementing this formatting I'd be happy to review a PR here or in the r-l/r tree.

@spastorino
Copy link
Member Author

There's .use which would be similiar to .yield and .await but there's also use closures use || { ... }, which would be similar to move || { ... }. I can try to take a look at this at some point if nobody beats me.

@ytmimi
Copy link
Contributor

ytmimi commented Apr 2, 2025

@spastorino I think this should do it: #6532

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants