Skip to content

Unreachable code generated by try_join! with never error #1992

@Nemo157

Description

@Nemo157

This is currently causing CI failures because one of the tests inadvertently triggers it.

Given a crate with:

async fn foo() -> Result<(), !> {
    Ok(())
}

pub async fn bar() {
    let _: Result<((), ()), !> = futures::try_join!(foo(), foo());
}

compiling it produces two unreachable call warnings pointing at the try_join!:

warning: unreachable call
 --> src/lib.rs:6:34
  |
6 |     let _: Result<((), ()), !> = futures::try_join!(foo(), foo());
  |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |                                  |
  |                                  unreachable call
  |                                  any code following this expression is unreachable
  |
  = note: `#[warn(unreachable_code)]` on by default
  = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

(-Z external-macro-backtrace doesn't give anything useful).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions