Skip to content

lint idea: public Futures should be Send #5379

@rkuhn

Description

@rkuhn

One possible result of this discussion on Rust internals could be a lint that helps library maintainers in the large and the small (i.e. also between modules of the same crate) produce useful Future implementations when multithreaded executors are a possible runtime target. The lint would be disabled when targeting embedded systems where Futures are multiplexed onto the current thread only.

Informally specified, the rule would be that for any public function or method that returns an implementation of Future the return type must also be Send.

Is this feasible? Is this desirable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsL-styleLint: Belongs in the style lint groupT-async-awaitType: Issues related to async/await

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions