You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I have a specific test in my crate that calls std::mem::leak on purpose to verify that the crate maintains its invariants even under those circumstances. Is there a non-global way of disabling leak check for the particular test?
The text was updated successfully, but these errors were encountered:
No, that is currently not possible. The leak check happens once, all the way at the end of execution, and just checks that there are no allocations left -- so without a lot of extra infrastructure, we cannot tell which code performed the allocation.
In the standard library, what we usually did is to keep a raw pointer to the leaking allocation somewhere, so that we can properly deallocate it at the end of the test. An alternative would be to do two runs of the test suite, where only the second includes the leaky test, and do the second run with -Zmiri-ignore-leaks.
Hi! I have a specific test in my crate that calls
std::mem::leak
on purpose to verify that the crate maintains its invariants even under those circumstances. Is there a non-global way of disabling leak check for the particular test?The text was updated successfully, but these errors were encountered: