Thread (9 messages) flat view 9 messages, 6 authors, 2026-02-04

Re: [PATCH] rust: Add PowerPC support

From: Alice Ryhl <aliceryhl@google.com>
Date: 2026-02-04 13:36:53
Also in: linux-doc, lkml, llvm, rust-for-linux

On Wed, Feb 04, 2026 at 02:06:53PM +0100, Peter Zijlstra wrote:
On Wed, Feb 04, 2026 at 12:55:17PM +0000, Alice Ryhl wrote:
quoted
Is there any reason to not make it Rust-only but for all Rust code?
Making the / operator work seems like it would be a good idea.
Why would it be a good idea to have it work on non-native types in Rust?

The reason we don't have them in C is because non-native divisions are
expensive and doing them should be a conscious choice. The very same
argument should be true for Rust code too.
I suppose that's fair. Perhaps one way to go about it could be to create
a clippy lint for 64-bit divisions telling you to use an explicit
division method?

This way cases such as `core` that use division can still use the slash
operator because the lint is not enabled when building core. And normal
kernel code would be told to use the explicit method instead. Or kernel
code could explicitly choose to silence the lint on a specific method if
they want to perform a lot of divisions and know what they are doing.

Alice
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help