-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Use cargo run in more places #16752
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
Use cargo run in more places #16752
Conversation
Thanks! In the future, to edit a PR, you don't need to close the PR: just force push to the same branch, and it updates the pull request. |
@steveklabnik Ah, ok, thanks! |
It's one of those github tricks you learn after a while :) |
Make sure you comment as well when you do that, because github won't notify anyone about the force-push. |
@kballard Sure thanks for the tips! 👍 |
As @bors 's paranoia grows, he doesn't even trust Cargo anymore, one of his closest allies :-) |
4dd017c
to
14bda12
Compare
Use cargo run as much as possible...
…, r=Veykril fix: Don't destructure struct with no public fields Unfortunately I missed this case in rust-lang#16638. If a struct only has private members, the assist should not be applicable. Though valid syntax exists (`Foo { .. }`), it isn't particularly useful. Since this case applies to a lot of common types (`Arc`, `Vec`, ...), it probably makes the most sense to hide the action. As a side effect, this also disables the action for unit structs, where it also isn't particularly useful. I'd be open to changing it though if you think it makes more sense to keep it. This also fixes the `make::record_pat_field_list` function to produce valid syntax if the field list is empty, as it is used in other places too. ## Current behaviour ```rust // In crate `other_crate` pub struct Foo { bar: i32 } // In current crate fn do_something(foo: other_crate::Foo) {} // Becomes fn do_something(other_crate::Foo { , .. }: other_crate::Foo) {} ``` ## Fixed behaviour Assist should not be applicable in this case anymore.
Use cargo run as much as possible...