Re: [PATCH v3 0/4] Enable rustdoc tests for the macros crate

From: Miguel Ojeda
Date: Fri Nov 01 2024 - 17:53:36 EST


On Thu, Jul 4, 2024 at 4:57 PM Ethan D. Twardy <ethan.twardy@xxxxxxxxx> wrote:
>
> This patch series addresses GitHub issue Rust-For-Linux/linux#1076 by
> enabling the rustdoc tests for the macros crate and updating kbuild to
> compile these tests with appropriate dependencies respected. Reviewers:
> Please pay particular attention to the Kbuild changes in rust/Makefile.
> I appreciate your time in reviewing this series!

Applied to `rust-next` -- thanks Ethan!

I had to rebase it and simplify/change/clean some things here and
there as you can see below, so it would be great if you can
double-check the result in the branch -- please let me know if you see
anything wrong!

[ Rebased (`alloc` is gone nowadays, sysroot handling is simpler) and
simplified (reused `rustdoc_test` rule instead of adding a new one,
no need for `rustdoc-compiler_builtins`, removed unneeded `macros`
explicit path). Made `vtable` example fail (avoiding to increase
the complexity in the `rusttest` target). Removed unstable
`-Zproc-macro-backtrace` option. Reworded accordingly. - Miguel ]

[ Rebased (moved the `export` to the `rustdoc_test` rule, enable the
firmware example too). Removed `export` for `RUST_MODFILE`. Removed
unneeded `rust` language in examples, as well as `#[macro_use]`
`extern`s. Reworded accordingly. - Miguel ]

[ Rebased (one fix was already applied) and reworded. Remove unneeded
`rust` as language in examples. - Miguel ]

[ Rebased (use `K{Box,Vec}` instead, enable `lint_reasons` feature).
Remove unneeded `rust` as language in examples, as well as
`#[macro_use]` `extern`s. - Miguel ]

I think we could also simplify some of those tests (I think the
examples are clear without so many constants), but I didn't want to
introduce extra/unneeded changes to your series.

Thanks!

Cheers,
Miguel