I can't understand this behavior, can help explain why this happend?
The error msg:
no method named
type_id
found for type&dyn std::any::Any + std::marker::Send
in the current scope
let builder = thread::Builder::new().name(String::from("thread-1"));
let thread = builder
.spawn(|| {
println!("thread is runing");
panic!("error");
println!("thread is panic");
})
.unwrap();
let res = thread.join();
println!("res is : {:?}", res);
match res {
Err(e) => {
println!("erros is {}", e.deref().type_id());
}
_ => {}
}
I had test some function that return Box to test whether the Trait's function can be called,
the test code passed
So i don't understand why the example code get the error message.
Thanks for help