Skip to content

tokio::select! cfg-gated #3974

Open
Open
@pickfire

Description

Is your feature request related to a problem? Please describe.

Select with part of it cfg-gated. Like #[cfg(not(windows))].

Describe the solution you'd like

tokio::select! {
    #[cfg(not(windows))]
    Some(signal) = self.signals.next() => ...
}

Describe alternatives you've considered

I think the macro could take in a meta but that includes other non-cfg stuff, not sure if we want that.

The only workaround is to duplicate the whole block with if cfg!.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-tokioArea: The main tokio crateC-feature-requestCategory: A feature request.E-hardCall for participation: Experience needed to fix: Hard / a lotE-help-wantedCall for participation: Help is requested to fix this issue.M-macrosModule: macros in the main Tokio crate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions