Why does compiler say this Result is not used?

A method inside an Ipml calls thread.join()? (it's not thread, but JoinHandle, but anyway), and question mark means the error should be propagated.

it's JoinHandle.join() and it returns Result<T, Box<dyn Any + Send + 'static>>.

Does this kind of error need a special treatment, or contain nested error types?

Does the function passed to the thread::spawn() itself returns some Result? In that case the T in the Result<T, Box<dyn ...>> is also a Result and you're not handling its error case. Try thread.join()?? with two question marks.

2 Likes

Yes, it does return Result. That worked, thanks!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.