Commit 901f1d73 authored by Benno Lossin's avatar Benno Lossin
Browse files

rust: pin-init: allow the crate to refer to itself as `pin-init` in doc tests



The `syn` approach requires use of `::pin_init::...` instead of the
`$crate::...` construct available to declarative macros. To be able to
use the `pin_init` crate from itself (which includes doc tests), we have
to declare it as such.

Reviewed-by: default avatarGary Guo <gary@garyguo.net>
Tested-by: default avatarAndreas Hindborg <a.hindborg@kernel.org>
Signed-off-by: default avatarBenno Lossin <lossin@kernel.org>
parent 61d62ab0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -290,6 +290,11 @@
    ptr::{self, NonNull},
};

// This is used by doc-tests -- the proc-macros expand to `::pin_init::...` and without this the
// doc-tests wouldn't have an extern crate named `pin_init`.
#[allow(unused_extern_crates)]
extern crate self as pin_init;

#[doc(hidden)]
pub mod __internal;
#[doc(hidden)]