Tokio catch unwind

I have some code I'd like to run tests on, but it works within a tokio runtime. The code needs some setup and teardown to happen before and after each test.

I attempted to write a sort of framework for this, but it seems the tokio::fs futures are not unwind safe.

Since it's just for test code, is it reasonable to wrap everything in AssertUnwindSafe?

Example code here on the Playground

Just use AssertUnwindSafe. It's perfectly fine.

Consider opening a bug asking us to mark the relevant types UnwindSafe.

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.