Skip to content

Server code appears when using only client features #839

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

Open
akonradi-signal opened this issue Feb 26, 2025 · 0 comments
Open

Server code appears when using only client features #839

akonradi-signal opened this issue Feb 26, 2025 · 0 comments

Comments

@akonradi-signal
Copy link

I have a library that depends on h2 transitively via hyper. The hyper/client feature is enabled but hyper/server is not. My compiled binary contains <h2::server::Peer as h2::proto::Peer>::convert_poll_message which doesn't seem like it should ever be used.

I suspect, but haven't been able to confirm, that this is due to proto::Dyn::convert_poll_message. Since the Rust compiler doesn't know that the Dyn::Server variant is never constructed, it must generate the handling code for it.

Would it be possible to introduce features for "client" and "server" code generation, and then only define the Dyn variant when the respective feature is enabled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant