Re: [PATCH v2 4/4] rust: Move register and bitstruct macros out of Nova

Miguel Ojeda
2025-09-08T18:39:34Z

On Mon, Sep 8, 2025 at 7:06 PM Joel Fernandes <joelagnelf@nvidia.com> wrote:
>
> The issue I ran into is, without adding it to prelude, the users of register!
> macro will have to import both bitfield! and register! macros explictly, even
> though they're only using register!. I tried to make it work without adding to
> prelude, but couldn't:
>
> use kernel::{bitfield, register};
>
> Also not adding it to prelude, means register! macro has to invoke bitfield with
> $crate prefixed ($crate::bitfield).

I am not sure I follow -- macros should use qualified paths in general
so that they assume as little as possible from the calling
environment.

It should work without the prelude -- what didn't work?

Thanks!

Cheers,
Miguel