Re: [PATCH v9 16/31] rust: ptr: add const_align_up()

From: Miguel Ojeda

Date: Tue Mar 31 2026 - 06:27:38 EST


On Tue, Mar 31, 2026 at 4:36 AM John Hubbard <jhubbard@xxxxxxxxxx> wrote:
>
> Actually no, it's the opposite! Rust for Linux code overwhelmingly
> (I counted ~200 cases) prefers the "put it all in one line" style,
> in examples.
>
> In fact, I did both grep and AI-powered searches, and failed to find
> even a single example of the one-import-per-line style in doc comment
> examples.

Yeah, it is because it is not decided -- Andreas, for instance, had a
case a month ago where there were many imports for a particular
example, so it would take a lot of lines (if not hidden) and, in
principle, merge conflicts shouldn't be an issue that often there:

https://lore.kernel.org/rust-for-linux/87ikbn2x4n.fsf@xxxxxxxxx-host-address-is-not-set/

On the other hand, consistency is good (and simpler to not to remember
different rules depending on the context etc.).

Thoughts/feedback on the matter would be nice to have -- thanks!

Cheers,
Miguel