Skip to content

Add text edit support for return type hints on non-block body closures #19348

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

Merged
merged 4 commits into from
Mar 21, 2025

Conversation

jnyfah
Copy link
Contributor

@jnyfah jnyfah commented Mar 13, 2025

This PR fixes the FIXME in closure_ret by adding text edit functionality for closures with non-block bodies. When a user activates the return type hint for a closure without a block body (e.g., |x| x + 1), the edit now properly inserts both the return type annotation and the necessary braces around the body expression. This makes the return type hint feature work consistently for all types of closures.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 13, 2025
@jnyfah jnyfah marked this pull request as ready for review March 13, 2025 08:41
@jnyfah jnyfah requested a review from Veykril March 17, 2025 16:22
@jnyfah jnyfah requested a review from Veykril March 17, 2025 17:29
@Veykril
Copy link
Member

Veykril commented Mar 21, 2025

Thanks!

@Veykril Veykril added this pull request to the merge queue Mar 21, 2025
Merged via the queue into rust-lang:master with commit 3edfbcd Mar 21, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants