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
Labels
A-async-await Area: Async & Await A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@tacomorphism
Copy link

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

@jonas-schievink jonas-schievink added A-async-await Area: Async & Await A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 20, 2019
@tmandry
Copy link
Member

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
Labels
A-async-await Area: Async & Await A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants