Skip to content
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

fix: Annotate type hints for pattern name ranges instead of the pattern itself #9744

Merged
merged 1 commit into from
Jul 31, 2021

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Jul 31, 2021

The current type hints do not go well with bindings_after_at which is likely to land with 1.56(rust-lang/rust#85305 🎉very excited for this), hence annotate the names of ident patterns instead of the entire pattern.

This changes where the typehints go for ident patterns that use @ bindings, some example comparisons:

Before:
Code_82ILMppkve
After:
Code_tPttN2rJpw

This change has no visible effect on patterns without @ bindings.

Copy link
Member

@matklad matklad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -194,8 +194,12 @@ fn get_bind_pat_hints(
if should_not_display_type_hint(sema, &pat, &ty) {
return None;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 always nice to give the code room to breathe!

@Veykril
Copy link
Member Author

Veykril commented Jul 31, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 31, 2021

@bors bors bot merged commit a423b30 into rust-lang:master Jul 31, 2021
@Veykril Veykril deleted the inlay-hints-ident branch July 31, 2021 13:49
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 this pull request may close these issues.

2 participants