[rust] Add with_unit_tests to rustc_macro
[rust] Add with_unit_tests to rustc_macro

Generalize the one-off impl that was used for zerocopy-derive macro
tests. This allows other libraries to easily run unit tests for their
macros on the host and/or devices.

Change-Id: I948f6873fb1b818cba05371a0bb3aeb9638b16f1
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/634303
Reviewed-by: Joshua Liebow-Feeser <234d196e9838c6e234061de31cd689c2a331d758@google.com>
Reviewed-by: Tyler Mandry <23c76bee785596f2629881c8641bdc9aa64e7f7f@google.com>
Commit-Queue: Alex Konradi <3ee61dd7715e31b012f8edaf69177fdbdc394d59@google.com>

google/zerocopy,google/zerocopy