Re-export core
symbols from derive_utils
module.
#277
Labels
compatibility-nonbreaking
Changes that are (likely to be) non-breaking
Currently, some generated code (generated by zerocopy-derive and generated when invoking zerocopy macros like
transmute!
or those inderive_utils
) relies directly on::core
, which can be problematic in a context in whichcore
has not been explicitly included (in older versions of Rust, with the exception ofno_std
crates,core
was not included in the root namespace by default) or in which it has been renamed. Note that some code avoids this problem (e.g., fortransmute!
, we have a top levelpub use core::mem::transmute as __real_transmute
).It might be better if we had a uniform solution to this problem. One option would be to re-export all of
core
, and then change macros and zerocopy-derive to emit code which useszerocopy::core_reexport::...
. An open question is where this reexport should live and what it should be named. A natural location might bederive_utils
, but that doesn't really make sense for macros that are not related to zerocopy-derive (liketransmute!
). We could also consider moving things around so that there's a parent module over all exported macros (ie, not including internal-only macros likesafety_comment!
), which would provide a natural location for the re-export.See also #11, which tracks macro hygiene.
The text was updated successfully, but these errors were encountered: