Skip to content

Unable to use select macro in #![forbid(unsafe_code)] environments #405

@karroffel

Description

@karroffel

Description

I am using #![forbid(unsafe_code)] in my crate and for a while I only had a single recv() inside of a select macro and everything was compiling fine.

When I added a second recv() arm it failed to compile.

I switched to using the Select struct for now and it compiles and works properly.

I expected the select! macro to only use the safe API of Select, not emitting unsafe code inside the macro.

Example code

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=efee4be440204c5c160827d5fa1de5fb

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