rust: str: use the "kernel vertical" imports style
Subsystems (2)
Miguel Ojeda
maintainerPATCH 1/2 rust: str: use the "kernel vertical" imports style
Format the Rust prelude to use the "kernel vertical" imports style [1].
No functional changes intended.
--- rust/kernel/str.rs | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-)
rust/kernel/str.rs +19 -5
@@ -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 ;
Signature · 1 line
2.54.0
Miguel Ojeda
maintainerPATCH 2/2 rust: str: clean unused import for Rust >= 1.98
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.
--- rust/kernel/str.rs | 1 - 1 file changed, 1 deletion(-)
rust/kernel/str.rs +0 -1
@@ -4,7 +4,6 @@use crate ::{ alloc::{ - flags::*,AllocError ,KVec ,// },
Signature · 1 line
2.54.0
Re: [PATCH 2/2] rust: str: clean unused import for Rust >= 1.98
Quoted 14 lines · Miguel Ojeda
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)]`
Quoted 8 lines
It happens to not be needed because the
prelude::*already provides the flags.Thus clean it up.
Cc [email protected] # Needed in 6.18.y and later (prelude added to `str`).Signed-off-by Miguel Ojeda <[email protected]>
I ran into this one too.
Re: [PATCH 2/2] rust: str: clean unused import for Rust >= 1.98
In reply to Miguel OjedaQuoted 13 lines · Miguel Ojeda
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)]`
Quoted 8 lines
It happens to not be needed because the
prelude::*already provides the flags.Thus clean it up.
Cc [email protected] # Needed in 6.18.y and later (prelude added to `str`).Signed-off-by Miguel Ojeda <[email protected]>
Quoted 3 lines
--- rust/kernel/str.rs | 1 - 1 file changed, 1 deletion(-)
Quoted 6 lines · Miguel Ojeda
Format the Rust prelude to use the "kernel vertical" imports style [1].
No functional changes intended.
Signed-off-by Miguel Ojeda <[email protected]>
Quoted 3 lines
--- rust/kernel/str.rs | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-)
Miguel Ojeda
AppliedQuoted 7 lines · Miguel Ojeda
Format the Rust prelude to use the "kernel vertical" imports style [1].
No functional changes intended.
Signed-off-by Miguel Ojeda <[email protected]>
Applied series to rust-next since the second is a "fix" for nightly I would like to have in linux-next -- thanks everyone!
I fixed the description here (and made it match with the other two Andreas' patches I picked), and removed a spurious "[2]" in the second one.
Cheers,
Miguel