Skip to content

Server code appears when using only client features #839

Open
@akonradi-signal

Description

@akonradi-signal

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions