Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

async functions with unimplemented!() are marked as unreachable #64636

Closed

Description

@tacomorphism

can reproduce with

async fn example(){
 unimplemented!()
}

results in

warning: unreachable expression
 --> src/main.rs:1:19
  |
1 |   async fn example(){
  |  ___________________^
2 | |   unimplemented!()
3 | | }
  | |_^
  |
  = note: `#[warn(unreachable_code)]` on by default

using nightly-2019-09-18

Seems related to #61798

Activity

  1. added
    A-async-await
    A-lints
    C-bug
    T-compiler
    on Sep 20, 2019
  2. tmandry commented on Sep 21, 2019

    @tmandry
    Member

    This also happens with loops which return (first reported in #61798 (comment)).

    Minimal example:

    async fn foo() {
        loop {
            return;
        }
    }
    warning: unreachable expression
     --> src/lib.rs:1:16
      |
    1 |   async fn foo() {
      |  ________________^
    2 | |     loop {
    3 | |         return;
    4 | |     }
    5 | | }
      | |_^
      |
      = note: `#[warn(unreachable_code)]` on by default
    

    These might be separate issues, but they appeared around the same time so I'm going to assume they're related.

  3. added a commit that references this issue on Sep 22, 2019
    4ff32c0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-async-awaitA-lintsC-bugT-compiler

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions