Re: [PATCH 4/4] rust: macros: Enable the rest of the tests

From: Ethan D. Twardy
Date: Wed Jun 26 2024 - 19:12:27 EST


On Mon Jun 24, 2024 at 3:47 AM CDT, Alice Ryhl wrote:
> On Mon, Jun 24, 2024 at 5:04 AM Ethan D. Twardy <ethan.twardy@xxxxxxxxx> wrote:
> >
> > Now that the rusttest target for the macros crate is compiled with the
> > kernel crate as a dependency, the rest of the rustdoc tests can be
> > enabled.
> >
> > Signed-off-by: Ethan D. Twardy <ethan.twardy@xxxxxxxxx>
> >
> > diff --git a/rust/macros/lib.rs b/rust/macros/lib.rs
> > index 8afed8facb21..6d764099563b 100644
> > --- a/rust/macros/lib.rs
> > +++ b/rust/macros/lib.rs
> > @@ -102,7 +102,9 @@ pub fn module(ts: TokenStream) -> TokenStream {
> > ///
> > /// # Examples
> > ///
> > -/// ```ignore
> > +/// ```rust
> > +/// # #[macro_use] extern crate macros;
> > +/// # #[macro_use] extern crate kernel;
>
> You also added these lines in patch 2, but you did not make them hidden there.
>

I made these hidden in patch 2, since I would not expect them to be
necessary in normal kernel code. Please let me know if that's not the
case!

> The empty line above this import should probably be removed to improve
> how this is rendered.

And

> I'm pretty sure `#[pin_data]` is in our prelude and doesn't need an
> import in normal code. If it needs an import in the test, then please
> add a hidden import rather than using the full path.

Will also land in v2. Thank you very much for your time in reviewing
this patch series! Did you intend to offer your Reviewed-by signoff for
this patch (4/4) as well?

Ethan