turbo
40e6c177 - More robust vdbg! macro (#4995)

Commit
2 years ago
More robust vdbg! macro (#4995) ### Description I ran into a couple of issues with the vdbg! macro: * The macro tries to move its parameters within an async block, which requires everything that's moved to be both `Copy` and `'static` to work properly. This would break when trying to pass `&obj.property`, where the reference doesn't have a `'static` lifetime. Instead, I'm adding the requirement on parameters to impl `ToOwned` so we can ensure the `'static` lifetime, and creating an owned version of the parameter to move into the future. * The `CELL_COUNTERS` thread local could be unset when calling `.value_debug_format().try_to_string()`, which would panic the thread.
Author
Parents
Loading