-
Notifications
You must be signed in to change notification settings - Fork 999
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
refactor: mark {In, Out}boundOpenInfo as deprecated #5242
base: master
Are you sure you want to change the base?
Conversation
@jxs Got a moment to review this? It seems that I cannot assign a reviewer because I don't have the permission, so I have to do an @ mention. |
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.
Thank you @drHuangMHT, for this PR, and all of your recent contributions in general!
I think we might be able to avoid some of the #[allow(deprecated)]
if we add defaults to the types that currently include {Inbound, Outbound}Info
generics (if they are trailing), e.g. to ConnectionEvent
. That way the deprecated types won't need to be mentioned by the handlers anymore. Wdyt?
What about those that are not(whose OpenInfo generic parameter in the middle)? I gave it a shot and it came out quite terrible because I had to reorder the parameters in every implementation. I think the impact will basically be the same as we outright removed |
Yeah, I'd leave those as they are (=> your current implementation). |
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.
One more comment about using expect
instead of allow
in all places, rest lgtm!
swarm/src/handler/map_in.rs
Outdated
@@ -47,6 +47,7 @@ impl<TConnectionHandler, TMap, TNewIn> MapInEvent<TConnectionHandler, TNewIn, TM | |||
} | |||
} | |||
|
|||
#[allow(deprecated)] // TODO: Remove when {In, Out}boundOpenInfo is fully removed. |
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.
With RFC 2383, expect
is now stabilized: rust-lang/rust#120924. By using expect
instead of allow
, we'll get a warning if the deprecated items have been removed and the allow
/ expect
isn't needed anymore.
Question: Is our CI on a recent enough version to support expect
?
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.
(same for all other places where we add allow(deprecated)
in this PR)
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.
Question: Is our CI on a recent enough version to support
expect
?
It was stabilized in 1.81
, I believe our current workflow is on 1.80
, which may not support this unless they have backported (branched on Jun 7 vs merged on Jun 27) it.
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.
Fixed with #5730 :)
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.
Well actually, if we do use expect
we must update our MSRV, i.e. merge #5650.
Waiting for #5730 for better handling of deprecation warning bypass? |
expect(lint) emits lint message when the expected lint is not triggered
Description
Mark
{In, Out}boundOpenInfo
as deprecated.May close #3268.
Notes & open questions
I'm putting off formatting until the change has been accepted for clearer diff.
I have changed all occurrence of OpenInfo with concrete type wherever possible to avoid excessive use of
#[allow(deprecated)]
. Is this optimal ?Change checklist