I'm working on code like the following:
use std::cell::RefCell;
struct CallbackWithArgs<T> {
callback: Box<Fn(&mut T) -> ()>,
arg: RefCell<T>,
}
struct S {
args: CallbackWithArgs<_>,
}
The compiler has an error:
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> src/main.rs:9:28
|
9 | args: CallbackWithArgs<_>,
| ^ not allowed in type signatures
What is the correct way to do this?