Skip to content

Commit e94ffb1

Browse files
committed
Silence generated unreachable code.
1 parent 74005b7 commit e94ffb1

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/expand.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ fn transform_block(
321321
#(#stmts)*
322322
};
323323

324+
#[allow(unreachable_code)]
324325
__ret
325326
})
326327
);

tests/test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ pub async fn test_internal_items() {
216216

217217
pub async fn test_unimplemented() {
218218
#[async_trait]
219-
#[allow(unreachable_code)]
220219
pub trait Trait {
221220
async fn f() {
222221
unimplemented!()

tests/ui/unreachable.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#![deny(warnings)]
2+
3+
use async_trait::async_trait;
4+
5+
#[async_trait]
6+
pub trait Trait {
7+
async fn f() {
8+
unimplemented!()
9+
}
10+
}
11+
12+
#[async_trait]
13+
pub trait TraitFoo {
14+
async fn f() {
15+
let y = unimplemented!();
16+
let z = y;
17+
}
18+
}
19+
20+
fn main() {}

0 commit comments

Comments
 (0)