-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Open
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.L-unused_resultLint: unused_resultLint: unused_result
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.L-unused_resultLint: unused_resultLint: unused_result