Skip to content

(request) Extend #[must_use] to Pin #67387

Closed
@jebrosen

Description

@jebrosen

A type T with #[must_use] does not imply that Pin<T> is #[must_use]. This means that there is no hint to .await a Pin<Box<dyn Future>>, which is one of the current workarounds for the lack of aysnc fn in traits. This is used by async-trait in its expansion, and in some crates that have traits that "ought to" have async fns.

See also #39524, which would propagate must_use "everywhere" but was rejected, and #62228, which special-cased must_use propagation through Box only.

cc @varkor, who indicated they would provide mentoring advice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-langRelevant to the language team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions