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

Add assist for filling fields by replacing ellipsis in record syntax #16651

Merged
merged 3 commits into from Feb 27, 2024

Conversation

dfireBird
Copy link
Contributor

I'm not sure if the tests cover the most cases, I'll add more if suggested.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 23, 2024
Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

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

A test case for a struct or enum variant that is generated from a macro would be good (to check whether it works there, or whether it is correctly inapplicable)

@Veykril Veykril added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 26, 2024
@dfireBird
Copy link
Contributor Author

dfireBird commented Feb 26, 2024

I have never worked on macros (i.e the one writing macros not using them), so if you don't mind, can you point out a snippet somewhere and see how tests can be done?

Edit: I just researched for some time wrote this, do you meant something like this?

macro_rules! position {
    ($t: ty) => {
        struct Pos {x: $t, y: $t}
    };
}

position!(usize);

fn macro(pos: Pos) {
    let Pos { .. } = pos;
}

@Veykril
Copy link
Member

Veykril commented Feb 26, 2024

Yes, that is exactly a test case I had in mind

@dfireBird
Copy link
Contributor Author

I added those tests along with a new check and corresponding test.

@Veykril
Copy link
Member

Veykril commented Feb 27, 2024

Thanks!
@bors r+

@bors
Copy link
Collaborator

bors commented Feb 27, 2024

📌 Commit 8fa903a has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Feb 27, 2024

⌛ Testing commit 8fa903a with merge d8c5a61...

@bors
Copy link
Collaborator

bors commented Feb 27, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing d8c5a61 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants