Skip to content

missing unused_must_use for RPITIT #118444

Closed
@lukas-code

Description

@lukas-code

Code

pub trait Tr {
    fn foo() -> impl std::future::Future<Output = ()>;
}

pub async fn bar<T: Tr>() {
    T::foo();
}

Current output

nothing

Desired output

warning: unused implementer of `Future` that must be used
  --> src/lib.rs:10:5
   |
10 |     Tr::foo();
   |     ^^^^^^^^^
   |
   = note: futures do nothing unless you `.await` or poll them
   = note: `#[warn(unused_must_use)]` on by default

Rationale and extra context

No response

Other cases

applies to all #[must_use] traits that are used as RPITIT

Anything else?

No response

Metadata

Metadata

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler 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