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

Box::default(): do not omit the type of the removed trait object #10382

Merged
merged 1 commit into from
Feb 20, 2023

Conversation

samueltardieu
Copy link
Contributor

Within a larger expression, when the type of Box::new(T::default()) is Box<dyn Trait>, the concrete type T cannot be omitted in the proposed replacement Box::<T>::default().

Fixes #10381

changelog: [box_default]: in case of a trait object do not omit the concrete type name

Within a larger expression, when the type of `Box::new(T::default())` is
`Box<dyn Trait>`, the concrete type `T` cannot be omitted in the
proposed replacement `Box::<T>::default()`.
@rustbot
Copy link
Collaborator

rustbot commented Feb 20, 2023

r? @Manishearth

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 20, 2023
@llogiq
Copy link
Contributor

llogiq commented Feb 20, 2023

As the author of the original code, I've had a look at this change and cordially approve. 🙂

@bors r+

@bors
Copy link
Collaborator

bors commented Feb 20, 2023

📌 Commit 92c403c has been approved by llogiq

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Feb 20, 2023

⌛ Testing commit 92c403c with merge 574c8ae...

@bors
Copy link
Collaborator

bors commented Feb 20, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: llogiq
Pushing 574c8ae to master...

@bors bors merged commit 574c8ae into rust-lang:master Feb 20, 2023
@samueltardieu samueltardieu deleted the issue-10381 branch March 5, 2023 19:18
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.

Box::default recommendation is overly broad (rustc can't infer type)
5 participants