-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 rust-lang/rust#79255 - Incorrect try suggestion for float cast #6362
Fix rust-lang/rust#79255 - Incorrect try suggestion for float cast #6362
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ebroto (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
698fd4c
to
8dcfc54
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be simpler if we just remove the dot instead. What do you think?
Sounds good to me, simpler implementation and will keep the suggestions more uniform @iago-lito thoughts? |
@nico Hm, the truth is that I didn't even think that So IIUC now the question is which formatting to suggest among:
Well, I'm not sure whether there are official recommendations regarding this. Alternately, picking the option that yields the formatting maybe-closest from what the user had in mind is also interesting, like:
but that feels messy. I'd rather expect Rust not to try to accomodate my thoughs and just spit out the most explicit + readable option. Even more alternately, defer the question to To be clear, I also think most of this is overkill. My preferred solution is to just |
8dcfc54
to
4e5ea62
Compare
…loat literal cast ending in dot
4e5ea62
to
3b53de6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iago-lito I think this solution is good because it doesn't need to change a lot the current implementation, note that _
is always added.
Also, .0
is kind of redundant given that we are specifying the type explicitly.
@bors r+ Thanks! |
📌 Commit 3b53de6 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
changelog: Fix rust-lang/rust#79255 - Incorrect try suggestion for float literal cast ending in dot