-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Use dyn trait
everywhere
#48477
Use dyn trait
everywhere
#48477
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
c1c4699
to
38676c6
Compare
src/librustc_mir/transform/mod.rs
Outdated
@@ -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| { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah
@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? |
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) |
@bors r=nmatsakis The commits with "rustfix" in their message were automated, fwiw |
📌 Commit 38676c6 has been approved by |
@bors p=2 potential to bitrot since it's a major lint |
…sakis Use `dyn trait` everywhere Based on rust-lang#48461 do not land unless both are reviewed.
☔ The latest upstream changes (presumably #48586) made this pull request unmergeable. Please resolve the merge conflicts. |
38676c6
to
40f218f
Compare
@bors r=nmatsakis |
📌 Commit 40f218f has been approved by |
Is there any plan to make "Use |
Nope. Dyn trait is an alternate, preferred syntax over bare trait objects.
Impl trait is a new syntax that can replace some things but it's really its
own thing with its own effects on APIs
७ मार्च, २०१८ ७:३८ म.उ. रोजी, "Sai Zeng" <[email protected]> ने
लिहिले:
… Is there any pan to make "Use impl trait everywhere"?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#48477 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABivSE68h43KQX_rnbDfnwJUJTO9fBJQks5tcKe2gaJpZM4SRSrn>
.
|
Based on #48461
do not land unless both are reviewed.