-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More robust vdbg! macro (vercel/turborepo#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.
- Loading branch information
Showing
2 changed files
with
23 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters