Skip to content

Commit f81548d

Browse files
committed
Add regression test for issue 238
Currently fails: error: lifetime parameter `'impl0` only used once --> tests/test.rs:1603:20 | 1603 | impl Trait for &Struct { | ^ | | | this lifetime... | ...is used only here | note: the lint level is defined here --> tests/test.rs:1591:13 | 1591 | #![deny(single_use_lifetimes)] | ^^^^^^^^^^^^^^^^^^^^ help: elide the single-use lifetime | 1602 ~ 1603 ~ impl Trait for Struct { |
1 parent 7937a89 commit f81548d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/test.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,3 +1585,22 @@ pub mod issue236 {
15851585
}
15861586
}
15871587
}
1588+
1589+
// https://github.com/dtolnay/async-trait/issues/238
1590+
pub mod issue238 {
1591+
#![deny(single_use_lifetimes)]
1592+
1593+
use async_trait::async_trait;
1594+
1595+
#[async_trait]
1596+
pub trait Trait {
1597+
async fn f();
1598+
}
1599+
1600+
pub struct Struct;
1601+
1602+
#[async_trait]
1603+
impl Trait for &Struct {
1604+
async fn f() {}
1605+
}
1606+
}

0 commit comments

Comments
 (0)