Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tacomorphism opened this issue Sep 20, 2019 · 1 comment · Fixed by #64669
Closed

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

tacomorphism opened this issue Sep 20, 2019 · 1 comment · Fixed by #64669

Comments

@tacomorphism
Copy link

@tacomorphism tacomorphism commented Sep 20, 2019

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

@tmandry
Copy link
Contributor

@tmandry tmandry commented Sep 21, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants