* [PATCH] rust: prelude: remove `size_of` and friends
@ 2026-11-28 16:07 Gary Guo
2026-11-30 11:09 ` Alice Ryhl
0 siblings, 1 reply; 4+ messages in thread
From: Gary Guo @ 2026-11-28 16:07 UTC (permalink / raw)
To: Miguel Ojeda, Boqun Feng, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
Daniel Almeida, Tamir Duberstein, Alexandre Courbot,
Onur Özkan
Cc: rust-for-linux, Gary Guo
From: Gary Guo <gary@garyguo.net>
`align_of`, `align_of_val`, `size_of` and `size_of_val` has been in the
core prelude since Rust 1.80. As kernel's minimum Rust version is 1.85, the
manual inclusion of these in the kernel prelude is no longer necessary,
thus remove it.
Signed-off-by: Gary Guo <gary@garyguo.net>
---
rust/kernel/prelude.rs | 6 ------
1 file changed, 6 deletions(-)
diff --git a/rust/kernel/prelude.rs b/rust/kernel/prelude.rs
index edaf1e4c174b..10d322071c75 100644
--- a/rust/kernel/prelude.rs
+++ b/rust/kernel/prelude.rs
@@ -13,12 +13,6 @@
#[doc(no_inline)]
pub use core::{
- mem::{
- align_of,
- align_of_val,
- size_of,
- size_of_val, //
- },
pin::Pin, //
};
---
base-commit: 7cfbf79c66c63e807ea452abf0546e6f6d6833a6
change-id: 20261128-dev-prelude-1c7d25758d07
Best regards,
--
Gary Guo <gary@garyguo.net>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] rust: prelude: remove `size_of` and friends
2026-11-28 16:07 [PATCH] rust: prelude: remove `size_of` and friends Gary Guo
@ 2026-11-30 11:09 ` Alice Ryhl
2026-11-30 16:15 ` Miguel Ojeda
0 siblings, 1 reply; 4+ messages in thread
From: Alice Ryhl @ 2026-11-30 11:09 UTC (permalink / raw)
To: Gary Guo
Cc: Alice Ryhl, Miguel Ojeda, Boqun Feng, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Trevor Gross, Danilo Krummrich,
Daniel Almeida, Tamir Duberstein, Alexandre Courbot,
Onur Özkan, rust-for-linux, Gary Guo
On Sat, Nov 28, 2026 at 04:07:22PM +0000, Gary Guo wrote:
> `align_of`, `align_of_val`, `size_of` and `size_of_val` has been in the
> core prelude since Rust 1.80. As kernel's minimum Rust version is 1.85, the
> manual inclusion of these in the kernel prelude is no longer necessary,
> thus remove it.
>
> Signed-off-by: Gary Guo <gary@garyguo.net>
This patch introduces two `unused_imports` warnings, because these two
files only used `size_of` from the kernel prelude:
warning: unused import: `crate::prelude::*`
--> rust/kernel/num/casts.rs:44:5
|
44 | use crate::prelude::*;
| ^^^^^^^^^^^^^^^^^
warning: unused import: `prelude`
--> drivers/gpu/nova-core/num.rs:10:5
|
10 | prelude::*, //
| ^^^^^^^
Those two unused prelude imports will need to be removed as well.
Alice
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rust: prelude: remove `size_of` and friends
2026-11-30 11:09 ` Alice Ryhl
@ 2026-11-30 16:15 ` Miguel Ojeda
2026-11-30 16:39 ` Gary Guo
0 siblings, 1 reply; 4+ messages in thread
From: Miguel Ojeda @ 2026-11-30 16:15 UTC (permalink / raw)
To: Alice Ryhl
Cc: Gary Guo, Miguel Ojeda, Boqun Feng, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Trevor Gross, Danilo Krummrich,
Daniel Almeida, Tamir Duberstein, Alexandre Courbot,
Onur Özkan, rust-for-linux, Gary Guo
On Mon, Nov 30, 2026 at 12:10 PM Alice Ryhl <aliceryhl@google.com> wrote:
>
> warning: unused import: `prelude`
> --> drivers/gpu/nova-core/num.rs:10:5
> |
> 10 | prelude::*, //
> | ^^^^^^^
This one is only on `drm-rust-next`, right? So we can clean it up on
conflict (or, actually, you could remove it already in that branch).
Cheers,
Miguel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rust: prelude: remove `size_of` and friends
2026-11-30 16:15 ` Miguel Ojeda
@ 2026-11-30 16:39 ` Gary Guo
0 siblings, 0 replies; 4+ messages in thread
From: Gary Guo @ 2026-11-30 16:39 UTC (permalink / raw)
To: Miguel Ojeda, Alice Ryhl
Cc: Gary Guo, Miguel Ojeda, Boqun Feng, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Trevor Gross, Danilo Krummrich,
Daniel Almeida, Tamir Duberstein, Alexandre Courbot,
Onur Özkan, rust-for-linux, Gary Guo
On Mon Nov 30, 2026 at 4:15 PM GMT, Miguel Ojeda wrote:
> On Mon, Nov 30, 2026 at 12:10 PM Alice Ryhl <aliceryhl@google.com> wrote:
>>
>> warning: unused import: `prelude`
>> --> drivers/gpu/nova-core/num.rs:10:5
>> |
>> 10 | prelude::*, //
>> | ^^^^^^^
>
> This one is only on `drm-rust-next`, right? So we can clean it up on
> conflict (or, actually, you could remove it already in that branch).
I sent
https://lore.kernel.org/nova-gpu/20261130-dev-nova-num-v1-1-6f8e19907b9d@garyguo.net/.
I think we would need to wait for next cycle to remove the prelude import.
Best,
Gary
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-30 16:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-28 16:07 [PATCH] rust: prelude: remove `size_of` and friends Gary Guo
2026-11-30 11:09 ` Alice Ryhl
2026-11-30 16:15 ` Miguel Ojeda
2026-11-30 16:39 ` Gary Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox