* [PATCH 1/2] rust: str: use the "kernel vertical" imports style
@ 2026-06-09 10:41 Miguel Ojeda
2026-06-09 10:41 ` [PATCH 2/2] rust: str: clean unused import for Rust >= 1.98 Miguel Ojeda
2026-06-09 11:45 ` [PATCH 1/2] rust: str: use the "kernel vertical" imports style Gary Guo
0 siblings, 2 replies; 5+ messages in thread
From: Miguel Ojeda @ 2026-06-09 10:41 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
rust-for-linux
Format the Rust prelude to use the "kernel vertical" imports style [1].
No functional changes intended.
Link: https://docs.kernel.org/rust/coding-guidelines.html#imports [1]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
rust/kernel/str.rs | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs
index a435674f05ea..4eae05e4baf9 100644
--- a/rust/kernel/str.rs
+++ b/rust/kernel/str.rs
@@ -3,14 +3,28 @@
//! String representations.
use crate::{
- alloc::{flags::*, AllocError, KVec},
- error::{to_result, Result},
- fmt::{self, Write},
- prelude::*,
+ alloc::{
+ flags::*,
+ AllocError,
+ KVec, //
+ },
+ error::{
+ to_result,
+ Result, //
+ },
+ fmt::{
+ self,
+ Write, //
+ },
+ prelude::*, //
};
use core::{
marker::PhantomData,
- ops::{Deref, DerefMut, Index},
+ ops::{
+ Deref,
+ DerefMut,
+ Index, //
+ }, //
};
pub use crate::prelude::CStr;
--
2.54.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] rust: str: clean unused import for Rust >= 1.98
2026-06-09 10:41 [PATCH 1/2] rust: str: use the "kernel vertical" imports style Miguel Ojeda
@ 2026-06-09 10:41 ` Miguel Ojeda
2026-06-09 10:45 ` Alice Ryhl
2026-06-09 11:45 ` Gary Guo
2026-06-09 11:45 ` [PATCH 1/2] rust: str: use the "kernel vertical" imports style Gary Guo
1 sibling, 2 replies; 5+ messages in thread
From: Miguel Ojeda @ 2026-06-09 10:41 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
rust-for-linux, stable
Starting with Rust 1.98.0 (expected 2026-08-20), the compiler has changed
how the resolution algorithm works [1][2] in upstream commit c4d84db5f184
("Resolver: Batched import resolution."), and it now spots:
error: unused import: `flags::*`
--> rust/kernel/str.rs:7:9
|
7 | flags::*,
| ^^^^^^^^
|
= note: `-D unused-imports` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(unused_imports)]`
It happens to not be needed because the `prelude::*` already provides
the flags.
Thus clean it up.
Cc: stable@vger.kernel.org # Needed in 6.18.y and later (prelude added to `str`).
Link: https://github.com/rust-lang/rust/pull/145108 [1]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
rust/kernel/str.rs | 1 -
1 file changed, 1 deletion(-)
diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs
index 4eae05e4baf9..b3caa9a1c898 100644
--- a/rust/kernel/str.rs
+++ b/rust/kernel/str.rs
@@ -4,7 +4,6 @@
use crate::{
alloc::{
- flags::*,
AllocError,
KVec, //
},
--
2.54.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] rust: str: clean unused import for Rust >= 1.98
2026-06-09 10:41 ` [PATCH 2/2] rust: str: clean unused import for Rust >= 1.98 Miguel Ojeda
@ 2026-06-09 10:45 ` Alice Ryhl
2026-06-09 11:45 ` Gary Guo
1 sibling, 0 replies; 5+ messages in thread
From: Alice Ryhl @ 2026-06-09 10:45 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, Danilo Krummrich, rust-for-linux,
stable
On Tue, Jun 9, 2026 at 12:42 PM Miguel Ojeda <ojeda@kernel.org> wrote:
>
> Starting with Rust 1.98.0 (expected 2026-08-20), the compiler has changed
> how the resolution algorithm works [1][2] in upstream commit c4d84db5f184
> ("Resolver: Batched import resolution."), and it now spots:
>
> error: unused import: `flags::*`
> --> rust/kernel/str.rs:7:9
> |
> 7 | flags::*,
> | ^^^^^^^^
> |
> = note: `-D unused-imports` implied by `-D warnings`
> = help: to override `-D warnings` add `#[allow(unused_imports)]`
>
> It happens to not be needed because the `prelude::*` already provides
> the flags.
>
> Thus clean it up.
>
> Cc: stable@vger.kernel.org # Needed in 6.18.y and later (prelude added to `str`).
> Link: https://github.com/rust-lang/rust/pull/145108 [1]
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
I ran into this one too.
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] rust: str: use the "kernel vertical" imports style
2026-06-09 10:41 [PATCH 1/2] rust: str: use the "kernel vertical" imports style Miguel Ojeda
2026-06-09 10:41 ` [PATCH 2/2] rust: str: clean unused import for Rust >= 1.98 Miguel Ojeda
@ 2026-06-09 11:45 ` Gary Guo
1 sibling, 0 replies; 5+ messages in thread
From: Gary Guo @ 2026-06-09 11:45 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
rust-for-linux
On Tue Jun 9, 2026 at 11:41 AM BST, Miguel Ojeda wrote:
> Format the Rust prelude to use the "kernel vertical" imports style [1].
>
> No functional changes intended.
>
> Link: https://docs.kernel.org/rust/coding-guidelines.html#imports [1]
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Reviewed-by: Gary Guo <gary@garyguo.net>
> ---
> rust/kernel/str.rs | 24 +++++++++++++++++++-----
> 1 file changed, 19 insertions(+), 5 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] rust: str: clean unused import for Rust >= 1.98
2026-06-09 10:41 ` [PATCH 2/2] rust: str: clean unused import for Rust >= 1.98 Miguel Ojeda
2026-06-09 10:45 ` Alice Ryhl
@ 2026-06-09 11:45 ` Gary Guo
1 sibling, 0 replies; 5+ messages in thread
From: Gary Guo @ 2026-06-09 11:45 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
rust-for-linux, stable
On Tue Jun 9, 2026 at 11:41 AM BST, Miguel Ojeda wrote:
> Starting with Rust 1.98.0 (expected 2026-08-20), the compiler has changed
> how the resolution algorithm works [1][2] in upstream commit c4d84db5f184
> ("Resolver: Batched import resolution."), and it now spots:
>
> error: unused import: `flags::*`
> --> rust/kernel/str.rs:7:9
> |
> 7 | flags::*,
> | ^^^^^^^^
> |
> = note: `-D unused-imports` implied by `-D warnings`
> = help: to override `-D warnings` add `#[allow(unused_imports)]`
>
> It happens to not be needed because the `prelude::*` already provides
> the flags.
>
> Thus clean it up.
>
> Cc: stable@vger.kernel.org # Needed in 6.18.y and later (prelude added to `str`).
> Link: https://github.com/rust-lang/rust/pull/145108 [1]
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Reviewed-by: Gary Guo <gary@garyguo.net>
> ---
> rust/kernel/str.rs | 1 -
> 1 file changed, 1 deletion(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-06-09 11:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 10:41 [PATCH 1/2] rust: str: use the "kernel vertical" imports style Miguel Ojeda
2026-06-09 10:41 ` [PATCH 2/2] rust: str: clean unused import for Rust >= 1.98 Miguel Ojeda
2026-06-09 10:45 ` Alice Ryhl
2026-06-09 11:45 ` Gary Guo
2026-06-09 11:45 ` [PATCH 1/2] rust: str: use the "kernel vertical" imports style Gary Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox