Skip to content

Commit

Permalink
Silence generated unreachable code.
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioBenitez committed Feb 4, 2021
1 parent 74005b7 commit e94ffb1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/expand.rs
Expand Up @@ -321,6 +321,7 @@ fn transform_block(
#(#stmts)*
};

#[allow(unreachable_code)]
__ret
})
);
Expand Down
1 change: 0 additions & 1 deletion tests/test.rs
Expand Up @@ -216,7 +216,6 @@ pub async fn test_internal_items() {

pub async fn test_unimplemented() {
#[async_trait]
#[allow(unreachable_code)]
pub trait Trait {
async fn f() {
unimplemented!()
Expand Down
20 changes: 20 additions & 0 deletions tests/ui/unreachable.rs
@@ -0,0 +1,20 @@
#![deny(warnings)]

use async_trait::async_trait;

#[async_trait]
pub trait Trait {
async fn f() {
unimplemented!()
}
}

#[async_trait]
pub trait TraitFoo {
async fn f() {
let y = unimplemented!();
let z = y;
}
}

fn main() {}

0 comments on commit e94ffb1

Please sign in to comment.