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

Don't provide generate_default_from_new when impl self ty is missing #15406

Merged
merged 1 commit into from Aug 6, 2023

Conversation

lowr
Copy link
Contributor

@lowr lowr commented Aug 6, 2023

Also don't provide the assist when the Default trait can't be found.

Part of #15398

Also don't provide the assist when the `Default` trait can't be found.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 6, 2023
@lnicola
Copy link
Member

lnicola commented Aug 6, 2023

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 6, 2023

📌 Commit 5829174 has been approved by lnicola

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Aug 6, 2023

⌛ Testing commit 5829174 with merge baee6b3...

None => return false,
// Return `true` to avoid providing the assist because it makes no sense
// to impl `Default` when it's missing.
None => return true,
};
Copy link
Member

Choose a reason for hiding this comment

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

We could also return an Option here, but it doesn't matter.

@bors
Copy link
Collaborator

bors commented Aug 6, 2023

☀️ Test successful - checks-actions
Approved by: lnicola
Pushing baee6b3 to master...

@bors bors merged commit baee6b3 into rust-lang:master Aug 6, 2023
10 checks passed
@lnicola lnicola mentioned this pull request Aug 9, 2023
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants