Closed
Description
Not sure whether it's a bug, but it is indeed strange...
struct A;
// this compiles
fn test(s: &mut A, arg: &str, handler: Box<dyn Fn() + 'static>) {
}
// this doesn't
impl A {
async fn test2(&mut self, arg: &str, handler: Box<dyn Fn() + 'static>) {
}
}
test2
errors with:
error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
--> src/lib.rs:8:76
|
8 | async fn test2(&mut self, arg: &str, handler: Box<dyn Fn() + 'static>) {
| ^
|
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done