@@ -322,6 +322,9 @@ macro_rules! opt_unsafe_fn {
322322 ( $( $args: ident) ,* -> $ret: ident) => { Option <unsafe fn ( $( $args) ,* ) -> $ret> } ;
323323}
324324
325+ // This `allow` is needed because, when testing, we export this macro so it can
326+ // be used in `doctests`.
327+ #[ allow( rustdoc:: private_intra_doc_links) ]
325328/// Implements trait(s) for a type or verifies the given implementation by
326329/// referencing an existing (derived) implementation.
327330///
@@ -342,8 +345,7 @@ macro_rules! opt_unsafe_fn {
342345/// `const _: () = unsafe` macro). The reason for this restriction is that,
343346/// while `impl_or_verify!` can guarantee that the provided impl is sound when
344347/// it is compiled with the appropriate cfgs, there is no way to guarantee that
345- /// it is
346- /// ever compiled with those cfgs. In particular, it would be possible to
348+ /// it is ever compiled with those cfgs. In particular, it would be possible to
347349/// accidentally place an `impl_or_verify!` call in a context that is only ever
348350/// compiled when the `derive` feature is disabled. If that were to happen,
349351/// there would be nothing to prevent an unsound trait impl from being emitted.
@@ -372,6 +374,7 @@ macro_rules! opt_unsafe_fn {
372374/// impl_or_verify!(T: Unaligned => Unaligned for Wrapper<T>);
373375/// }
374376/// ```
377+ #[ cfg_attr( __ZEROCOPY_INTERNAL_USE_ONLY_DEV_MODE, macro_export) ] // Used in `doctests.rs`
375378macro_rules! impl_or_verify {
376379 // The following two match arms follow the same pattern as their
377380 // counterparts in `unsafe_impl!`; see the documentation on those arms for
0 commit comments