futures::lock::Mutex
没有实现RefUnwindSafe
特征(参见https://docs.rs/futures/0.3.17/futures/lock/struct.Mutex.html#impl-RefUnwindSafe)
为什么不安全通过一个futures::lock::Mutex
里面std::panic::catch_unwind
?
可重现的代码:
use std::panic::catch_unwind;
use futures::lock::Mutex;
fn main() {
let m = Mutex::new(String::new());
catch_unwind(|| {
m.lock()
});
}
可以futures::lock::Mutex
实现RefUnwindSafe
trait 吗?