Skip to content

Use dyn trait everywhere #48477

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 6 commits into from
Mar 3, 2018
Merged

Use dyn trait everywhere #48477

merged 6 commits into from
Mar 3, 2018

Conversation

Manishearth
Copy link
Member

Based on #48461

do not land unless both are reviewed.

@rust-highfive
Copy link
Contributor

r? @petrochenkov

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 23, 2018
@Manishearth
Copy link
Member Author

r? @nikomatsakis

@Manishearth Manishearth force-pushed the dyn-trait-fixes branch 2 times, most recently from c1c4699 to 38676c6 Compare March 1, 2018 04:51
@@ -161,7 +161,7 @@ pub macro run_passes($tcx:ident, $mir:ident, $def_id:ident, $suite_index:expr; $
promoted
};
let mut index = 0;
let mut run_pass = |pass: &dyn MirPassPassPass| {
let mut run_pass = |pass: &dyn MirPass| {
Copy link
Contributor

Choose a reason for hiding this comment

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

what's up with these fixups?

Copy link
Member Author

Choose a reason for hiding this comment

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

Macros are involved and rustfix broke. There's a bug filed for this.

@@ -176,7 +176,7 @@ impl<'gcx, 'tcx> UseFinder<'gcx, 'tcx> {
None
}

fn def_use(&self, location: Location, thing: &MirVisitable<'tcx>) -> (bool, bool) {
fn def_use(&self, location: Location, thing: &dyn MirVisitable<'tcx>) -> (bool, bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this was all automated, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah

@nikomatsakis
Copy link
Contributor

@Manishearth r=me, but i'd like to know to what extent this was done automatically with rustfix (the commit names suggest it was), and what drove the need for the fixups -- do those represent bugs in the compiler suggestions?

@Manishearth
Copy link
Member Author

It's because of macros; we should be using the non-machine-applicable flag when macros are involved, and/or make rustfix better at this.

In these cases rustfix would be able to help if it understood when multiple suggestions are the same textual suggestion (there's a bug filed)

@Manishearth
Copy link
Member Author

@bors r=nmatsakis

The commits with "rustfix" in their message were automated, fwiw

@bors
Copy link
Collaborator

bors commented Mar 2, 2018

📌 Commit 38676c6 has been approved by nmatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 2, 2018
@Manishearth
Copy link
Member Author

@bors p=2

potential to bitrot since it's a major lint

Manishearth added a commit to Manishearth/rust that referenced this pull request Mar 3, 2018
…sakis

Use `dyn trait` everywhere

Based on rust-lang#48461

do not land unless both are reviewed.
@bors
Copy link
Collaborator

bors commented Mar 3, 2018

☔ The latest upstream changes (presumably #48586) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 3, 2018
@Manishearth
Copy link
Member Author

@bors r=nmatsakis

@bors
Copy link
Collaborator

bors commented Mar 3, 2018

📌 Commit 40f218f has been approved by nmatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 3, 2018
Manishearth added a commit to Manishearth/rust that referenced this pull request Mar 3, 2018
@bors bors merged commit 40f218f into rust-lang:master Mar 3, 2018
@zengsai
Copy link

zengsai commented Mar 8, 2018

Is there any plan to make "Use impl trait everywhere"?

@Manishearth
Copy link
Member Author

Manishearth commented Mar 8, 2018 via email

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants