Skip to content

Conversation

@MatejLach
Copy link
Contributor

Use cargo run as much as possible...

@steveklabnik
Copy link
Contributor

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.

@MatejLach
Copy link
Contributor Author

@steveklabnik Ah, ok, thanks!

@steveklabnik
Copy link
Contributor

It's one of those github tricks you learn after a while :)

@lilyball
Copy link
Contributor

Make sure you comment as well when you do that, because github won't notify anyone about the force-push.

@MatejLach
Copy link
Contributor Author

@kballard Sure thanks for the tips! 👍

@MatejLach
Copy link
Contributor Author

As @bors 's paranoia grows, he doesn't even trust Cargo anymore, one of his closest allies :-)
The test suite doesn't seem to like Cargo's output while Running the executable.
Currently investigating....

@MatejLach MatejLach closed this Aug 26, 2014
@MatejLach MatejLach deleted the more_cargorun branch August 26, 2014 18:25
@MatejLach MatejLach reopened this Aug 26, 2014
bors added a commit that referenced this pull request Aug 27, 2014
@bors bors closed this Aug 27, 2014
@bors bors merged commit 7bfcace into rust-lang:master Aug 27, 2014
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Mar 10, 2024
…, 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.
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.

4 participants