-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
Fix missing re-exports #2031
Fix missing re-exports #2031
Conversation
5815c67
to
f1a6315
Compare
Very cool that you created a tool for this, definitely good to improve on this in a more structural way!
This definitely does not seem like an improvement, IMO I don't think we should re-export bytes. It is a 1.0 dependency that IMO is pretty unlikely to ever get a semver-incompatible bump, so there's not the same benefit like with rustls that matching the used version is hard. My remaining question here is, are these changes semver-compatible? (In particular, the renaming of |
Unfortunately, doc comments on re-export items doesn't seem to be working with rustdoc? It's fine, though. |
quic_proto::frame::Type should be publically re-exported. This commit renames the it to a name more befitting of a public type.
f1a6315
to
2a9450c
Compare
:)
The only changes other than that rename are adding new re-exports. I don't imagine this is something that's considered to cause semver problems. It may be hard to tell at a glance because
|
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.
Thanks, this looks good to me!
(If you want to do a similar pass for rustls, that would be much appreciated!)
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.
Thanks! Would be cool to have this running in CI.
Closes #2012
In that issue, we noted that there doesn't seem to exists any automated tooling to automatically detect types from external crates which are visible in a crate's public API but which the crate does not re-export. So I went ahead and attempted to create such a tool: [cargo should-be-public-checker]. It's still pretty crude right now but it was enough to detect a handful of items that I confirmed were missing reexports in Quinn and proto. That said, it's possible that there are some things it missed.
should-be-public-checker output for quinn-proto (on main):
should-be-public-checker output for quinn (on main):
Summary of changes:
quinn_proto::frame::Type
becomes public. So, in addition to simply re-exporting it:FrameType
pub(crate)
rather thanpub
rustls
andudp
. Following this trend, I also added re-export ofrustls
to proto, and re-export ofbytes
to both.pub use
topub extern crate
. I'm fine changing this back if you like, but I think this is better because it's more clear that it's more clear that it's a crate being re-exported.pub use
d all the missing items.Of course, fixing the missing re-exports in
rustls
is out of scope, and the thing aboutMultiLane
is some irrelevant blanket-impl.