Skip to content

unused_result lint generates warnings for tuples of "trivial" types (such as ((), ())) #153144

@Jeff-A-Martin

Description

@Jeff-A-Martin

I'm finding that the nightly version of Rust is newly flagging unused results for tuples of empty tuples. Here's an example:

#[tokio::main]
async fn main() {
    futures::future::join(futures::future::ready(()), futures::future::ready(())).await;
}

When built with

$ echo $RUSTFLAGS
-Dunused_results
$ rustc --version
rustc 1.95.0-nightly (1ed488274 2026-02-25)

Will generate the following error:

error: unused result of type `((), ())`
 --> src/main.rs:5:5
  |
5 |     futures::future::join(futures::future::ready(()), futures::future::ready(())).await;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I suspect this is due to this recent change. It's not clear to me whether this is an intended behavior change or an unintended side effect.

Metadata

Metadata

Assignees

Labels

A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.L-unused_resultLint: unused_result

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions